This commit is contained in:
Javier Casares 2026-08-24 13:41:08 +00:00
commit 476389b914
84 changed files with 1864 additions and 305 deletions

View file

@ -204,6 +204,13 @@ class AwsClient implements AwsClientInterface
* signature version to use with a service (e.g., v4). Note that
* per/operation signature version MAY override this requested signature
* version.
* - transport_sharing: (string) Set to a transport sharing mode ("none",
* "handler_prefer", "handler_require", "persistent_prefer", or
* "persistent_require") to enable connection sharing on the default
* HTTP handler. The "*_prefer" modes degrade gracefully when the
* installed version of Guzzle or the runtime cannot honor them, and
* the "*_require" modes throw. This option only applies when the SDK
* creates the default HTTP handler.
* - use_aws_shared_config_files: (bool, default=bool(true)) Set to false to
* disable checking for shared config file in '~/.aws/config' and
* '~/.aws/credentials'. This will override the AWS_CONFIG_FILE

View file

@ -30,6 +30,7 @@ use Aws\EndpointV2\EndpointDefinitionProvider;
use Aws\EndpointV2\EndpointProviderV2;
use Aws\Exception\AwsException;
use Aws\Exception\InvalidRegionException;
use Aws\Handler\HttpTransportSharing;
use Aws\Retry\ConfigurationInterface as RetryConfigInterface;
use Aws\Retry\ConfigurationProvider as RetryConfigProvider;
use Aws\Retry\V3\OptIn as NewRetriesOptIn;
@ -293,6 +294,12 @@ class ClientResolver
'default' => [],
'doc' => 'Set to an array of SDK request options to apply to each request (e.g., proxy, verify, etc.).',
],
'transport_sharing' => [
'type' => 'value',
'valid' => ['string'],
'doc' => 'Set to a transport sharing mode ("none", "handler_prefer", "handler_require", "persistent_prefer", or "persistent_require") to enable connection sharing on the default HTTP handler. The "*_prefer" modes degrade gracefully when the installed version of Guzzle or the runtime cannot honor them, and the "*_require" modes throw. This option only applies when the SDK creates the default HTTP handler, and the "*_require" modes throw when combined with a custom "handler" or "http_handler" option.',
'fn' => [__CLASS__, '_apply_transport_sharing'],
],
'http_handler' => [
'type' => 'value',
'valid' => ['callable'],
@ -988,7 +995,7 @@ class ClientResolver
public static function _default_handler(array &$args)
{
return new WrappedHttpHandler(
default_http_handler(),
default_http_handler($args['transport_sharing'] ?? null),
$args['parser'],
$args['error_parser'],
$args['exception_class'],
@ -1007,6 +1014,21 @@ class ClientResolver
);
}
public static function _apply_transport_sharing($value, array &$args)
{
HttpTransportSharing::validate($value);
if ((isset($args['http_handler']) || isset($args['handler']))
&& HttpTransportSharing::isRequired($value)
) {
throw new IAE('The "transport_sharing" option can only'
. ' require transport sharing when the SDK creates the'
. ' default HTTP handler. Remove the "handler" or'
. ' "http_handler" option, or configure transport sharing'
. ' on the custom handler instead.');
}
}
public static function _apply_app_id($value, array &$args)
{
// AppId should not be longer than 50 chars

View file

@ -95,6 +95,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createEmailAddressAsync(array $args = [])
* @method \Aws\Result createEvaluationForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise createEvaluationFormAsync(array $args = [])
* @method \Aws\Result createExtractionDefinition(array $args = [])
* @method \GuzzleHttp\Promise\Promise createExtractionDefinitionAsync(array $args = [])
* @method \Aws\Result createHoursOfOperation(array $args = [])
* @method \GuzzleHttp\Promise\Promise createHoursOfOperationAsync(array $args = [])
* @method \Aws\Result createHoursOfOperationOverride(array $args = [])
@ -175,6 +177,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteEmailAddressAsync(array $args = [])
* @method \Aws\Result deleteEvaluationForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteEvaluationFormAsync(array $args = [])
* @method \Aws\Result deleteExtractionDefinition(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteExtractionDefinitionAsync(array $args = [])
* @method \Aws\Result deleteHoursOfOperation(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteHoursOfOperationAsync(array $args = [])
* @method \Aws\Result deleteHoursOfOperationOverride(array $args = [])
@ -253,6 +257,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeEmailAddressAsync(array $args = [])
* @method \Aws\Result describeEvaluationForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeEvaluationFormAsync(array $args = [])
* @method \Aws\Result describeExtractionDefinition(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeExtractionDefinitionAsync(array $args = [])
* @method \Aws\Result describeHoursOfOperation(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeHoursOfOperationAsync(array $args = [])
* @method \Aws\Result describeHoursOfOperationOverride(array $args = [])
@ -421,6 +427,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listEvaluationFormVersionsAsync(array $args = [])
* @method \Aws\Result listEvaluationForms(array $args = [])
* @method \GuzzleHttp\Promise\Promise listEvaluationFormsAsync(array $args = [])
* @method \Aws\Result listExtractionDefinitions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listExtractionDefinitionsAsync(array $args = [])
* @method \Aws\Result listFlowAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFlowAssociationsAsync(array $args = [])
* @method \Aws\Result listHoursOfOperationOverrides(array $args = [])
@ -687,6 +695,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise updateEmailAddressMetadataAsync(array $args = [])
* @method \Aws\Result updateEvaluationForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateEvaluationFormAsync(array $args = [])
* @method \Aws\Result updateExtractionDefinition(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateExtractionDefinitionAsync(array $args = [])
* @method \Aws\Result updateHoursOfOperation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateHoursOfOperationAsync(array $args = [])
* @method \Aws\Result updateHoursOfOperationOverride(array $args = [])

View file

@ -5,6 +5,8 @@ use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon Elastic Container Service for Kubernetes** service.
* @method \Aws\Result activateCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise activateCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result associateAccessPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateAccessPolicyAsync(array $args = [])
* @method \Aws\Result associateEncryptionConfig(array $args = [])
@ -19,6 +21,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createAddonAsync(array $args = [])
* @method \Aws\Result createCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise createCapabilityAsync(array $args = [])
* @method \Aws\Result createCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise createCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result createCluster(array $args = [])
* @method \GuzzleHttp\Promise\Promise createClusterAsync(array $args = [])
* @method \Aws\Result createEksAnywhereSubscription(array $args = [])
@ -35,6 +39,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteAddonAsync(array $args = [])
* @method \Aws\Result deleteCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCapabilityAsync(array $args = [])
* @method \Aws\Result deleteCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result deleteCluster(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteClusterAsync(array $args = [])
* @method \Aws\Result deleteEksAnywhereSubscription(array $args = [])
@ -57,6 +63,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeAddonVersionsAsync(array $args = [])
* @method \Aws\Result describeCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeCapabilityAsync(array $args = [])
* @method \Aws\Result describeCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result describeCluster(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeClusterAsync(array $args = [])
* @method \Aws\Result describeClusterVersions(array $args = [])
@ -91,6 +99,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listAssociatedAccessPoliciesAsync(array $args = [])
* @method \Aws\Result listCapabilities(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCapabilitiesAsync(array $args = [])
* @method \Aws\Result listCertificateAuthorities(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCertificateAuthoritiesAsync(array $args = [])
* @method \Aws\Result listClusters(array $args = [])
* @method \GuzzleHttp\Promise\Promise listClustersAsync(array $args = [])
* @method \Aws\Result listEksAnywhereSubscriptions(array $args = [])

View file

@ -2,6 +2,7 @@
namespace Aws\Handler\Guzzle;
use Aws\Handler\HttpHandlerError;
use Aws\Handler\HttpTransportSharing;
use GuzzleHttp\Utils;
use GuzzleHttp\Promise;
use GuzzleHttp\Client;
@ -18,11 +19,23 @@ class GuzzleHandler
private $client;
/**
* @param ClientInterface $client
* @param ClientInterface|null $client
* @param string|null $transportSharing
*/
public function __construct(?ClientInterface $client = null)
{
$this->client = $client ?: new Client();
public function __construct(
?ClientInterface $client = null,
?string $transportSharing = null
) {
if ($client !== null && HttpTransportSharing::isRequired($transportSharing)) {
throw new \InvalidArgumentException('The provided transport'
. ' sharing mode cannot require sharing when a client is'
. ' provided. Configure the "transport_sharing" option on'
. ' the provided client instead.');
}
$this->client = $client ?: new Client(
HttpTransportSharing::toClientConfig($transportSharing)
);
}
/**

View file

@ -0,0 +1,118 @@
<?php
namespace Aws\Handler;
use GuzzleHttp\TransportSharing;
/**
* @internal
*/
final class HttpTransportSharing
{
private const NONE = 'none';
private const HANDLER_PREFER = 'handler_prefer';
private const HANDLER_REQUIRE = 'handler_require';
private const PERSISTENT_PREFER = 'persistent_prefer';
private const PERSISTENT_REQUIRE = 'persistent_require';
private const MODES = [
self::NONE,
self::HANDLER_PREFER,
self::HANDLER_REQUIRE,
self::PERSISTENT_PREFER,
self::PERSISTENT_REQUIRE,
];
public static function isRequired(?string $mode): bool
{
return $mode === self::HANDLER_REQUIRE
|| $mode === self::PERSISTENT_REQUIRE;
}
/**
* Validates a requested transport sharing mode without resolving it
* against the capabilities of the installed version of Guzzle.
*/
public static function validate(?string $mode): void
{
if ($mode !== null && !in_array($mode, self::MODES, true)) {
throw new \InvalidArgumentException('The provided transport'
. ' sharing mode "' . $mode . '" is invalid. Valid modes are:'
. ' "none", "handler_prefer", "handler_require",'
. ' "persistent_prefer", "persistent_require".');
}
}
/**
* Resolves a requested transport sharing mode to the mode that should be
* passed to the installed version of Guzzle, or null when no mode should
* be passed. The "*_prefer" modes degrade gracefully when the installed
* version of Guzzle cannot honor them, and the "*_require" modes throw.
*/
public static function resolve(?string $mode): ?string
{
self::validate($mode);
if ($mode === null || $mode === self::NONE) {
return null;
}
// Guzzle 8: all modes are understood, and Guzzle enforces the
// runtime requirements of the "*_require" modes itself.
if (self::supportsPersistentSharing()) {
return $mode;
}
// Guzzle 7.11+: handler-lifetime sharing only.
if (self::supportsHandlerSharing()) {
if ($mode === self::PERSISTENT_PREFER) {
return self::HANDLER_PREFER;
}
if ($mode === self::PERSISTENT_REQUIRE) {
throw new \RuntimeException('The "persistent_require"'
. ' transport sharing mode requires guzzlehttp/guzzle'
. ' ^8.0.');
}
return $mode;
}
// Guzzle < 7.11: no transport sharing support.
if ($mode === self::PERSISTENT_REQUIRE) {
throw new \RuntimeException('The "persistent_require" transport'
. ' sharing mode requires guzzlehttp/guzzle ^8.0.');
}
if ($mode === self::HANDLER_REQUIRE) {
throw new \RuntimeException('The "handler_require" transport'
. ' sharing mode requires guzzlehttp/guzzle ^7.11 || ^8.0.');
}
return null;
}
/**
* Resolves a requested transport sharing mode to a Guzzle client
* constructor configuration array.
*/
public static function toClientConfig(?string $mode): array
{
$mode = self::resolve($mode);
return $mode === null ? [] : ['transport_sharing' => $mode];
}
private static function supportsPersistentSharing(): bool
{
static $supported;
return $supported ??= defined(TransportSharing::class . '::PERSISTENT_PREFER');
}
private static function supportsHandlerSharing(): bool
{
static $supported;
return $supported ??= class_exists(TransportSharing::class);
}
}

View file

@ -48,6 +48,8 @@ use Aws\Middleware;
* @method \GuzzleHttp\Promise\Promise deleteLayerVersionAsync(array $args = [])
* @method \Aws\Result deleteProvisionedConcurrencyConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteProvisionedConcurrencyConfigAsync(array $args = [])
* @method \Aws\Result deleteResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteResourcePolicyAsync(array $args = [])
* @method \Aws\Result getAccountSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountSettingsAsync(array $args = [])
* @method \Aws\Result getAlias(array $args = [])
@ -90,6 +92,8 @@ use Aws\Middleware;
* @method \GuzzleHttp\Promise\Promise getPolicyAsync(array $args = [])
* @method \Aws\Result getProvisionedConcurrencyConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise getProvisionedConcurrencyConfigAsync(array $args = [])
* @method \Aws\Result getResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getResourcePolicyAsync(array $args = [])
* @method \Aws\Result getRuntimeManagementConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRuntimeManagementConfigAsync(array $args = [])
* @method \Aws\Result invoke(array $args = [])
@ -144,6 +148,8 @@ use Aws\Middleware;
* @method \GuzzleHttp\Promise\Promise putFunctionScalingConfigAsync(array $args = [])
* @method \Aws\Result putProvisionedConcurrencyConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise putProvisionedConcurrencyConfigAsync(array $args = [])
* @method \Aws\Result putResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise putResourcePolicyAsync(array $args = [])
* @method \Aws\Result putRuntimeManagementConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise putRuntimeManagementConfigAsync(array $args = [])
* @method \Aws\Result removeLayerVersionPermission(array $args = [])

View file

@ -11,12 +11,16 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise cancelChangeSetAsync(array $args = [])
* @method \Aws\Result deleteResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteResourcePolicyAsync(array $args = [])
* @method \Aws\Result describeAssessment(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAssessmentAsync(array $args = [])
* @method \Aws\Result describeChangeSet(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeChangeSetAsync(array $args = [])
* @method \Aws\Result describeEntity(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeEntityAsync(array $args = [])
* @method \Aws\Result getResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getResourcePolicyAsync(array $args = [])
* @method \Aws\Result listAssessments(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAssessmentsAsync(array $args = [])
* @method \Aws\Result listChangeSets(array $args = [])
* @method \GuzzleHttp\Promise\Promise listChangeSetsAsync(array $args = [])
* @method \Aws\Result listEntities(array $args = [])

View file

@ -13,6 +13,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createOrderAsync(array $args = [])
* @method \Aws\Result createOutpost(array $args = [])
* @method \GuzzleHttp\Promise\Promise createOutpostAsync(array $args = [])
* @method \Aws\Result createPrivateConnectivityConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise createPrivateConnectivityConfigAsync(array $args = [])
* @method \Aws\Result createQuote(array $args = [])
* @method \GuzzleHttp\Promise\Promise createQuoteAsync(array $args = [])
* @method \Aws\Result createRenewal(array $args = [])
@ -41,6 +43,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getOutpostInstanceTypesAsync(array $args = [])
* @method \Aws\Result getOutpostSupportedInstanceTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise getOutpostSupportedInstanceTypesAsync(array $args = [])
* @method \Aws\Result getPrivateConnectivityConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPrivateConnectivityConfigAsync(array $args = [])
* @method \Aws\Result getQuote(array $args = [])
* @method \GuzzleHttp\Promise\Promise getQuoteAsync(array $args = [])
* @method \Aws\Result getRenewalPricing(array $args = [])

View file

@ -865,7 +865,7 @@ namespace Aws;
*/
class Sdk
{
const VERSION = '3.392.3';
const VERSION = '3.393.4';
/** @var array Arguments for creating clients */
private $args;
@ -884,7 +884,10 @@ class Sdk
$this->args = $args;
if (!isset($args['handler']) && !isset($args['http_handler'])) {
$this->args['http_handler'] = default_http_handler();
$this->args['http_handler'] = default_http_handler(
$args['transport_sharing'] ?? null
);
unset($this->args['transport_sharing']);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more