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

View file

@ -1,5 +1,26 @@
== Changelog == == Changelog ==
= 2.1.8 =
_Release date: 2026-08-24_
**Changed**
* Added the `Update URI` header pointing to https://www.robotstxt.software/plugins/robotstxt-smtp-amazonses/ so WordPress never offers conflicting updates from other channels (takes effect on WordPress 5.8+); updates continue to be delivered exclusively through the Manager (by ROBOTSTXT) plugin.
* Updated bundled AWS SDK for PHP to 3.393.4 (now shipping Guzzle 8.1.0).
**Compatibility**
* WordPress: 5.7 - 7.1
* PHP: 8.2 - 8.5
**Tests**
* PHP_CodeSniffer: 3.13.6
* WordPress Coding Standards: 3.4.1
* PHPCompatibility: 9.3.5
* PHPStan: 2.2.9
= 2.1.7 = = 2.1.7 =
_Release date: 2026-08-17_ _Release date: 2026-08-17_

View file

@ -1,9 +1,9 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: SMTP Amazon SES (by ROBOTSTXT) 2.1.7\n" "Project-Id-Version: SMTP Amazon SES (by ROBOTSTXT) 2.1.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/robotstxt-smtp-" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/robotstxt-smtp-"
"amazonses\n" "amazonses\n"
"POT-Creation-Date: 2026-08-17T20:18:50+00:00\n" "POT-Creation-Date: 2026-08-24T12:46:43+00:00\n"
"PO-Revision-Date: 2026-08-17 19:30+0000\n" "PO-Revision-Date: 2026-08-17 19:30+0000\n"
"Last-Translator: ROBOTSTXT <robotstxt@robotstxt.es>\n" "Last-Translator: ROBOTSTXT <robotstxt@robotstxt.es>\n"
"Language-Team: Catalan\n" "Language-Team: Catalan\n"
@ -357,7 +357,7 @@ msgstr "L'ID de clau d'accés d'Amazon SES s'ha eliminat."
msgid "The Amazon SES Secret Access Key has been cleared." msgid "The Amazon SES Secret Access Key has been cleared."
msgstr "La clau d'accés secreta d'Amazon SES s'ha eliminat." msgstr "La clau d'accés secreta d'Amazon SES s'ha eliminat."
#: robotstxt-smtp-amazonses.php:83 #: robotstxt-smtp-amazonses.php:84
msgid "" msgid ""
"SMTP Amazon SES (by ROBOTSTXT) requires the SMTP (by ROBOTSTXT) plugin to be " "SMTP Amazon SES (by ROBOTSTXT) requires the SMTP (by ROBOTSTXT) plugin to be "
"installed and active." "installed and active."

View file

@ -1,9 +1,9 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: SMTP Amazon SES (by ROBOTSTXT) 2.1.7\n" "Project-Id-Version: SMTP Amazon SES (by ROBOTSTXT) 2.1.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/robotstxt-smtp-" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/robotstxt-smtp-"
"amazonses\n" "amazonses\n"
"POT-Creation-Date: 2026-08-17T20:18:50+00:00\n" "POT-Creation-Date: 2026-08-24T12:46:43+00:00\n"
"PO-Revision-Date: 2026-08-17 19:30+0000\n" "PO-Revision-Date: 2026-08-17 19:30+0000\n"
"Last-Translator: ROBOTSTXT <robotstxt@robotstxt.es>\n" "Last-Translator: ROBOTSTXT <robotstxt@robotstxt.es>\n"
"Language-Team: Spanish\n" "Language-Team: Spanish\n"
@ -356,7 +356,7 @@ msgstr "El ID de clave de acceso de Amazon SES se ha eliminado."
msgid "The Amazon SES Secret Access Key has been cleared." msgid "The Amazon SES Secret Access Key has been cleared."
msgstr "La clave de acceso secreta de Amazon SES se ha eliminado." msgstr "La clave de acceso secreta de Amazon SES se ha eliminado."
#: robotstxt-smtp-amazonses.php:83 #: robotstxt-smtp-amazonses.php:84
msgid "" msgid ""
"SMTP Amazon SES (by ROBOTSTXT) requires the SMTP (by ROBOTSTXT) plugin to be " "SMTP Amazon SES (by ROBOTSTXT) requires the SMTP (by ROBOTSTXT) plugin to be "
"installed and active." "installed and active."

