Skip to content

Commit

Permalink
Merge pull request opencart#14064 from TheCartpenter/patch-122
Browse files Browse the repository at this point in the history
Upgraded aws/aws-sdk-php vendor to v3.317.0
  • Loading branch information
danielkerr authored Aug 10, 2024
2 parents 96767f9 + dd702d9 commit 8fbe906
Show file tree
Hide file tree
Showing 68 changed files with 477 additions and 125 deletions.
31 changes: 17 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion upload/system/storage/vendor/aws/aws-sdk-php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"psr-4": {
"Aws\\": "src/"
},
"files": ["src/functions.php"]
"files": ["src/functions.php"],
"exclude-from-classmap": ["src/data/"]
},
"autoload-dev": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
class DateTimeResult extends \DateTime implements \JsonSerializable
{
private const ISO8601_NANOSECOND_REGEX = '/^(.*\.\d{6})(\d{1,3})(Z|[+-]\d{2}:\d{2})?$/';

/**
* Create a new DateTimeResult from a unix timestamp.
* The Unix epoch (or Unix time or POSIX time or Unix
Expand Down Expand Up @@ -60,6 +62,14 @@ public static function fromISO8601($iso8601Timestamp)
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromISO8601');
}

// Prior to 8.0.10, nanosecond precision is not supported
// Reduces to microsecond precision if nanosecond precision is detected
if (PHP_VERSION_ID < 80010
&& preg_match(self::ISO8601_NANOSECOND_REGEX, $iso8601Timestamp, $matches)
) {
$iso8601Timestamp = $matches[1] . ($matches[3] ?? '');
}

return new DateTimeResult($iso8601Timestamp);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function getOperation($name)
$this->definition['operations'][$name],
$this->shapeMap
);
} else if ($this->modifiedModel) {
} elseif ($this->modifiedModel) {
$this->operations[$name] = new Operation(
$this->definition['operations'][$name],
$this->shapeMap
Expand Down Expand Up @@ -517,6 +517,7 @@ public function getDefinition()
public function setDefinition($definition)
{
$this->definition = $definition;
$this->shapeMap = new ShapeMap($definition['shapes']);
$this->modifiedModel = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataIntegrationAsync(array $args = [])
* @method \Aws\Result createDataIntegrationAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataIntegrationAssociationAsync(array $args = [])
* @method \Aws\Result createEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createEventIntegrationAsync(array $args = [])
* @method \Aws\Result deleteApplication(array $args = [])
Expand Down Expand Up @@ -45,6 +47,8 @@
* @method \GuzzleHttp\Promise\Promise updateApplicationAsync(array $args = [])
* @method \Aws\Result updateDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataIntegrationAsync(array $args = [])
* @method \Aws\Result updateDataIntegrationAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataIntegrationAssociationAsync(array $args = [])
* @method \Aws\Result updateEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateEventIntegrationAsync(array $args = [])
*/
Expand Down
21 changes: 17 additions & 4 deletions upload/system/storage/vendor/aws/aws-sdk-php/src/AwsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ public static function getArguments()
* client-side parameter validation.
* - version: (string, required) The version of the webservice to
* utilize (e.g., 2006-03-01).
* - account_id_endpoint_mode: (string, default(preferred)) this option
* decides whether credentials should resolve an accountId value,
* which is going to be used as part of the endpoint resolution.
* The valid values for this option are:
* - preferred: when this value is set then, a warning is logged when
* accountId is empty in the resolved identity.
* - required: when this value is set then, an exception is thrown when
* accountId is empty in the resolved identity.
* - disabled: when this value is set then, the validation for if accountId
* was resolved or not, is ignored.
* - ua_append: (string, array) To pass custom user agent parameters.
* - app_id: (string) an optional application specific identifier that can be set.
* When set it will be appended to the User-Agent header of every request
Expand Down Expand Up @@ -245,7 +255,7 @@ public function __construct(array $args)
$this->region = $config['region'] ?? null;
$this->signingRegionSet = $config['sigv4a_signing_region_set'] ?? null;
$this->config = $config['config'];
$this->setClientBuiltIns($args);
$this->setClientBuiltIns($args, $config);
$this->clientContextParams = $this->setClientContextParams($args);
$this->defaultRequestOptions = $config['http'];
$this->endpointProvider = $config['endpoint_provider'];
Expand Down Expand Up @@ -578,7 +588,8 @@ private function addEndpointV2Middleware()
EndpointV2Middleware::wrap(
$this->endpointProvider,
$this->getApi(),
$endpointArgs
$endpointArgs,
$this->credentialProvider
),
'endpoint-resolution'
);
Expand Down Expand Up @@ -608,10 +619,10 @@ private function setClientContextParams($args)
/**
* Retrieves and sets default values used for endpoint resolution.
*/
private function setClientBuiltIns($args)
private function setClientBuiltIns($args, $resolvedConfig)
{
$builtIns = [];
$config = $this->getConfig();
$config = $resolvedConfig['config'];
$service = $args['service'];

$builtIns['SDK::Endpoint'] = null;
Expand All @@ -632,6 +643,8 @@ private function setClientBuiltIns($args)
$builtIns['AWS::S3::ForcePathStyle'] = $config['use_path_style_endpoint'];
$builtIns['AWS::S3::DisableMultiRegionAccessPoints'] = $config['disable_multiregion_access_points'];
}
$builtIns['AWS::Auth::AccountIdEndpointMode'] = $resolvedConfig['account_id_endpoint_mode'];