View file

@ -2,14 +2,14 @@
# This file is distributed under the GPL-3.0-or-later. # This file is distributed under the GPL-3.0-or-later.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: SMTP Amazon SES (by ROBOTSTXT) 2.1.7\n" "Project-Id-Version: SMTP Amazon SES (by ROBOTSTXT) 2.1.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/robotstxt-smtp-amazonses\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/robotstxt-smtp-amazonses\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2026-08-17T20:18:50+00:00\n" "POT-Creation-Date: 2026-08-24T12:46:43+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.12.0\n" "X-Generator: WP-CLI 2.12.0\n"
"X-Domain: robotstxt-smtp-amazonses\n" "X-Domain: robotstxt-smtp-amazonses\n"
@ -339,6 +339,6 @@ msgstr ""
msgid "The Amazon SES Secret Access Key has been cleared." msgid "The Amazon SES Secret Access Key has been cleared."
msgstr "" msgstr ""
#: robotstxt-smtp-amazonses.php:83 #: robotstxt-smtp-amazonses.php:84
msgid "SMTP Amazon SES (by ROBOTSTXT) requires the SMTP (by ROBOTSTXT) plugin to be installed and active." msgid "SMTP Amazon SES (by ROBOTSTXT) requires the SMTP (by ROBOTSTXT) plugin to be installed and active."
msgstr "" msgstr ""

View file

@ -3,9 +3,9 @@ Contributors: robotstxt, javiercasares
Tags: amazon-ses, smtp, email, mail Tags: amazon-ses, smtp, email, mail
Requires at least: 5.7 Requires at least: 5.7
Tested up to: 7.1 Tested up to: 7.1
Stable tag: 2.1.7 Stable tag: 2.1.8
Requires PHP: 8.2 Requires PHP: 8.2
Version: 2.1.7 Version: 2.1.8
License: GPL-3.0-or-later License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html License URI: https://www.gnu.org/licenses/gpl-3.0.html
@ -57,6 +57,27 @@ Updates are delivered through the **Manager (by ROBOTSTXT)** plugin. The main SM
Only the 3 last versions. The full changelog will be at changelog.txt Only the 3 last versions. The full changelog will be at changelog.txt
= 2.1.8 =
_Release date: 2026-08-24_
**Changed**
* Added the `Update URI` header pointing to https://www.robotstxt.software/plugins/robotstxt-smtp-amazonses/ so WordPress never offers conflicting updates from other channels (takes effect on WordPress 5.8+); updates continue to be delivered exclusively through the Manager (by ROBOTSTXT) plugin.
* Updated bundled AWS SDK for PHP to 3.393.4 (now shipping Guzzle 8.1.0).
**Compatibility**
* WordPress: 5.7 - 7.1
* PHP: 8.2 - 8.5
**Tests**
* PHP_CodeSniffer: 3.13.6
* WordPress Coding Standards: 3.4.1
* PHPCompatibility: 9.3.5
* PHPStan: 2.2.9
= 2.1.7 = = 2.1.7 =
_Release date: 2026-08-17_ _Release date: 2026-08-17_
@ -100,31 +121,6 @@ _Release date: 2026-06-09_
* PHPCompatibility: 9.3.5 * PHPCompatibility: 9.3.5
* PHPStan: 2.2.2 * PHPStan: 2.2.2
= 2.1.5 =
_Release date: 2026-06-09_
**Added**
* Runtime check at initialization: if the parent SMTP (by ROBOTSTXT) plugin is missing or inactive, the plugin skips initialization and displays an admin notice instead of producing a fatal error.
**Fixed**
* Credentials never saving on first entry: credential validation now only blocks saving for definitive authentication failures. All other AWS errors allow saving.
* Reply-to email field cannot be cleared: submitting an empty value now explicitly removes the stored address.
**Compatibility**
* WordPress: 5.7 - 7.1
* PHP: 8.2 - 8.5
**Tests**
* PHP_CodeSniffer: 3.13.5
* WordPress Coding Standards: 3.3.0
* PHPCompatibility: 9.3.5
* PHPStan: 2.2.2
= Previous versions = = Previous versions =
If you want to see the full changelog, visit the [changelog](https://www.robotstxt.software/plugins/robotstxt-smtp-amazonses/) page. If you want to see the full changelog, visit the [changelog](https://www.robotstxt.software/plugins/robotstxt-smtp-amazonses/) page.

View file

@ -3,7 +3,8 @@
* Plugin Name: SMTP Amazon SES (by ROBOTSTXT) * Plugin Name: SMTP Amazon SES (by ROBOTSTXT)
* Plugin URI: https://www.robotstxt.software/plugins/robotstxt-smtp-amazonses/ * Plugin URI: https://www.robotstxt.software/plugins/robotstxt-smtp-amazonses/
* Description: Adds Amazon SES configuration support to the ROBOTSTXT SMTP plugin. * Description: Adds Amazon SES configuration support to the ROBOTSTXT SMTP plugin.
* Version: 2.1.7 * Update URI: https://www.robotstxt.software/plugins/robotstxt-smtp-amazonses/
* Version: 2.1.8
* Requires at least: 5.7 * Requires at least: 5.7
* Requires PHP: 8.2 * Requires PHP: 8.2
* Network: true * Network: true
@ -24,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) {
} }
if ( ! defined( 'ROBOTSTXT_SMTP_AMAZONSES_VERSION' ) ) { if ( ! defined( 'ROBOTSTXT_SMTP_AMAZONSES_VERSION' ) ) {
define( 'ROBOTSTXT_SMTP_AMAZONSES_VERSION', '2.1.7' ); define( 'ROBOTSTXT_SMTP_AMAZONSES_VERSION', '2.1.8' );
} }
if ( ! defined( 'ROBOTSTXT_SMTP_AMAZONSES_FILE' ) ) { if ( ! defined( 'ROBOTSTXT_SMTP_AMAZONSES_FILE' ) ) {

View file

@ -1,28 +0,0 @@
{
"name": "SMTP (by ROBOTSTXT) Amazon SES",
"slug": "robotstxt-smtp-amazonses",
"version": "2.1.7",
"download_url": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses/releases/download/2.1.7/robotstxt-smtp-amazonses-2.1.7.zip",
"requires": "5.7",
"requires_php": "8.2",
"tested": "7.1",
"last_updated": "2026-06-09",
"author": "ROBOTSTXT",
"author_profile": "https://www.robotstxt.es/",
"homepage": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses",
"requires_plugins": ["robotstxt-smtp"],
"description": "Adds Amazon SES (Simple Email Service) configuration support to the ROBOTSTXT SMTP plugin. Integrates seamlessly with AWS SDK for PHP to send emails through Amazon SES infrastructure.",
"changelog": "",
"sections": {
"description": "Adds Amazon SES (Simple Email Service) configuration support to the ROBOTSTXT SMTP plugin. Integrates seamlessly with AWS SDK for PHP to send emails through Amazon SES infrastructure.",
"changelog": ""
},
"banners": {
"low": "",
"high": ""
},
"icons": {
"1x": "",
"2x": ""
}
}

View file

@ -204,6 +204,13 @@ class AwsClient implements AwsClientInterface
* signature version to use with a service (e.g., v4). Note that * signature version to use with a service (e.g., v4). Note that
* per/operation signature version MAY override this requested signature * per/operation signature version MAY override this requested signature
* version. * 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 * - use_aws_shared_config_files: (bool, default=bool(true)) Set to false to
* disable checking for shared config file in '~/.aws/config' and * disable checking for shared config file in '~/.aws/config' and
* '~/.aws/credentials'. This will override the AWS_CONFIG_FILE * '~/.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\EndpointV2\EndpointProviderV2;
use Aws\Exception\AwsException; use Aws\Exception\AwsException;
use Aws\Exception\InvalidRegionException; use Aws\Exception\InvalidRegionException;
use Aws\Handler\HttpTransportSharing;
use Aws\Retry\ConfigurationInterface as RetryConfigInterface; use Aws\Retry\ConfigurationInterface as RetryConfigInterface;
use Aws\Retry\ConfigurationProvider as RetryConfigProvider; use Aws\Retry\ConfigurationProvider as RetryConfigProvider;
use Aws\Retry\V3\OptIn as NewRetriesOptIn; use Aws\Retry\V3\OptIn as NewRetriesOptIn;
@ -293,6 +294,12 @@ class ClientResolver
'default' => [], 'default' => [],
'doc' => 'Set to an array of SDK request options to apply to each request (e.g., proxy, verify, etc.).', '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' => [ 'http_handler' => [
'type' => 'value', 'type' => 'value',
'valid' => ['callable'], 'valid' => ['callable'],
@ -988,7 +995,7 @@ class ClientResolver
public static function _default_handler(array &$args) public static function _default_handler(array &$args)
{ {
return new WrappedHttpHandler( return new WrappedHttpHandler(
default_http_handler(), default_http_handler($args['transport_sharing'] ?? null),
$args['parser'], $args['parser'],
$args['error_parser'], $args['error_parser'],
$args['exception_class'], $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) public static function _apply_app_id($value, array &$args)
{ {
// AppId should not be longer than 50 chars // 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 \GuzzleHttp\Promise\Promise createEmailAddressAsync(array $args = [])
* @method \Aws\Result createEvaluationForm(array $args = []) * @method \Aws\Result createEvaluationForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise createEvaluationFormAsync(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 \Aws\Result createHoursOfOperation(array $args = [])
* @method \GuzzleHttp\Promise\Promise createHoursOfOperationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createHoursOfOperationAsync(array $args = [])
* @method \Aws\Result createHoursOfOperationOverride(array $args = []) * @method \Aws\Result createHoursOfOperationOverride(array $args = [])
@ -175,6 +177,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteEmailAddressAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteEmailAddressAsync(array $args = [])
* @method \Aws\Result deleteEvaluationForm(array $args = []) * @method \Aws\Result deleteEvaluationForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteEvaluationFormAsync(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 \Aws\Result deleteHoursOfOperation(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteHoursOfOperationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteHoursOfOperationAsync(array $args = [])
* @method \Aws\Result deleteHoursOfOperationOverride(array $args = []) * @method \Aws\Result deleteHoursOfOperationOverride(array $args = [])
@ -253,6 +257,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeEmailAddressAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeEmailAddressAsync(array $args = [])
* @method \Aws\Result describeEvaluationForm(array $args = []) * @method \Aws\Result describeEvaluationForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeEvaluationFormAsync(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 \Aws\Result describeHoursOfOperation(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeHoursOfOperationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeHoursOfOperationAsync(array $args = [])
* @method \Aws\Result describeHoursOfOperationOverride(array $args = []) * @method \Aws\Result describeHoursOfOperationOverride(array $args = [])
@ -421,6 +427,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listEvaluationFormVersionsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listEvaluationFormVersionsAsync(array $args = [])
* @method \Aws\Result listEvaluationForms(array $args = []) * @method \Aws\Result listEvaluationForms(array $args = [])
* @method \GuzzleHttp\Promise\Promise listEvaluationFormsAsync(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 \Aws\Result listFlowAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFlowAssociationsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listFlowAssociationsAsync(array $args = [])
* @method \Aws\Result listHoursOfOperationOverrides(array $args = []) * @method \Aws\Result listHoursOfOperationOverrides(array $args = [])
@ -687,6 +695,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise updateEmailAddressMetadataAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateEmailAddressMetadataAsync(array $args = [])
* @method \Aws\Result updateEvaluationForm(array $args = []) * @method \Aws\Result updateEvaluationForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateEvaluationFormAsync(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 \Aws\Result updateHoursOfOperation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateHoursOfOperationAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise updateHoursOfOperationAsync(array $args = [])
* @method \Aws\Result updateHoursOfOperationOverride(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. * 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 \Aws\Result associateAccessPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateAccessPolicyAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise associateAccessPolicyAsync(array $args = [])
* @method \Aws\Result associateEncryptionConfig(array $args = []) * @method \Aws\Result associateEncryptionConfig(array $args = [])
@ -19,6 +21,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createAddonAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createAddonAsync(array $args = [])
* @method \Aws\Result createCapability(array $args = []) * @method \Aws\Result createCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise createCapabilityAsync(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 \Aws\Result createCluster(array $args = [])
* @method \GuzzleHttp\Promise\Promise createClusterAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createClusterAsync(array $args = [])
* @method \Aws\Result createEksAnywhereSubscription(array $args = []) * @method \Aws\Result createEksAnywhereSubscription(array $args = [])
@ -35,6 +39,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteAddonAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteAddonAsync(array $args = [])
* @method \Aws\Result deleteCapability(array $args = []) * @method \Aws\Result deleteCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCapabilityAsync(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 \Aws\Result deleteCluster(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteClusterAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise deleteClusterAsync(array $args = [])
* @method \Aws\Result deleteEksAnywhereSubscription(array $args = []) * @method \Aws\Result deleteEksAnywhereSubscription(array $args = [])
@ -57,6 +63,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeAddonVersionsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeAddonVersionsAsync(array $args = [])
* @method \Aws\Result describeCapability(array $args = []) * @method \Aws\Result describeCapability(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeCapabilityAsync(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 \Aws\Result describeCluster(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeClusterAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeClusterAsync(array $args = [])
* @method \Aws\Result describeClusterVersions(array $args = []) * @method \Aws\Result describeClusterVersions(array $args = [])
@ -91,6 +99,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listAssociatedAccessPoliciesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listAssociatedAccessPoliciesAsync(array $args = [])
* @method \Aws\Result listCapabilities(array $args = []) * @method \Aws\Result listCapabilities(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCapabilitiesAsync(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 \Aws\Result listClusters(array $args = [])
* @method \GuzzleHttp\Promise\Promise listClustersAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listClustersAsync(array $args = [])
* @method \Aws\Result listEksAnywhereSubscriptions(array $args = []) * @method \Aws\Result listEksAnywhereSubscriptions(array $args = [])

View file

@ -2,6 +2,7 @@
namespace Aws\Handler\Guzzle; namespace Aws\Handler\Guzzle;
use Aws\Handler\HttpHandlerError; use Aws\Handler\HttpHandlerError;
use Aws\Handler\HttpTransportSharing;
use GuzzleHttp\Utils; use GuzzleHttp\Utils;
use GuzzleHttp\Promise; use GuzzleHttp\Promise;
use GuzzleHttp\Client; use GuzzleHttp\Client;
@ -18,11 +19,23 @@ class GuzzleHandler
private $client; private $client;
/** /**
* @param ClientInterface $client * @param ClientInterface|null $client
* @param string|null $transportSharing
*/ */
public function __construct(?ClientInterface $client = null) public function __construct(
{ ?ClientInterface $client = null,
$this->client = $client ?: new Client(); ?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 \GuzzleHttp\Promise\Promise deleteLayerVersionAsync(array $args = [])
* @method \Aws\Result deleteProvisionedConcurrencyConfig(array $args = []) * @method \Aws\Result deleteProvisionedConcurrencyConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteProvisionedConcurrencyConfigAsync(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 \Aws\Result getAccountSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountSettingsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getAccountSettingsAsync(array $args = [])
* @method \Aws\Result getAlias(array $args = []) * @method \Aws\Result getAlias(array $args = [])
@ -90,6 +92,8 @@ use Aws\Middleware;
* @method \GuzzleHttp\Promise\Promise getPolicyAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getPolicyAsync(array $args = [])
* @method \Aws\Result getProvisionedConcurrencyConfig(array $args = []) * @method \Aws\Result getProvisionedConcurrencyConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise getProvisionedConcurrencyConfigAsync(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 \Aws\Result getRuntimeManagementConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRuntimeManagementConfigAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getRuntimeManagementConfigAsync(array $args = [])
* @method \Aws\Result invoke(array $args = []) * @method \Aws\Result invoke(array $args = [])
@ -144,6 +148,8 @@ use Aws\Middleware;
* @method \GuzzleHttp\Promise\Promise putFunctionScalingConfigAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise putFunctionScalingConfigAsync(array $args = [])
* @method \Aws\Result putProvisionedConcurrencyConfig(array $args = []) * @method \Aws\Result putProvisionedConcurrencyConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise putProvisionedConcurrencyConfigAsync(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 \Aws\Result putRuntimeManagementConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise putRuntimeManagementConfigAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise putRuntimeManagementConfigAsync(array $args = [])
* @method \Aws\Result removeLayerVersionPermission(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 \GuzzleHttp\Promise\Promise cancelChangeSetAsync(array $args = [])
* @method \Aws\Result deleteResourcePolicy(array $args = []) * @method \Aws\Result deleteResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteResourcePolicyAsync(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 \Aws\Result describeChangeSet(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeChangeSetAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeChangeSetAsync(array $args = [])
* @method \Aws\Result describeEntity(array $args = []) * @method \Aws\Result describeEntity(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeEntityAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise describeEntityAsync(array $args = [])
* @method \Aws\Result getResourcePolicy(array $args = []) * @method \Aws\Result getResourcePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getResourcePolicyAsync(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 \Aws\Result listChangeSets(array $args = [])
* @method \GuzzleHttp\Promise\Promise listChangeSetsAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise listChangeSetsAsync(array $args = [])
* @method \Aws\Result listEntities(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 \GuzzleHttp\Promise\Promise createOrderAsync(array $args = [])
* @method \Aws\Result createOutpost(array $args = []) * @method \Aws\Result createOutpost(array $args = [])
* @method \GuzzleHttp\Promise\Promise createOutpostAsync(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 \Aws\Result createQuote(array $args = [])
* @method \GuzzleHttp\Promise\Promise createQuoteAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise createQuoteAsync(array $args = [])
* @method \Aws\Result createRenewal(array $args = []) * @method \Aws\Result createRenewal(array $args = [])
@ -41,6 +43,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getOutpostInstanceTypesAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getOutpostInstanceTypesAsync(array $args = [])
* @method \Aws\Result getOutpostSupportedInstanceTypes(array $args = []) * @method \Aws\Result getOutpostSupportedInstanceTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise getOutpostSupportedInstanceTypesAsync(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 \Aws\Result getQuote(array $args = [])
* @method \GuzzleHttp\Promise\Promise getQuoteAsync(array $args = []) * @method \GuzzleHttp\Promise\Promise getQuoteAsync(array $args = [])
* @method \Aws\Result getRenewalPricing(array $args = []) * @method \Aws\Result getRenewalPricing(array $args = [])

View file

@ -865,7 +865,7 @@ namespace Aws;
*/ */
class Sdk class Sdk
{ {
const VERSION = '3.392.3'; const VERSION = '3.393.4';
/** @var array Arguments for creating clients */ /** @var array Arguments for creating clients */
private $args; private $args;
@ -884,7 +884,10 @@ class Sdk
$this->args = $args; $this->args = $args;
if (!isset($args['handler']) && !isset($args['http_handler'])) { 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

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