$this->clientBuiltIns += $builtIns;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* @method \GuzzleHttp\Promise\Promise createGuardrailAsync(array $args = [])
* @method \Aws\Result createGuardrailVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise createGuardrailVersionAsync(array $args = [])
* @method \Aws\Result createModelCopyJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise createModelCopyJobAsync(array $args = [])
* @method \Aws\Result createModelCustomizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise createModelCustomizationJobAsync(array $args = [])
* @method \Aws\Result createProvisionedModelThroughput(array $args = [])
Expand All @@ -31,6 +33,8 @@
* @method \GuzzleHttp\Promise\Promise getFoundationModelAsync(array $args = [])
* @method \Aws\Result getGuardrail(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGuardrailAsync(array $args = [])
* @method \Aws\Result getModelCopyJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelCopyJobAsync(array $args = [])
* @method \Aws\Result getModelCustomizationJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelCustomizationJobAsync(array $args = [])
* @method \Aws\Result getModelInvocationLoggingConfiguration(array $args = [])
Expand All @@ -45,6 +49,8 @@
* @method \GuzzleHttp\Promise\Promise listFoundationModelsAsync(array $args = [])
* @method \Aws\Result listGuardrails(array $args = [])
* @method \GuzzleHttp\Promise\Promise listGuardrailsAsync(array $args = [])
* @method \Aws\Result listModelCopyJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listModelCopyJobsAsync(array $args = [])
* @method \Aws\Result listModelCustomizationJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listModelCustomizationJobsAsync(array $args = [])
* @method \Aws\Result listProvisionedModelThroughputs(array $args = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,13 @@ class ClientResolver
'doc' => 'Set to false to disable checking for shared aws config files usually located in \'~/.aws/config\' and \'~/.aws/credentials\'. This will be ignored if you set the \'profile\' setting.',
'default' => true,
],
'account_id_endpoint_mode' => [
'type' => 'value',
'valid' => ['string'],
'doc' => 'Decides whether account_id must a be a required resolved credentials property. If this configuration is set to disabled, then account_id is not required. If set to preferred a warning will be logged when account_id is not resolved, and when set to required an exception will be thrown if account_id is not resolved.',
'default' => [__CLASS__, '_default_account_id_endpoint_mode'],
'fn' => [__CLASS__, '_apply_account_id_endpoint_mode']
],
'sigv4a_signing_region_set' => [
'type' => 'value',
'valid' => ['array', 'string'],
Expand Down Expand Up @@ -625,7 +632,8 @@ public static function _apply_credentials($value, array &$args)
$value['key'],
$value['secret'],
$value['token'] ?? null,
$value['expires'] ?? null
$value['expires'] ?? null,
$value['accountId'] ?? null
)
);
} elseif ($value === false) {
Expand Down Expand Up @@ -1095,6 +1103,29 @@ public static function _apply_idempotency_auto_fill(
}
}

public static function _default_account_id_endpoint_mode($args)
{
return ConfigurationResolver::resolve(
'account_id_endpoint_mode',
'preferred',
'string',
$args
);
}

public static function _apply_account_id_endpoint_mode($value, array &$args)
{
static $accountIdEndpointModes = ['disabled', 'required', 'preferred'];
if (!in_array($value, $accountIdEndpointModes)) {
throw new IAE(
"The value provided for the config account_id_endpoint_mode is invalid."
."Valid values are: " . implode(", ", $accountIdEndpointModes)
);
}

$args['account_id_endpoint_mode'] = $value;
}

public static function _default_endpoint_provider(array $args)
{
$service = $args['api'] ?? null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@

/**
* This client is used to interact with the **AWS Control Catalog** service.
* @method \Aws\Result getControl(array $args = [])
* @method \GuzzleHttp\Promise\Promise getControlAsync(array $args = [])
* @method \Aws\Result listCommonControls(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCommonControlsAsync(array $args = [])
* @method \Aws\Result listControls(array $args = [])
* @method \GuzzleHttp\Promise\Promise listControlsAsync(array $args = [])
* @method \Aws\Result listDomains(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDomainsAsync(array $args = [])
* @method \Aws\Result listObjectives(array $args = [])
Expand Down
Loading

0 comments on commit 8fbe906

Please sign in to comment.