diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..900106dd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "master" + ], + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 4c51631d..22d0b856 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -364,107 +364,152 @@
Aqui tenemos todas las respuestas a tus preguntas con respecto al uso de La Pieza.DO. Aquí podrás - encontrar respuestas rápidas para que puedas utilizar la aplicación.
-Lorem Ipsum is simply dummy text of the printing and typesetting industry lorem - Ipsum has. been the - industrys standard dummy text ever since the when an unknown printer took a - galley of type and - scrambled it to make a type specimen book. It has survived not only five cen - turies but also the - leap into electronic typesetting, remaining essentially unchanged.
-Lorem Ipsum is simply dummy text of the printing and typesetting industry lorem - Ipsum has. been the - industrys standard dummy text ever since the when an unknown printer took a - galley of type and - scrambled it to make a type specimen book. It has survived not only five cen - turies but also the - leap into electronic typesetting, remaining essentially unchanged.
-Lorem Ipsum is simply dummy text of the printing and typesetting industry lorem - Ipsum has. been the - industrys standard dummy text ever since the when an unknown printer took a - galley of type and - scrambled it to make a type specimen book. It has survived not only five cen - turies but also the - leap into electronic typesetting, remaining essentially unchanged.
-Lorem Ipsum is simply dummy text of the printing and typesetting industry lorem - Ipsum has. been the - industrys standard dummy text ever since the when an unknown printer took a - galley of type and - scrambled it to make a type specimen book. It has survived not only five cen - turies but also the - leap into electronic typesetting, remaining essentially unchanged.
-Aqui tenemos todas las respuestas a tus preguntas con respecto al uso de La Pieza.DO. Aquí podrás + + encontrar respuestas rápidas para que puedas utilizar la aplicación.
+ +No, el registro es totalmente grátis y puedes registrarte como Cliente, Negocio, Taller o Delivery.
+ +Para vender, regístrate como Negocio, completa los detalles de tu tienda, publíca tus productos y a vender!
+Para comprar, regístrate como Comprador y ve al buscador, escribe el nombre o código de tu pieza y haz clic a comprar.
+ +Piezas de todo tipo, desde piezas de Vehículos hasta Ferretería y muchas más.
+ +La Pieza.DO, es una empresa registrada bajo las leyes de República Dominicana y cuenta con profesionales en el área de E-Commerce, con vasta experiencia y confiabilidad. Todas tus compras están protegidas por la plataforma AZUL, una de las plataformas de pagos en línea más seguras del país.
+ +
- * // First try an INI file at this location.
- * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');
- * // Then try an INI file at this location.
- * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');
- * // Then try loading from environment variables.
- * $c = ConfigurationProvider::env();
- * // Combine the three providers together.
- * $composed = ConfigurationProvider::chain($a, $b, $c);
- * // Returns a promise that is fulfilled with a configuration or throws.
- * $promise = $composed();
- * // Wait on the configuration to resolve.
- * $config = $promise->wait();
- *
- */
-class ConfigurationProvider extends AbstractConfigurationProvider
- implements ConfigurationProviderInterface
-{
- const DEFAULT_CLIENT_ID = '';
- const DEFAULT_ENABLED = false;
- const DEFAULT_HOST = '127.0.0.1';
- const DEFAULT_PORT = 31000;
- const ENV_CLIENT_ID = 'AWS_CSM_CLIENT_ID';
- const ENV_ENABLED = 'AWS_CSM_ENABLED';
- const ENV_HOST = 'AWS_CSM_HOST';
- const ENV_PORT = 'AWS_CSM_PORT';
- const ENV_PROFILE = 'AWS_PROFILE';
-
- public static $cacheKey = 'aws_cached_csm_config';
-
- protected static $interfaceClass = ConfigurationInterface::class;
- protected static $exceptionClass = ConfigurationException::class;
-
- /**
- * Create a default config provider that first checks for environment
- * variables, then checks for a specified profile in the environment-defined
- * config file location (env variable is 'AWS_CONFIG_FILE', file location
- * defaults to ~/.aws/config), then checks for the "default" profile in the
- * environment-defined config file location, and failing those uses a default
- * fallback set of configuration options.
- *
- * This provider is automatically wrapped in a memoize function that caches
- * previously provided config options.
- *
- * @param array $config
- *
- * @return callable
- */
- public static function defaultProvider(array $config = [])
- {
- $configProviders = [self::env()];
- if (
- !isset($config['use_aws_shared_config_files'])
- || $config['use_aws_shared_config_files'] != false
- ) {
- $configProviders[] = self::ini();
- }
- $configProviders[] = self::fallback();
-
- $memo = self::memoize(
- call_user_func_array('self::chain', $configProviders)
- );
-
- if (isset($config['csm']) && $config['csm'] instanceof CacheInterface) {
- return self::cache($memo, $config['csm'], self::$cacheKey);
- }
-
- return $memo;
- }
-
- /**
- * Provider that creates CSM config from environment variables.
- *
- * @return callable
- */
- public static function env()
- {
- return function () {
- // Use credentials from environment variables, if available
- $enabled = getenv(self::ENV_ENABLED);
- if ($enabled !== false) {
- return Promise\promise_for(
- new Configuration(
- $enabled,
- getenv(self::ENV_HOST) ?: self::DEFAULT_HOST,
- getenv(self::ENV_PORT) ?: self::DEFAULT_PORT,
- getenv(self:: ENV_CLIENT_ID) ?: self::DEFAULT_CLIENT_ID
- )
- );
- }
-
- return self::reject('Could not find environment variable CSM config'
- . ' in ' . self::ENV_ENABLED. '/' . self::ENV_HOST . '/'
- . self::ENV_PORT . '/' . self::ENV_CLIENT_ID);
- };
- }
-
- /**
- * Fallback config options when other sources are not set.
- *
- * @return callable
- */
- public static function fallback()
- {
- return function() {
- return Promise\promise_for(
- new Configuration(
- self::DEFAULT_ENABLED,
- self::DEFAULT_HOST,
- self::DEFAULT_PORT,
- self::DEFAULT_CLIENT_ID
- )
- );
- };
- }
-
- /**
- * Config provider that creates config using a config file whose location
- * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to
- * ~/.aws/config if not specified
- *
- * @param string|null $profile Profile to use. If not specified will use
- * the "default" profile.
- * @param string|null $filename If provided, uses a custom filename rather
- * than looking in the default directory.
- *
- * @return callable
- */
- public static function ini($profile = null, $filename = null)
- {
- $filename = $filename ?: (self::getDefaultConfigFilename());
- $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'aws_csm');
-
- return function () use ($profile, $filename) {
- if (!is_readable($filename)) {
- return self::reject("Cannot read CSM config from $filename");
- }
- $data = \Aws\parse_ini_file($filename, true);
- if ($data === false) {
- return self::reject("Invalid config file: $filename");
- }
- if (!isset($data[$profile])) {
- return self::reject("'$profile' not found in config file");
- }
- if (!isset($data[$profile]['csm_enabled'])) {
- return self::reject("Required CSM config values not present in
- INI profile '{$profile}' ({$filename})");
- }
-
- // host is optional
- if (empty($data[$profile]['csm_host'])) {
- $data[$profile]['csm_host'] = self::DEFAULT_HOST;
- }
-
- // port is optional
- if (empty($data[$profile]['csm_port'])) {
- $data[$profile]['csm_port'] = self::DEFAULT_PORT;
- }
-
- // client_id is optional
- if (empty($data[$profile]['csm_client_id'])) {
- $data[$profile]['csm_client_id'] = self::DEFAULT_CLIENT_ID;
- }
-
- return Promise\promise_for(
- new Configuration(
- $data[$profile]['csm_enabled'],
- $data[$profile]['csm_host'],
- $data[$profile]['csm_port'],
- $data[$profile]['csm_client_id']
- )
- );
- };
- }
-
- /**
- * Unwraps a configuration object in whatever valid form it is in,
- * always returning a ConfigurationInterface object.
- *
- * @param mixed $config
- * @return ConfigurationInterface
- * @throws \InvalidArgumentException
- */
- public static function unwrap($config)
- {
- if (is_callable($config)) {
- $config = $config();
- }
- if ($config instanceof PromiseInterface) {
- $config = $config->wait();
- }
- if ($config instanceof ConfigurationInterface) {
- return $config;
- } elseif (is_array($config) && isset($config['enabled'])) {
- $client_id = isset($config['client_id']) ? $config['client_id']
- : self::DEFAULT_CLIENT_ID;
- $host = isset($config['host']) ? $config['host']
- : self::DEFAULT_HOST;
- $port = isset($config['port']) ? $config['port']
- : self::DEFAULT_PORT;
- return new Configuration($config['enabled'], $host, $port, $client_id);
- }
-
- throw new \InvalidArgumentException('Not a valid CSM configuration '
- . 'argument.');
- }
-}
\ No newline at end of file
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/ClientSideMonitoring/Exception/ConfigurationException.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/ClientSideMonitoring/Exception/ConfigurationException.php
deleted file mode 100644
index 827743e2..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/ClientSideMonitoring/Exception/ConfigurationException.php
+++ /dev/null
@@ -1,15 +0,0 @@
-getSignedUrl(
- $options['url'],
- isset($options['expires']) ? $options['expires'] : null,
- isset($options['policy']) ? $options['policy'] : null
- );
- }
-
- /**
- * Create a signed Amazon CloudFront cookie.
- *
- * This method accepts an array of configuration options:
- *
- * - url: (string) URL of the resource being signed (can include query
- * string and wildcards). For example: http://d111111abcdef8.cloudfront.net/images/horizon.jpg?size=large&license=yes
- * - policy: (string) JSON policy. Use this option when creating a signed
- * URL for a custom policy.
- * - expires: (int) UTC Unix timestamp used when signing with a canned
- * policy. Not required when passing a custom 'policy' option.
- * - key_pair_id: (string) The ID of the key pair used to sign CloudFront
- * URLs for private distributions.
- * - private_key: (string) The filepath ot the private key used to sign
- * CloudFront URLs for private distributions.
- *
- * @param array $options Array of configuration options used when signing
- *
- * @return array Key => value pairs of signed cookies to set
- * @throws \InvalidArgumentException if url, key_pair_id, or private_key
- * were not specified.
- * @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html
- */
- public function getSignedCookie(array $options)
- {
- foreach (['key_pair_id', 'private_key'] as $required) {
- if (!isset($options[$required])) {
- throw new \InvalidArgumentException("$required is required");
- }
- }
-
- $cookieSigner = new CookieSigner(
- $options['key_pair_id'],
- $options['private_key']
- );
-
- return $cookieSigner->getSignedCookie(
- isset($options['url']) ? $options['url'] : null,
- isset($options['expires']) ? $options['expires'] : null,
- isset($options['policy']) ? $options['policy'] : null
- );
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/CookieSigner.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/CookieSigner.php
deleted file mode 100644
index 048c0989..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/CookieSigner.php
+++ /dev/null
@@ -1,65 +0,0 @@
- true,
- 'https' => true,
- ];
-
- /**
- * @param $keyPairId string ID of the key pair
- * @param $privateKey string Path to the private key used for signing
- *
- * @throws \RuntimeException if the openssl extension is missing
- * @throws \InvalidArgumentException if the private key cannot be found.
- */
- public function __construct($keyPairId, $privateKey)
- {
- $this->signer = new Signer($keyPairId, $privateKey);
- }
-
- /**
- * Create a signed Amazon CloudFront Cookie.
- *
- * @param string $url URL to sign (can include query string
- * and wildcards). Not required
- * when passing a custom $policy.
- * @param string|integer|null $expires UTC Unix timestamp used when signing
- * with a canned policy. Not required
- * when passing a custom $policy.
- * @param string $policy JSON policy. Use this option when
- * creating a signed cookie for a custom
- * policy.
- *
- * @return array The authenticated cookie parameters
- * @throws \InvalidArgumentException if the URL provided is invalid
- * @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html
- */
- public function getSignedCookie($url = null, $expires = null, $policy = null)
- {
- if ($url) {
- $this->validateUrl($url);
- }
-
- $cookieParameters = [];
- $signature = $this->signer->getSignature($url, $expires, $policy);
- foreach ($signature as $key => $value) {
- $cookieParameters["CloudFront-$key"] = $value;
- }
-
- return $cookieParameters;
- }
-
- private function validateUrl($url)
- {
- $scheme = str_replace('*', '', explode('://', $url)[0]);
- if (empty(self::$schemes[strtolower($scheme)])) {
- throw new \InvalidArgumentException('Invalid or missing URI scheme');
- }
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/Exception/CloudFrontException.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/Exception/CloudFrontException.php
deleted file mode 100644
index 1acdf2c9..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/Exception/CloudFrontException.php
+++ /dev/null
@@ -1,9 +0,0 @@
-keyPairId = $keyPairId;
-
- if (!$this->pkHandle = openssl_pkey_get_private($privateKey, $passphrase)) {
- if (!file_exists($privateKey)) {
- throw new \InvalidArgumentException("PK file not found: $privateKey");
- } else {
- $this->pkHandle = openssl_pkey_get_private("file://$privateKey", $passphrase);
- if (!$this->pkHandle) {
- throw new \InvalidArgumentException(openssl_error_string());
- }
- }
- }
- }
-
- public function __destruct()
- {
- if (PHP_MAJOR_VERSION < 8) {
- $this->pkHandle && openssl_pkey_free($this->pkHandle);
- } else {
- $this->pkHandle;
- }
- }
-
- /**
- * Create the values used to construct signed URLs and cookies.
- *
- * @param string $resource The CloudFront resource to which
- * this signature will grant access.
- * Not used when a custom policy is
- * provided.
- * @param string|integer|null $expires UTC Unix timestamp used when
- * signing with a canned policy.
- * Not required when passing a
- * custom $policy.
- * @param string $policy JSON policy. Use this option when
- * creating a signature for a custom
- * policy.
- *
- * @return array The values needed to construct a signed URL or cookie
- * @throws \InvalidArgumentException when not provided either a policy or a
- * resource and a expires
- *
- * @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html
- */
- public function getSignature($resource = null, $expires = null, $policy = null)
- {
- $signatureHash = [];
- if ($policy) {
- $policy = preg_replace('/\s/s', '', $policy);
- $signatureHash['Policy'] = $this->encode($policy);
- } elseif ($resource && $expires) {
- $expires = (int) $expires; // Handle epoch passed as string
- $policy = $this->createCannedPolicy($resource, $expires);
- $signatureHash['Expires'] = $expires;
- } else {
- throw new \InvalidArgumentException('Either a policy or a resource'
- . ' and an expiration time must be provided.');
- }
-
- $signatureHash['Signature'] = $this->encode($this->sign($policy));
- $signatureHash['Key-Pair-Id'] = $this->keyPairId;
-
- return $signatureHash;
- }
-
- private function createCannedPolicy($resource, $expiration)
- {
- return json_encode([
- 'Statement' => [
- [
- 'Resource' => $resource,
- 'Condition' => [
- 'DateLessThan' => ['AWS:EpochTime' => $expiration],
- ],
- ],
- ],
- ], JSON_UNESCAPED_SLASHES);
- }
-
- private function sign($policy)
- {
- $signature = '';
- openssl_sign($policy, $signature, $this->pkHandle);
-
- return $signature;
- }
-
- private function encode($policy)
- {
- return strtr(base64_encode($policy), '+=/', '-_~');
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/UrlSigner.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/UrlSigner.php
deleted file mode 100644
index 4a89f374..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/CloudFront/UrlSigner.php
+++ /dev/null
@@ -1,119 +0,0 @@
-signer = new Signer($keyPairId, $privateKey);
- }
-
- /**
- * Create a signed Amazon CloudFront URL.
- *
- * Keep in mind that URLs meant for use in media/flash players may have
- * different requirements for URL formats (e.g. some require that the
- * extension be removed, some require the file name to be prefixed
- * - mp4:
- * // First try an INI file at this location.
- * $a = CredentialProvider::ini(null, '/path/to/file.ini');
- * // Then try an INI file at this location.
- * $b = CredentialProvider::ini(null, '/path/to/other-file.ini');
- * // Then try loading from environment variables.
- * $c = CredentialProvider::env();
- * // Combine the three providers together.
- * $composed = CredentialProvider::chain($a, $b, $c);
- * // Returns a promise that is fulfilled with credentials or throws.
- * $promise = $composed();
- * // Wait on the credentials to resolve.
- * $creds = $promise->wait();
- *
- */
-class CredentialProvider
-{
- const ENV_ARN = 'AWS_ROLE_ARN';
- const ENV_KEY = 'AWS_ACCESS_KEY_ID';
- const ENV_PROFILE = 'AWS_PROFILE';
- const ENV_ROLE_SESSION_NAME = 'AWS_ROLE_SESSION_NAME';
- const ENV_SECRET = 'AWS_SECRET_ACCESS_KEY';
- const ENV_SESSION = 'AWS_SESSION_TOKEN';
- const ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE';
- const ENV_SHARED_CREDENTIALS_FILE = 'AWS_SHARED_CREDENTIALS_FILE';
-
- /**
- * Create a default credential provider that
- * first checks for environment variables,
- * then checks for assumed role via web identity,
- * then checks for cached SSO credentials from the CLI,
- * then check for credential_process in the "default" profile in ~/.aws/credentials,
- * then checks for the "default" profile in ~/.aws/credentials,
- * then for credential_process in the "default profile" profile in ~/.aws/config,
- * then checks for "profile default" profile in ~/.aws/config (which is
- * the default profile of AWS CLI),
- * then tries to make a GET Request to fetch credentials if ECS environment variable is presented,
- * finally checks for EC2 instance profile credentials.
- *
- * This provider is automatically wrapped in a memoize function that caches
- * previously provided credentials.
- *
- * @param array $config Optional array of ecs/instance profile credentials
- * provider options.
- *
- * @return callable
- */
- public static function defaultProvider(array $config = [])
- {
- $cacheable = [
- 'web_identity',
- 'sso',
- 'process_credentials',
- 'process_config',
- 'ecs',
- 'instance'
- ];
-
- $defaultChain = [
- 'env' => self::env(),
- 'web_identity' => self::assumeRoleWithWebIdentityCredentialProvider($config),
- ];
- if (
- !isset($config['use_aws_shared_config_files'])
- || $config['use_aws_shared_config_files'] !== false
- ) {
- $defaultChain['sso'] = self::sso(
- 'profile default',
- self::getHomeDir() . '/.aws/config',
- $config
- );
- $defaultChain['process_credentials'] = self::process();
- $defaultChain['ini'] = self::ini();
- $defaultChain['process_config'] = self::process(
- 'profile default',
- self::getHomeDir() . '/.aws/config'
- );
- $defaultChain['ini_config'] = self::ini(
- 'profile default',
- self::getHomeDir() . '/.aws/config'
- );
- }
-
- $shouldUseEcsCredentialsProvider = getenv(EcsCredentialProvider::ENV_URI);
- // getenv() is not thread safe - fall back to $_SERVER
- if ($shouldUseEcsCredentialsProvider === false) {
- $shouldUseEcsCredentialsProvider = isset($_SERVER[EcsCredentialProvider::ENV_URI])
- ? $_SERVER[EcsCredentialProvider::ENV_URI]
- : false;
- }
-
- if (!empty($shouldUseEcsCredentialsProvider)) {
- $defaultChain['ecs'] = self::ecsCredentials($config);
- } else {
- $defaultChain['instance'] = self::instanceProfile($config);
- }
-
- if (isset($config['credentials'])
- && $config['credentials'] instanceof CacheInterface
- ) {
- foreach ($cacheable as $provider) {
- if (isset($defaultChain[$provider])) {
- $defaultChain[$provider] = self::cache(
- $defaultChain[$provider],
- $config['credentials'],
- 'aws_cached_' . $provider . '_credentials'
- );
- }
- }
- }
-
- return self::memoize(
- call_user_func_array(
- 'self::chain',
- array_values($defaultChain)
- )
- );
- }
-
- /**
- * Create a credential provider function from a set of static credentials.
- *
- * @param CredentialsInterface $creds
- *
- * @return callable
- */
- public static function fromCredentials(CredentialsInterface $creds)
- {
- $promise = Promise\promise_for($creds);
-
- return function () use ($promise) {
- return $promise;
- };
- }
-
- /**
- * Creates an aggregate credentials provider that invokes the provided
- * variadic providers one after the other until a provider returns
- * credentials.
- *
- * @return callable
- */
- public static function chain()
- {
- $links = func_get_args();
- if (empty($links)) {
- throw new \InvalidArgumentException('No providers in chain');
- }
-
- return function () use ($links) {
- /** @var callable $parent */
- $parent = array_shift($links);
- $promise = $parent();
- while ($next = array_shift($links)) {
- $promise = $promise->otherwise($next);
- }
- return $promise;
- };
- }
-
- /**
- * Wraps a credential provider and caches previously provided credentials.
- *
- * Ensures that cached credentials are refreshed when they expire.
- *
- * @param callable $provider Credentials provider function to wrap.
- *
- * @return callable
- */
- public static function memoize(callable $provider)
- {
- return function () use ($provider) {
- static $result;
- static $isConstant;
-
- // Constant credentials will be returned constantly.
- if ($isConstant) {
- return $result;
- }
-
- // Create the initial promise that will be used as the cached value
- // until it expires.
- if (null === $result) {
- $result = $provider();
- }
-
- // Return credentials that could expire and refresh when needed.
- return $result
- ->then(function (CredentialsInterface $creds) use ($provider, &$isConstant, &$result) {
- // Determine if these are constant credentials.
- if (!$creds->getExpiration()) {
- $isConstant = true;
- return $creds;
- }
-
- // Refresh expired credentials.
- if (!$creds->isExpired()) {
- return $creds;
- }
- // Refresh the result and forward the promise.
- return $result = $provider();
- })
- ->otherwise(function($reason) use (&$result) {
- // Cleanup rejected promise.
- $result = null;
- return new Promise\RejectedPromise($reason);
- });
- };
- }
-
- /**
- * Wraps a credential provider and saves provided credentials in an
- * instance of Aws\CacheInterface. Forwards calls when no credentials found
- * in cache and updates cache with the results.
- *
- * @param callable $provider Credentials provider function to wrap
- * @param CacheInterface $cache Cache to store credentials
- * @param string|null $cacheKey (optional) Cache key to use
- *
- * @return callable
- */
- public static function cache(
- callable $provider,
- CacheInterface $cache,
- $cacheKey = null
- ) {
- $cacheKey = $cacheKey ?: 'aws_cached_credentials';
-
- return function () use ($provider, $cache, $cacheKey) {
- $found = $cache->get($cacheKey);
- if ($found instanceof CredentialsInterface && !$found->isExpired()) {
- return Promise\promise_for($found);
- }
-
- return $provider()
- ->then(function (CredentialsInterface $creds) use (
- $cache,
- $cacheKey
- ) {
- $cache->set(
- $cacheKey,
- $creds,
- null === $creds->getExpiration() ?
- 0 : $creds->getExpiration() - time()
- );
-
- return $creds;
- });
- };
- }
-
- /**
- * Provider that creates credentials from environment variables
- * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN.
- *
- * @return callable
- */
- public static function env()
- {
- return function () {
- // Use credentials from environment variables, if available
- $key = getenv(self::ENV_KEY);
- $secret = getenv(self::ENV_SECRET);
- if ($key && $secret) {
- return Promise\promise_for(
- new Credentials($key, $secret, getenv(self::ENV_SESSION) ?: NULL)
- );
- }
-
- return self::reject('Could not find environment variable '
- . 'credentials in ' . self::ENV_KEY . '/' . self::ENV_SECRET);
- };
- }
-
- /**
- * Credential provider that creates credentials using instance profile
- * credentials.
- *
- * @param array $config Array of configuration data.
- *
- * @return InstanceProfileProvider
- * @see Aws\Credentials\InstanceProfileProvider for $config details.
- */
- public static function instanceProfile(array $config = [])
- {
- return new InstanceProfileProvider($config);
- }
-
- /**
- * Credential provider that retrieves cached SSO credentials from the CLI
- *
- * @return callable
- */
- public static function sso($ssoProfileName, $filename = null, $config = [])
- {
- $filename = $filename ?: (self::getHomeDir() . '/.aws/config');
-
- return function () use ($ssoProfileName, $filename, $config) {
- if (!is_readable($filename)) {
- return self::reject("Cannot read credentials from $filename");
- }
- $data = self::loadProfiles($filename);
- if (empty($data[$ssoProfileName])) {
- return self::reject("Profile {$ssoProfileName} does not exist in {$filename}.");
- }
- $ssoProfile = $data[$ssoProfileName];
- if (empty($ssoProfile['sso_start_url'])
- || empty($ssoProfile['sso_region'])
- || empty($ssoProfile['sso_account_id'])
- || empty($ssoProfile['sso_role_name'])
- ) {
- return self::reject(
- "Profile {$ssoProfileName} in {$filename} must contain the following keys: "
- . "sso_start_url, sso_region, sso_account_id, and sso_role_name."
- );
- }
-
- $tokenLocation = self::getHomeDir()
- . '/.aws/sso/cache/'
- . utf8_encode(sha1($ssoProfile['sso_start_url']))
- . ".json";
-
- if (!is_readable($tokenLocation)) {
- return self::reject("Unable to read token file at $tokenLocation");
- }
-
- $tokenData = json_decode(file_get_contents($tokenLocation), true);
- if (empty($tokenData['accessToken']) || empty($tokenData['expiresAt'])) {
- return self::reject(
- "Token file at {$tokenLocation} must contain an access token and an expiration"
- );
- }
- try {
- $expiration = (new DateTimeResult($tokenData['expiresAt']))->getTimestamp();
- } catch (\Exception $e) {
- return self::reject("Cached SSO credentials returned an invalid expiration");
- }
- $now = time();
- if ($expiration < $now) {
- return self::reject("Cached SSO credentials returned expired credentials");
- }
-
- $ssoClient = null;
- if (empty($config['ssoClient'])) {
- $ssoClient = new Aws\SSO\SSOClient([
- 'region' => $ssoProfile['sso_region'],
- 'version' => '2019-06-10',
- 'credentials' => false
- ]);
- } else {
- $ssoClient = $config['ssoClient'];
- }
- $ssoResponse = $ssoClient->getRoleCredentials([
- 'accessToken' => $tokenData['accessToken'],
- 'accountId' => $ssoProfile['sso_account_id'],
- 'roleName' => $ssoProfile['sso_role_name']
- ]);
-
- $ssoCredentials = $ssoResponse['roleCredentials'];
- return Promise\promise_for(
- new Credentials(
- $ssoCredentials['accessKeyId'],
- $ssoCredentials['secretAccessKey'],
- $ssoCredentials['sessionToken'],
- $expiration
- )
- );
- };
- }
-
- /**
- * Credential provider that creates credentials using
- * ecs credentials by a GET request, whose uri is specified
- * by environment variable
- *
- * @param array $config Array of configuration data.
- *
- * @return EcsCredentialProvider
- * @see Aws\Credentials\EcsCredentialProvider for $config details.
- */
- public static function ecsCredentials(array $config = [])
- {
- return new EcsCredentialProvider($config);
- }
-
- /**
- * Credential provider that creates credentials using assume role
- *
- * @param array $config Array of configuration data
- * @return callable
- * @see Aws\Credentials\AssumeRoleCredentialProvider for $config details.
- */
- public static function assumeRole(array $config=[])
- {
- return new AssumeRoleCredentialProvider($config);
- }
-
- /**
- * Credential provider that creates credentials by assuming role from a
- * Web Identity Token
- *
- * @param array $config Array of configuration data
- * @return callable
- * @see Aws\Credentials\AssumeRoleWithWebIdentityCredentialProvider for
- * $config details.
- */
- public static function assumeRoleWithWebIdentityCredentialProvider(array $config = [])
- {
- return function () use ($config) {
- $arnFromEnv = getenv(self::ENV_ARN);
- $tokenFromEnv = getenv(self::ENV_TOKEN_FILE);
- $stsClient = isset($config['stsClient'])
- ? $config['stsClient']
- : null;
- $region = isset($config['region'])
- ? $config['region']
- : null;
-
- if ($tokenFromEnv && $arnFromEnv) {
- $sessionName = getenv(self::ENV_ROLE_SESSION_NAME)
- ? getenv(self::ENV_ROLE_SESSION_NAME)
- : null;
- $provider = new AssumeRoleWithWebIdentityCredentialProvider([
- 'RoleArn' => $arnFromEnv,
- 'WebIdentityTokenFile' => $tokenFromEnv,
- 'SessionName' => $sessionName,
- 'client' => $stsClient,
- 'region' => $region
- ]);
-
- return $provider();
- }
-
- $profileName = getenv(self::ENV_PROFILE) ?: 'default';
- if (isset($config['filename'])) {
- $profiles = self::loadProfiles($config['filename']);
- } else {
- $profiles = self::loadDefaultProfiles();
- }
-
- if (isset($profiles[$profileName])) {
- $profile = $profiles[$profileName];
- if (isset($profile['region'])) {
- $region = $profile['region'];
- }
- if (isset($profile['web_identity_token_file'])
- && isset($profile['role_arn'])
- ) {
- $sessionName = isset($profile['role_session_name'])
- ? $profile['role_session_name']
- : null;
- $provider = new AssumeRoleWithWebIdentityCredentialProvider([
- 'RoleArn' => $profile['role_arn'],
- 'WebIdentityTokenFile' => $profile['web_identity_token_file'],
- 'SessionName' => $sessionName,
- 'client' => $stsClient,
- 'region' => $region
- ]);
-
- return $provider();
- }
- } else {
- return self::reject("Unknown profile: $profileName");
- }
- return self::reject("No RoleArn or WebIdentityTokenFile specified");
- };
- }
-
- /**
- * Credentials provider that creates credentials using an ini file stored
- * in the current user's home directory. A source can be provided
- * in this file for assuming a role using the credential_source config option.
- *
- * @param string|null $profile Profile to use. If not specified will use
- * the "default" profile in "~/.aws/credentials".
- * @param string|null $filename If provided, uses a custom filename rather
- * than looking in the home directory.
- * @param array|null $config If provided, may contain the following:
- * preferStaticCredentials: If true, prefer static
- * credentials to role_arn if both are present
- * disableAssumeRole: If true, disable support for
- * roles that assume an IAM role. If true and role profile
- * is selected, an error is raised.
- * stsClient: StsClient used to assume role specified in profile
- *
- * @return callable
- */
- public static function ini($profile = null, $filename = null, array $config = [])
- {
- $filename = self::getFileName($filename);
- $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');
-
- return function () use ($profile, $filename, $config) {
- $preferStaticCredentials = isset($config['preferStaticCredentials'])
- ? $config['preferStaticCredentials']
- : false;
- $disableAssumeRole = isset($config['disableAssumeRole'])
- ? $config['disableAssumeRole']
- : false;
- $stsClient = isset($config['stsClient']) ? $config['stsClient'] : null;
-
- if (!is_readable($filename)) {
- return self::reject("Cannot read credentials from $filename");
- }
- $data = self::loadProfiles($filename);
- if ($data === false) {
- return self::reject("Invalid credentials file: $filename");
- }
- if (!isset($data[$profile])) {
- return self::reject("'$profile' not found in credentials file");
- }
-
- /*
- In the CLI, the presence of both a role_arn and static credentials have
- different meanings depending on how many profiles have been visited. For
- the first profile processed, role_arn takes precedence over any static
- credentials, but for all subsequent profiles, static credentials are
- used if present, and only in their absence will the profile's
- source_profile and role_arn keys be used to load another set of
- credentials. This bool is intended to yield compatible behaviour in this
- sdk.
- */
- $preferStaticCredentialsToRoleArn = ($preferStaticCredentials
- && isset($data[$profile]['aws_access_key_id'])
- && isset($data[$profile]['aws_secret_access_key']));
-
- if (isset($data[$profile]['role_arn'])
- && !$preferStaticCredentialsToRoleArn
- ) {
- if ($disableAssumeRole) {
- return self::reject(
- "Role assumption profiles are disabled. "
- . "Failed to load profile " . $profile);
- }
- return self::loadRoleProfile(
- $data,
- $profile,
- $filename,
- $stsClient,
- $config
- );
- }
-
- if (!isset($data[$profile]['aws_access_key_id'])
- || !isset($data[$profile]['aws_secret_access_key'])
- ) {
- return self::reject("No credentials present in INI profile "
- . "'$profile' ($filename)");
- }
-
- if (empty($data[$profile]['aws_session_token'])) {
- $data[$profile]['aws_session_token']
- = isset($data[$profile]['aws_security_token'])
- ? $data[$profile]['aws_security_token']
- : null;
- }
-
- return Promise\promise_for(
- new Credentials(
- $data[$profile]['aws_access_key_id'],
- $data[$profile]['aws_secret_access_key'],
- $data[$profile]['aws_session_token']
- )
- );
- };
- }
-
- /**
- * Credentials provider that creates credentials using a process configured in
- * ini file stored in the current user's home directory.
- *
- * @param string|null $profile Profile to use. If not specified will use
- * the "default" profile in "~/.aws/credentials".
- * @param string|null $filename If provided, uses a custom filename rather
- * than looking in the home directory.
- *
- * @return callable
- */
- public static function process($profile = null, $filename = null)
- {
- $filename = self::getFileName($filename);
- $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');
-
- return function () use ($profile, $filename) {
- if (!is_readable($filename)) {
- return self::reject("Cannot read process credentials from $filename");
- }
- $data = \Aws\parse_ini_file($filename, true, INI_SCANNER_RAW);
- if ($data === false) {
- return self::reject("Invalid credentials file: $filename");
- }
- if (!isset($data[$profile])) {
- return self::reject("'$profile' not found in credentials file");
- }
- if (!isset($data[$profile]['credential_process'])) {
- return self::reject("No credential_process present in INI profile "
- . "'$profile' ($filename)");
- }
-
- $credentialProcess = $data[$profile]['credential_process'];
- $json = shell_exec($credentialProcess);
-
- $processData = json_decode($json, true);
-
- // Only support version 1
- if (isset($processData['Version'])) {
- if ($processData['Version'] !== 1) {
- return self::reject("credential_process does not return Version == 1");
- }
- }
-
- if (!isset($processData['AccessKeyId'])
- || !isset($processData['SecretAccessKey']))
- {
- return self::reject("credential_process does not return valid credentials");
- }
-
- if (isset($processData['Expiration'])) {
- try {
- $expiration = new DateTimeResult($processData['Expiration']);
- } catch (\Exception $e) {
- return self::reject("credential_process returned invalid expiration");
- }
- $now = new DateTimeResult();
- if ($expiration < $now) {
- return self::reject("credential_process returned expired credentials");
- }
- $expires = $expiration->getTimestamp();
- } else {
- $expires = null;
- }
-
- if (empty($processData['SessionToken'])) {
- $processData['SessionToken'] = null;
- }
-
- return Promise\promise_for(
- new Credentials(
- $processData['AccessKeyId'],
- $processData['SecretAccessKey'],
- $processData['SessionToken'],
- $expires
- )
- );
- };
- }
-
- /**
- * Assumes role for profile that includes role_arn
- *
- * @return callable
- */
- private static function loadRoleProfile(
- $profiles,
- $profileName,
- $filename,
- $stsClient,
- $config = []
- ) {
- $roleProfile = $profiles[$profileName];
- $roleArn = isset($roleProfile['role_arn']) ? $roleProfile['role_arn'] : '';
- $roleSessionName = isset($roleProfile['role_session_name'])
- ? $roleProfile['role_session_name']
- : 'aws-sdk-php-' . round(microtime(true) * 1000);
-
- if (
- empty($roleProfile['source_profile'])
- == empty($roleProfile['credential_source'])
- ) {
- return self::reject("Either source_profile or credential_source must be set " .
- "using profile " . $profileName . ", but not both."
- );
- }
-
- $sourceProfileName = "";
- if (!empty($roleProfile['source_profile'])) {
- $sourceProfileName = $roleProfile['source_profile'];
- if (!isset($profiles[$sourceProfileName])) {
- return self::reject("source_profile " . $sourceProfileName
- . " using profile " . $profileName . " does not exist"
- );
- }
- if (isset($config['visited_profiles']) &&
- in_array($roleProfile['source_profile'], $config['visited_profiles'])
- ) {
- return self::reject("Circular source_profile reference found.");
- }
- $config['visited_profiles'] [] = $roleProfile['source_profile'];
- } else {
- if (empty($roleArn)) {
- return self::reject(
- "A role_arn must be provided with credential_source in " .
- "file {$filename} under profile {$profileName} "
- );
- }
- }
-
- if (empty($stsClient)) {
- $sourceRegion = isset($profiles[$sourceProfileName]['region'])
- ? $profiles[$sourceProfileName]['region']
- : 'us-east-1';
- $config['preferStaticCredentials'] = true;
- $sourceCredentials = null;
- if (!empty($roleProfile['source_profile'])){
- $sourceCredentials = call_user_func(
- CredentialProvider::ini($sourceProfileName, $filename, $config)
- )->wait();
- } else {
- $sourceCredentials = self::getCredentialsFromSource(
- $profileName,
- $filename
- );
- }
- $stsClient = new StsClient([
- 'credentials' => $sourceCredentials,
- 'region' => $sourceRegion,
- 'version' => '2011-06-15',
- ]);
- }
-
- $result = $stsClient->assumeRole([
- 'RoleArn' => $roleArn,
- 'RoleSessionName' => $roleSessionName
- ]);
-
- $credentials = $stsClient->createCredentials($result);
- return Promise\promise_for($credentials);
- }
-
- /**
- * Gets the environment's HOME directory if available.
- *
- * @return null|string
- */
- private static function getHomeDir()
- {
- // On Linux/Unix-like systems, use the HOME environment variable
- if ($homeDir = getenv('HOME')) {
- return $homeDir;
- }
-
- // Get the HOMEDRIVE and HOMEPATH values for Windows hosts
- $homeDrive = getenv('HOMEDRIVE');
- $homePath = getenv('HOMEPATH');
-
- return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;
- }
-
- /**
- * Gets profiles from specified $filename, or default ini files.
- */
- private static function loadProfiles($filename)
- {
- $profileData = \Aws\parse_ini_file($filename, true, INI_SCANNER_RAW);
-
- // If loading .aws/credentials, also load .aws/config when AWS_SDK_LOAD_NONDEFAULT_CONFIG is set
- if ($filename === self::getHomeDir() . '/.aws/credentials'
- && getenv('AWS_SDK_LOAD_NONDEFAULT_CONFIG')
- ) {
- $configFilename = self::getHomeDir() . '/.aws/config';
- $configProfileData = \Aws\parse_ini_file($configFilename, true, INI_SCANNER_RAW);
- foreach ($configProfileData as $name => $profile) {
- // standardize config profile names
- $name = str_replace('profile ', '', $name);
- if (!isset($profileData[$name])) {
- $profileData[$name] = $profile;
- }
- }
- }
-
- return $profileData;
- }
-
- /**
- * Gets profiles from ~/.aws/credentials and ~/.aws/config ini files
- */
- private static function loadDefaultProfiles() {
- $profiles = [];
- $credFile = self::getHomeDir() . '/.aws/credentials';
- $configFile = self::getHomeDir() . '/.aws/config';
- if (file_exists($credFile)) {
- $profiles = \Aws\parse_ini_file($credFile, true, INI_SCANNER_RAW);
- }
-
- if (file_exists($configFile)) {
- $configProfileData = \Aws\parse_ini_file($configFile, true, INI_SCANNER_RAW);
- foreach ($configProfileData as $name => $profile) {
- // standardize config profile names
- $name = str_replace('profile ', '', $name);
- if (!isset($profiles[$name])) {
- $profiles[$name] = $profile;
- }
- }
- }
-
- return $profiles;
- }
-
- public static function getCredentialsFromSource(
- $profileName = '',
- $filename = '',
- $config = []
- ) {
- $data = self::loadProfiles($filename);
- $credentialSource = !empty($data[$profileName]['credential_source'])
- ? $data[$profileName]['credential_source']
- : null;
- $credentialsPromise = null;
-
- switch ($credentialSource) {
- case 'Environment':
- $credentialsPromise = self::env();
- break;
- case 'Ec2InstanceMetadata':
- $credentialsPromise = self::instanceProfile($config);
- break;
- case 'EcsContainer':
- $credentialsPromise = self::ecsCredentials($config);
- break;
- default:
- throw new CredentialsException(
- "Invalid credential_source found in config file: {$credentialSource}. Valid inputs "
- . "include Environment, Ec2InstanceMetadata, and EcsContainer."
- );
- }
-
- $credentialsResult = null;
- try {
- $credentialsResult = $credentialsPromise()->wait();
- } catch (\Exception $reason) {
- return self::reject(
- "Unable to successfully retrieve credentials from the source specified in the"
- . " credentials file: {$credentialSource}; failure message was: "
- . $reason->getMessage()
- );
- }
- return function () use ($credentialsResult) {
- return Promise\promise_for($credentialsResult);
- };
- }
-
- private static function reject($msg)
- {
- return new Promise\RejectedPromise(new CredentialsException($msg));
- }
-
- /**
- * @param $filename
- * @return string
- */
- private static function getFileName($filename)
- {
- if (!isset($filename)) {
- $filename = getenv(self::ENV_SHARED_CREDENTIALS_FILE) ?:
- (self::getHomeDir() . '/.aws/credentials');
- }
- return $filename;
- }
-}
-
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/Credentials.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/Credentials.php
deleted file mode 100644
index bd2bdc90..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/Credentials.php
+++ /dev/null
@@ -1,91 +0,0 @@
-key = trim($key);
- $this->secret = trim($secret);
- $this->token = $token;
- $this->expires = $expires;
- }
-
- public static function __set_state(array $state)
- {
- return new self(
- $state['key'],
- $state['secret'],
- $state['token'],
- $state['expires']
- );
- }
-
- public function getAccessKeyId()
- {
- return $this->key;
- }
-
- public function getSecretKey()
- {
- return $this->secret;
- }
-
- public function getSecurityToken()
- {
- return $this->token;
- }
-
- public function getExpiration()
- {
- return $this->expires;
- }
-
- public function isExpired()
- {
- return $this->expires !== null && time() >= $this->expires;
- }
-
- public function toArray()
- {
- return [
- 'key' => $this->key,
- 'secret' => $this->secret,
- 'token' => $this->token,
- 'expires' => $this->expires
- ];
- }
-
- public function serialize()
- {
- return json_encode($this->toArray());
- }
-
- public function unserialize($serialized)
- {
- $data = json_decode($serialized, true);
-
- $this->key = $data['key'];
- $this->secret = $data['secret'];
- $this->token = $data['token'];
- $this->expires = $data['expires'];
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/CredentialsInterface.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/CredentialsInterface.php
deleted file mode 100644
index 86fac9d3..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/CredentialsInterface.php
+++ /dev/null
@@ -1,52 +0,0 @@
-timeout = (float) $timeout;
- $this->client = isset($config['client'])
- ? $config['client']
- : \Aws\default_http_handler();
- }
-
- /**
- * Load ECS credentials
- *
- * @return PromiseInterface
- */
- public function __invoke()
- {
- $client = $this->client;
- $request = new Request('GET', self::getEcsUri());
- return $client(
- $request,
- [
- 'timeout' => $this->timeout,
- 'proxy' => '',
- ]
- )->then(function (ResponseInterface $response) {
- $result = $this->decodeResult((string) $response->getBody());
- return new Credentials(
- $result['AccessKeyId'],
- $result['SecretAccessKey'],
- $result['Token'],
- strtotime($result['Expiration'])
- );
- })->otherwise(function ($reason) {
- $reason = is_array($reason) ? $reason['exception'] : $reason;
- $msg = $reason->getMessage();
- throw new CredentialsException(
- "Error retrieving credential from ECS ($msg)"
- );
- });
- }
-
- /**
- * Fetch credential URI from ECS environment variable
- *
- * @return string Returns ECS URI
- */
- private function getEcsUri()
- {
- $credsUri = getenv(self::ENV_URI);
-
- if ($credsUri === false) {
- $credsUri = isset($_SERVER[self::ENV_URI]) ? $_SERVER[self::ENV_URI] : '';
- }
-
- return self::SERVER_URI . $credsUri;
- }
-
- private function decodeResult($response)
- {
- $result = json_decode($response, true);
-
- if (!isset($result['AccessKeyId'])) {
- throw new CredentialsException('Unexpected ECS credential value');
- }
- return $result;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/InstanceProfileProvider.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/InstanceProfileProvider.php
deleted file mode 100644
index 647d2f7a..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Credentials/InstanceProfileProvider.php
+++ /dev/null
@@ -1,277 +0,0 @@
-timeout = (float) getenv(self::ENV_TIMEOUT) ?: (isset($config['timeout']) ? $config['timeout'] : 1.0);
- $this->profile = isset($config['profile']) ? $config['profile'] : null;
- $this->retries = (int) getenv(self::ENV_RETRIES) ?: (isset($config['retries']) ? $config['retries'] : 3);
- $this->attempts = 0;
- $this->client = isset($config['client'])
- ? $config['client'] // internal use only
- : \Aws\default_http_handler();
- }
-
- /**
- * Loads instance profile credentials.
- *
- * @return PromiseInterface
- */
- public function __invoke()
- {
- return Promise\coroutine(function () {
-
- // Retrieve token or switch out of secure mode
- $token = null;
- while ($this->secureMode && is_null($token)) {
- try {
- $token = (yield $this->request(
- self::TOKEN_PATH,
- 'PUT',
- [
- 'x-aws-ec2-metadata-token-ttl-seconds' => 21600
- ]
- ));
- } catch (TransferException $e) {
- if (!method_exists($e, 'getResponse')
- || empty($e->getResponse())
- || !in_array(
- $e->getResponse()->getStatusCode(),
- [400, 500, 502, 503, 504]
- )
- ) {
- $this->secureMode = false;
- } else {
- $this->handleRetryableException(
- $e,
- [],
- $this->createErrorMessage(
- 'Error retrieving metadata token'
- )
- );
- }
- }
- $this->attempts++;
- }
-
- // Set token header only for secure mode
- $headers = [];
- if ($this->secureMode) {
- $headers = [
- 'x-aws-ec2-metadata-token' => $token
- ];
- }
-
- // Retrieve profile
- while (!$this->profile) {
- try {
- $this->profile = (yield $this->request(
- self::CRED_PATH,
- 'GET',
- $headers
- ));
- } catch (TransferException $e) {
- // 401 indicates insecure flow not supported, switch to
- // attempting secure mode for subsequent calls
- if (!empty($this->getExceptionStatusCode($e))
- && $this->getExceptionStatusCode($e) === 401
- ) {
- $this->secureMode = true;
- }
- $this->handleRetryableException(
- $e,
- [ 'blacklist' => [401, 403] ],
- $this->createErrorMessage($e->getMessage())
- );
- }
-
- $this->attempts++;
- }
-
- // Retrieve credentials
- $result = null;
- while ($result == null) {
- try {
- $json = (yield $this->request(
- self::CRED_PATH . $this->profile,
- 'GET',
- $headers
- ));
- $result = $this->decodeResult($json);
- } catch (InvalidJsonException $e) {
- $this->handleRetryableException(
- $e,
- [ 'blacklist' => [401, 403] ],
- $this->createErrorMessage(
- 'Invalid JSON response, retries exhausted'
- )
- );
- } catch (TransferException $e) {
- // 401 indicates insecure flow not supported, switch to
- // attempting secure mode for subsequent calls
- if (!empty($this->getExceptionStatusCode($e))
- && $this->getExceptionStatusCode($e) === 401
- ) {
- $this->secureMode = true;
- }
- $this->handleRetryableException(
- $e,
- [ 'blacklist' => [401, 403] ],
- $this->createErrorMessage($e->getMessage())
- );
- }
- $this->attempts++;
- }
- yield new Credentials(
- $result['AccessKeyId'],
- $result['SecretAccessKey'],
- $result['Token'],
- strtotime($result['Expiration'])
- );
- });
- }
-
- /**
- * @param string $url
- * @param string $method
- * @param array $headers
- * @return PromiseInterface Returns a promise that is fulfilled with the
- * body of the response as a string.
- */
- private function request($url, $method = 'GET', $headers = [])
- {
- $disabled = getenv(self::ENV_DISABLE) ?: false;
- if (strcasecmp($disabled, 'true') === 0) {
- throw new CredentialsException(
- $this->createErrorMessage('EC2 metadata service access disabled')
- );
- }
-
- $fn = $this->client;
- $request = new Request($method, self::SERVER_URI . $url);
- $userAgent = 'aws-sdk-php/' . Sdk::VERSION;
- if (defined('HHVM_VERSION')) {
- $userAgent .= ' HHVM/' . HHVM_VERSION;
- }
- $userAgent .= ' ' . \Aws\default_user_agent();
- $request = $request->withHeader('User-Agent', $userAgent);
- foreach ($headers as $key => $value) {
- $request = $request->withHeader($key, $value);
- }
-
- return $fn($request, ['timeout' => $this->timeout])
- ->then(function (ResponseInterface $response) {
- return (string) $response->getBody();
- })->otherwise(function (array $reason) {
- $reason = $reason['exception'];
- if ($reason instanceof TransferException) {
- throw $reason;
- }
- $msg = $reason->getMessage();
- throw new CredentialsException(
- $this->createErrorMessage($msg)
- );
- });
- }
-
- private function handleRetryableException(
- \Exception $e,
- $retryOptions,
- $message
- ) {
- $isRetryable = true;
- if (!empty($status = $this->getExceptionStatusCode($e))
- && isset($retryOptions['blacklist'])
- && in_array($status, $retryOptions['blacklist'])
- ) {
- $isRetryable = false;
- }
- if ($isRetryable && $this->attempts < $this->retries) {
- sleep(pow(1.2, $this->attempts));
- } else {
- throw new CredentialsException($message);
- }
- }
-
- private function getExceptionStatusCode(\Exception $e)
- {
- if (method_exists($e, 'getResponse')
- && !empty($e->getResponse())
- ) {
- return $e->getResponse()->getStatusCode();
- }
- return null;
- }
-
- private function createErrorMessage($previous)
- {
- return "Error retrieving credentials from the instance profile "
- . "metadata service. ({$previous})";
- }
-
- private function decodeResult($response)
- {
- $result = json_decode($response, true);
-
- if (json_last_error() > 0) {
- throw new InvalidJsonException();
- }
-
- if ($result['Code'] !== 'Success') {
- throw new CredentialsException('Unexpected instance profile '
- . 'response code: ' . $result['Code']);
- }
-
- return $result;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AbstractCryptoClient.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AbstractCryptoClient.php
deleted file mode 100644
index 823467b7..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AbstractCryptoClient.php
+++ /dev/null
@@ -1,121 +0,0 @@
-stream = $cipherText;
- $this->key = $key;
- $this->cipherMethod = clone $cipherMethod;
- }
-
- public function getOpenSslName()
- {
- return $this->cipherMethod->getOpenSslName();
- }
-
- public function getAesName()
- {
- return $this->cipherMethod->getAesName();
- }
-
- public function getCurrentIv()
- {
- return $this->cipherMethod->getCurrentIv();
- }
-
- public function getSize()
- {
- $plainTextSize = $this->stream->getSize();
-
- if ($this->cipherMethod->requiresPadding()) {
- // PKCS7 padding requires that between 1 and self::BLOCK_SIZE be
- // added to the plaintext to make it an even number of blocks. The
- // plaintext is between strlen($cipherText) - self::BLOCK_SIZE and
- // strlen($cipherText) - 1
- return null;
- }
-
- return $plainTextSize;
- }
-
- public function isWritable()
- {
- return false;
- }
-
- public function read($length)
- {
- if ($length > strlen($this->buffer)) {
- $this->buffer .= $this->decryptBlock(
- self::BLOCK_SIZE * ceil(($length - strlen($this->buffer)) / self::BLOCK_SIZE)
- );
- }
-
- $data = substr($this->buffer, 0, $length);
- $this->buffer = substr($this->buffer, $length);
-
- return $data ? $data : '';
- }
-
- public function seek($offset, $whence = SEEK_SET)
- {
- if ($offset === 0 && $whence === SEEK_SET) {
- $this->buffer = '';
- $this->cipherMethod->seek(0, SEEK_SET);
- $this->stream->seek(0, SEEK_SET);
- } else {
- throw new LogicException('AES encryption streams only support being'
- . ' rewound, not arbitrary seeking.');
- }
- }
-
- private function decryptBlock($length)
- {
- if ($this->stream->eof()) {
- return '';
- }
-
- $cipherText = '';
- do {
- $cipherText .= $this->stream->read($length - strlen($cipherText));
- } while (strlen($cipherText) < $length && !$this->stream->eof());
-
- $options = OPENSSL_RAW_DATA;
- if (!$this->stream->eof()
- && $this->stream->getSize() !== $this->stream->tell()
- ) {
- $options |= OPENSSL_ZERO_PADDING;
- }
-
- $plaintext = openssl_decrypt(
- $cipherText,
- $this->cipherMethod->getOpenSslName(),
- $this->key,
- $options,
- $this->cipherMethod->getCurrentIv()
- );
-
- $this->cipherMethod->update($cipherText);
-
- return $plaintext;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesEncryptingStream.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesEncryptingStream.php
deleted file mode 100644
index 390a74cd..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesEncryptingStream.php
+++ /dev/null
@@ -1,150 +0,0 @@
-stream = $plainText;
- $this->key = $key;
- $this->cipherMethod = clone $cipherMethod;
- }
-
- public function getOpenSslName()
- {
- return $this->cipherMethod->getOpenSslName();
- }
-
- public function getAesName()
- {
- return $this->cipherMethod->getAesName();
- }
-
- public function getCurrentIv()
- {
- return $this->cipherMethod->getCurrentIv();
- }
-
- public function getSize()
- {
- $plainTextSize = $this->stream->getSize();
-
- if ($this->cipherMethod->requiresPadding() && $plainTextSize !== null) {
- // PKCS7 padding requires that between 1 and self::BLOCK_SIZE be
- // added to the plaintext to make it an even number of blocks.
- $padding = self::BLOCK_SIZE - $plainTextSize % self::BLOCK_SIZE;
- return $plainTextSize + $padding;
- }
-
- return $plainTextSize;
- }
-
- public function isWritable()
- {
- return false;
- }
-
- public function read($length)
- {
- if ($length > strlen($this->buffer)) {
- $this->buffer .= $this->encryptBlock(
- self::BLOCK_SIZE * ceil(($length - strlen($this->buffer)) / self::BLOCK_SIZE)
- );
- }
-
- $data = substr($this->buffer, 0, $length);
- $this->buffer = substr($this->buffer, $length);
-
- return $data ? $data : '';
- }
-
- public function seek($offset, $whence = SEEK_SET)
- {
- if ($whence === SEEK_CUR) {
- $offset = $this->tell() + $offset;
- $whence = SEEK_SET;
- }
-
- if ($whence === SEEK_SET) {
- $this->buffer = '';
- $wholeBlockOffset
- = (int) ($offset / self::BLOCK_SIZE) * self::BLOCK_SIZE;
- $this->stream->seek($wholeBlockOffset);
- $this->cipherMethod->seek($wholeBlockOffset);
- $this->read($offset - $wholeBlockOffset);
- } else {
- throw new LogicException('Unrecognized whence.');
- }
- }
-
- private function encryptBlock($length)
- {
- if ($this->stream->eof()) {
- return '';
- }
-
- $plainText = '';
- do {
- $plainText .= $this->stream->read($length - strlen($plainText));
- } while (strlen($plainText) < $length && !$this->stream->eof());
-
- $options = OPENSSL_RAW_DATA;
- if (!$this->stream->eof()
- || $this->stream->getSize() !== $this->stream->tell()
- ) {
- $options |= OPENSSL_ZERO_PADDING;
- }
-
- $cipherText = openssl_encrypt(
- $plainText,
- $this->cipherMethod->getOpenSslName(),
- $this->key,
- $options,
- $this->cipherMethod->getCurrentIv()
- );
-
- $this->cipherMethod->update($cipherText);
-
- return $cipherText;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesGcmDecryptingStream.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesGcmDecryptingStream.php
deleted file mode 100644
index acfc2cac..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesGcmDecryptingStream.php
+++ /dev/null
@@ -1,107 +0,0 @@
-cipherText = $cipherText;
- $this->key = $key;
- $this->initializationVector = $initializationVector;
- $this->tag = $tag;
- $this->aad = $aad;
- $this->tagLength = $tagLength;
- $this->keySize = $keySize;
- }
-
- public function getOpenSslName()
- {
- return "aes-{$this->keySize}-gcm";
- }
-
- public function getAesName()
- {
- return 'AES/GCM/NoPadding';
- }
-
- public function getCurrentIv()
- {
- return $this->initializationVector;
- }
-
- public function createStream()
- {
- if (version_compare(PHP_VERSION, '7.1', '<')) {
- return Psr7\stream_for(AesGcm::decrypt(
- (string) $this->cipherText,
- $this->initializationVector,
- new Key($this->key),
- $this->aad,
- $this->tag,
- $this->keySize
- ));
- } else {
- $result = \openssl_decrypt(
- (string)$this->cipherText,
- $this->getOpenSslName(),
- $this->key,
- OPENSSL_RAW_DATA,
- $this->initializationVector,
- $this->tag,
- $this->aad
- );
- if ($result === false) {
- throw new CryptoException('The requested object could not be'
- . ' decrypted due to an invalid authentication tag.');
- }
- return Psr7\stream_for($result);
- }
- }
-
- public function isWritable()
- {
- return false;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesGcmEncryptingStream.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesGcmEncryptingStream.php
deleted file mode 100644
index eb0ef955..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesGcmEncryptingStream.php
+++ /dev/null
@@ -1,125 +0,0 @@
-plaintext = $plaintext;
- $this->key = $key;
- $this->initializationVector = $initializationVector;
- $this->aad = $aad;
- $this->tagLength = $tagLength;
- $this->keySize = $keySize;
- }
-
- public function getOpenSslName()
- {
- return "aes-{$this->keySize}-gcm";
- }
-
- /**
- * Same as static method and retained for backwards compatibility
- *
- * @return string
- */
- public function getAesName()
- {
- return self::getStaticAesName();
- }
-
- public function getCurrentIv()
- {
- return $this->initializationVector;
- }
-
- public function createStream()
- {
- if (version_compare(PHP_VERSION, '7.1', '<')) {
- return Psr7\stream_for(AesGcm::encrypt(
- (string) $this->plaintext,
- $this->initializationVector,
- new Key($this->key),
- $this->aad,
- $this->tag,
- $this->keySize
- ));
- } else {
- return Psr7\stream_for(\openssl_encrypt(
- (string)$this->plaintext,
- $this->getOpenSslName(),
- $this->key,
- OPENSSL_RAW_DATA,
- $this->initializationVector,
- $this->tag,
- $this->aad,
- $this->tagLength
- ));
- }
- }
-
- /**
- * @return string
- */
- public function getTag()
- {
- return $this->tag;
- }
-
- public function isWritable()
- {
- return false;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesStreamInterface.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesStreamInterface.php
deleted file mode 100644
index ce7b85d7..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/AesStreamInterface.php
+++ /dev/null
@@ -1,30 +0,0 @@
-baseIv = $this->iv = $iv;
- $this->keySize = $keySize;
-
- if (strlen($iv) !== openssl_cipher_iv_length($this->getOpenSslName())) {
- throw new InvalidArgumentException('Invalid initialization vector');
- }
- }
-
- public function getOpenSslName()
- {
- return "aes-{$this->keySize}-cbc";
- }
-
- public function getAesName()
- {
- return 'AES/CBC/PKCS5Padding';
- }
-
- public function getCurrentIv()
- {
- return $this->iv;
- }
-
- public function requiresPadding()
- {
- return true;
- }
-
- public function seek($offset, $whence = SEEK_SET)
- {
- if ($offset === 0 && $whence === SEEK_SET) {
- $this->iv = $this->baseIv;
- } else {
- throw new LogicException('CBC initialization only support being'
- . ' rewound, not arbitrary seeking.');
- }
- }
-
- public function update($cipherTextBlock)
- {
- $this->iv = substr($cipherTextBlock, self::BLOCK_SIZE * -1);
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Cipher/CipherBuilderTrait.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Cipher/CipherBuilderTrait.php
deleted file mode 100644
index ed9feb9a..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Cipher/CipherBuilderTrait.php
+++ /dev/null
@@ -1,72 +0,0 @@
-decryptCek(
- base64_decode(
- $envelope[MetadataEnvelope::CONTENT_KEY_V2_HEADER]
- ),
- json_decode(
- $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER],
- true
- )
- );
- $cipherOptions['KeySize'] = strlen($cek) * 8;
- $cipherOptions['Cipher'] = $this->getCipherFromAesName(
- $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER]
- );
-
- $decryptionStream = $this->getDecryptingStream(
- $cipherText,
- $cek,
- $cipherOptions
- );
- unset($cek);
-
- return $decryptionStream;
- }
-
- private function getTagFromCiphertextStream(
- StreamInterface $cipherText,
- $tagLength
- ) {
- $cipherTextSize = $cipherText->getSize();
- if ($cipherTextSize == null || $cipherTextSize <= 0) {
- throw new \RuntimeException('Cannot decrypt a stream of unknown'
- . ' size.');
- }
- return (string) new LimitStream(
- $cipherText,
- $tagLength,
- $cipherTextSize - $tagLength
- );
- }
-
- private function getStrippedCiphertextStream(
- StreamInterface $cipherText,
- $tagLength
- ) {
- $cipherTextSize = $cipherText->getSize();
- if ($cipherTextSize == null || $cipherTextSize <= 0) {
- throw new \RuntimeException('Cannot decrypt a stream of unknown'
- . ' size.');
- }
- return new LimitStream(
- $cipherText,
- $cipherTextSize - $tagLength,
- 0
- );
- }
-
- /**
- * Generates a stream that wraps the cipher text with the proper cipher and
- * uses the content encryption key (CEK) to decrypt the data when read.
- *
- * @param string $cipherText Plain-text data to be encrypted using the
- * materials, algorithm, and data provided.
- * @param string $cek A content encryption key for use by the stream for
- * encrypting the plaintext data.
- * @param array $cipherOptions Options for use in determining the cipher to
- * be used for encrypting data.
- *
- * @return AesStreamInterface
- *
- * @internal
- */
- protected function getDecryptingStream(
- $cipherText,
- $cek,
- $cipherOptions
- ) {
- $cipherTextStream = Psr7\stream_for($cipherText);
- switch ($cipherOptions['Cipher']) {
- case 'gcm':
- $cipherOptions['Tag'] = $this->getTagFromCiphertextStream(
- $cipherTextStream,
- $cipherOptions['TagLength']
- );
-
- return new AesGcmDecryptingStream(
- $this->getStrippedCiphertextStream(
- $cipherTextStream,
- $cipherOptions['TagLength']
- ),
- $cek,
- $cipherOptions['Iv'],
- $cipherOptions['Tag'],
- $cipherOptions['Aad'] = isset($cipherOptions['Aad'])
- ? $cipherOptions['Aad']
- : null,
- $cipherOptions['TagLength'] ?: null,
- $cipherOptions['KeySize']
- );
- default:
- $cipherMethod = $this->buildCipherMethod(
- $cipherOptions['Cipher'],
- $cipherOptions['Iv'],
- $cipherOptions['KeySize']
- );
- return new AesDecryptingStream(
- $cipherTextStream,
- $cek,
- $cipherMethod
- );
- }
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/DecryptionTraitV2.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/DecryptionTraitV2.php
deleted file mode 100644
index 9c4c432d..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/DecryptionTraitV2.php
+++ /dev/null
@@ -1,249 +0,0 @@
-decryptCek(
- base64_decode(
- $envelope[MetadataEnvelope::CONTENT_KEY_V2_HEADER]
- ),
- json_decode(
- $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER],
- true
- ),
- $options
- );
- $options['@CipherOptions']['KeySize'] = strlen($cek) * 8;
- $options['@CipherOptions']['Cipher'] = $this->getCipherFromAesName(
- $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER]
- );
-
- $this->validateOptionsAndEnvelope($options, $envelope);
-
- $decryptionStream = $this->getDecryptingStream(
- $cipherText,
- $cek,
- $options['@CipherOptions']
- );
- unset($cek);
-
- return $decryptionStream;
- }
-
- private function getTagFromCiphertextStream(
- StreamInterface $cipherText,
- $tagLength
- ) {
- $cipherTextSize = $cipherText->getSize();
- if ($cipherTextSize == null || $cipherTextSize <= 0) {
- throw new \RuntimeException('Cannot decrypt a stream of unknown'
- . ' size.');
- }
- return (string) new LimitStream(
- $cipherText,
- $tagLength,
- $cipherTextSize - $tagLength
- );
- }
-
- private function getStrippedCiphertextStream(
- StreamInterface $cipherText,
- $tagLength
- ) {
- $cipherTextSize = $cipherText->getSize();
- if ($cipherTextSize == null || $cipherTextSize <= 0) {
- throw new \RuntimeException('Cannot decrypt a stream of unknown'
- . ' size.');
- }
- return new LimitStream(
- $cipherText,
- $cipherTextSize - $tagLength,
- 0
- );
- }
-
- private function validateOptionsAndEnvelope($options, $envelope)
- {
- $allowedCiphers = AbstractCryptoClientV2::$supportedCiphers;
- $allowedKeywraps = AbstractCryptoClientV2::$supportedKeyWraps;
- if ($options['@SecurityProfile'] == 'V2_AND_LEGACY') {
- $allowedCiphers = array_unique(array_merge(
- $allowedCiphers,
- AbstractCryptoClient::$supportedCiphers
- ));
- $allowedKeywraps = array_unique(array_merge(
- $allowedKeywraps,
- AbstractCryptoClient::$supportedKeyWraps
- ));
- }
-
- $v1SchemaException = new CryptoException("The requested object is encrypted"
- . " with V1 encryption schemas that have been disabled by"
- . " client configuration @SecurityProfile=V2. Retry with"
- . " V2_AND_LEGACY enabled or reencrypt the object.");
-
- if (!in_array($options['@CipherOptions']['Cipher'], $allowedCiphers)) {
- if (in_array($options['@CipherOptions']['Cipher'], AbstractCryptoClient::$supportedCiphers)) {
- throw $v1SchemaException;
- }
- throw new CryptoException("The requested object is encrypted with"
- . " the cipher '{$options['@CipherOptions']['Cipher']}', which is not"
- . " supported for decryption with the selected security profile."
- . " This profile allows decryption with: "
- . implode(", ", $allowedCiphers));
- }
- if (!in_array(
- $envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER],
- $allowedKeywraps
- )) {
- if (in_array(
- $envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER],
- AbstractCryptoClient::$supportedKeyWraps)
- ) {
- throw $v1SchemaException;
- }
- throw new CryptoException("The requested object is encrypted with"
- . " the keywrap schema '{$envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER]}',"
- . " which is not supported for decryption with the current security"
- . " profile.");
- }
-
- $matdesc = json_decode(
- $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER],
- true
- );
- if (isset($matdesc['aws:x-amz-cek-alg'])
- && $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER] !==
- $matdesc['aws:x-amz-cek-alg']
- ) {
- throw new CryptoException("There is a mismatch in specified content"
- . " encryption algrithm between the materials description value"
- . " and the metadata envelope value: {$matdesc['aws:x-amz-cek-alg']}"
- . " vs. {$envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER]}.");
- }
- }
-
- /**
- * Generates a stream that wraps the cipher text with the proper cipher and
- * uses the content encryption key (CEK) to decrypt the data when read.
- *
- * @param string $cipherText Plain-text data to be encrypted using the
- * materials, algorithm, and data provided.
- * @param string $cek A content encryption key for use by the stream for
- * encrypting the plaintext data.
- * @param array $cipherOptions Options for use in determining the cipher to
- * be used for encrypting data.
- *
- * @return AesStreamInterface
- *
- * @internal
- */
- protected function getDecryptingStream(
- $cipherText,
- $cek,
- $cipherOptions
- ) {
- $cipherTextStream = Psr7\stream_for($cipherText);
- switch ($cipherOptions['Cipher']) {
- case 'gcm':
- $cipherOptions['Tag'] = $this->getTagFromCiphertextStream(
- $cipherTextStream,
- $cipherOptions['TagLength']
- );
-
- return new AesGcmDecryptingStream(
- $this->getStrippedCiphertextStream(
- $cipherTextStream,
- $cipherOptions['TagLength']
- ),
- $cek,
- $cipherOptions['Iv'],
- $cipherOptions['Tag'],
- $cipherOptions['Aad'] = isset($cipherOptions['Aad'])
- ? $cipherOptions['Aad']
- : null,
- $cipherOptions['TagLength'] ?: null,
- $cipherOptions['KeySize']
- );
- default:
- $cipherMethod = $this->buildCipherMethod(
- $cipherOptions['Cipher'],
- $cipherOptions['Iv'],
- $cipherOptions['KeySize']
- );
- return new AesDecryptingStream(
- $cipherTextStream,
- $cek,
- $cipherMethod
- );
- }
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/EncryptionTrait.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/EncryptionTrait.php
deleted file mode 100644
index 60e99c79..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/EncryptionTrait.php
+++ /dev/null
@@ -1,192 +0,0 @@
- true,
- 'KeySize' => true,
- 'Aad' => true,
- ];
-
- /**
- * Dependency to generate a CipherMethod from a set of inputs for loading
- * in to an AesEncryptingStream.
- *
- * @param string $cipherName Name of the cipher to generate for encrypting.
- * @param string $iv Base Initialization Vector for the cipher.
- * @param int $keySize Size of the encryption key, in bits, that will be
- * used.
- *
- * @return Cipher\CipherMethod
- *
- * @internal
- */
- abstract protected function buildCipherMethod($cipherName, $iv, $keySize);
-
- /**
- * Builds an AesStreamInterface and populates encryption metadata into the
- * supplied envelope.
- *
- * @param Stream $plaintext Plain-text data to be encrypted using the
- * materials, algorithm, and data provided.
- * @param array $cipherOptions Options for use in determining the cipher to
- * be used for encrypting data.
- * @param MaterialsProvider $provider A provider to supply and encrypt
- * materials used in encryption.
- * @param MetadataEnvelope $envelope A storage envelope for encryption
- * metadata to be added to.
- *
- * @return AesStreamInterface
- *
- * @throws \InvalidArgumentException Thrown when a value in $cipherOptions
- * is not valid.
- *
- * @internal
- */
- public function encrypt(
- Stream $plaintext,
- array $cipherOptions,
- MaterialsProvider $provider,
- MetadataEnvelope $envelope
- ) {
- $materialsDescription = $provider->getMaterialsDescription();
-
- $cipherOptions = array_intersect_key(
- $cipherOptions,
- self::$allowedOptions
- );
-
- if (empty($cipherOptions['Cipher'])) {
- throw new \InvalidArgumentException('An encryption cipher must be'
- . ' specified in the "cipher_options".');
- }
-
- if (!self::isSupportedCipher($cipherOptions['Cipher'])) {
- throw new \InvalidArgumentException('The cipher requested is not'
- . ' supported by the SDK.');
- }
-
- if (empty($cipherOptions['KeySize'])) {
- $cipherOptions['KeySize'] = 256;
- }
- if (!is_int($cipherOptions['KeySize'])) {
- throw new \InvalidArgumentException('The cipher "KeySize" must be'
- . ' an integer.');
- }
-
- if (!MaterialsProvider::isSupportedKeySize(
- $cipherOptions['KeySize']
- )) {
- throw new \InvalidArgumentException('The cipher "KeySize" requested'
- . ' is not supported by AES (128, 192, or 256).');
- }
-
- $cipherOptions['Iv'] = $provider->generateIv(
- $this->getCipherOpenSslName(
- $cipherOptions['Cipher'],
- $cipherOptions['KeySize']
- )
- );
-
- $cek = $provider->generateCek($cipherOptions['KeySize']);
-
- list($encryptingStream, $aesName) = $this->getEncryptingStream(
- $plaintext,
- $cek,
- $cipherOptions
- );
-
- // Populate envelope data
- $envelope[MetadataEnvelope::CONTENT_KEY_V2_HEADER] =
- $provider->encryptCek(
- $cek,
- $materialsDescription
- );
- unset($cek);
-
- $envelope[MetadataEnvelope::IV_HEADER] =
- base64_encode($cipherOptions['Iv']);
- $envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER] =
- $provider->getWrapAlgorithmName();
- $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER] = $aesName;
- $envelope[MetadataEnvelope::UNENCRYPTED_CONTENT_LENGTH_HEADER] =
- strlen($plaintext);
- $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER] =
- json_encode($materialsDescription);
- if (!empty($cipherOptions['Tag'])) {
- $envelope[MetadataEnvelope::CRYPTO_TAG_LENGTH_HEADER] =
- strlen($cipherOptions['Tag']) * 8;
- }
-
- return $encryptingStream;
- }
-
- /**
- * Generates a stream that wraps the plaintext with the proper cipher and
- * uses the content encryption key (CEK) to encrypt the data when read.
- *
- * @param Stream $plaintext Plain-text data to be encrypted using the
- * materials, algorithm, and data provided.
- * @param string $cek A content encryption key for use by the stream for
- * encrypting the plaintext data.
- * @param array $cipherOptions Options for use in determining the cipher to
- * be used for encrypting data.
- *
- * @return [AesStreamInterface, string]
- *
- * @internal
- */
- protected function getEncryptingStream(
- Stream $plaintext,
- $cek,
- &$cipherOptions
- ) {
- switch ($cipherOptions['Cipher']) {
- case 'gcm':
- $cipherOptions['TagLength'] = 16;
-
- $cipherTextStream = new AesGcmEncryptingStream(
- $plaintext,
- $cek,
- $cipherOptions['Iv'],
- $cipherOptions['Aad'] = isset($cipherOptions['Aad'])
- ? $cipherOptions['Aad']
- : null,
- $cipherOptions['TagLength'],
- $cipherOptions['KeySize']
- );
-
- if (!empty($cipherOptions['Aad'])) {
- trigger_error("'Aad' has been supplied for content encryption"
- . " with " . $cipherTextStream->getAesName() . ". The"
- . " PHP SDK encryption client can decrypt an object"
- . " encrypted in this way, but other AWS SDKs may not be"
- . " able to.", E_USER_WARNING);
- }
-
- $appendStream = new AppendStream([
- $cipherTextStream->createStream()
- ]);
- $cipherOptions['Tag'] = $cipherTextStream->getTag();
- $appendStream->addStream(Psr7\stream_for($cipherOptions['Tag']));
- return [$appendStream, $cipherTextStream->getAesName()];
- default:
- $cipherMethod = $this->buildCipherMethod(
- $cipherOptions['Cipher'],
- $cipherOptions['Iv'],
- $cipherOptions['KeySize']
- );
- $cipherTextStream = new AesEncryptingStream(
- $plaintext,
- $cek,
- $cipherMethod
- );
- return [$cipherTextStream, $cipherTextStream->getAesName()];
- }
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/EncryptionTraitV2.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/EncryptionTraitV2.php
deleted file mode 100644
index 8812fc28..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/EncryptionTraitV2.php
+++ /dev/null
@@ -1,196 +0,0 @@
- true,
- 'KeySize' => true,
- 'Aad' => true,
- ];
-
- private static $encryptClasses = [
- 'gcm' => AesGcmEncryptingStream::class
- ];
-
- /**
- * Dependency to generate a CipherMethod from a set of inputs for loading
- * in to an AesEncryptingStream.
- *
- * @param string $cipherName Name of the cipher to generate for encrypting.
- * @param string $iv Base Initialization Vector for the cipher.
- * @param int $keySize Size of the encryption key, in bits, that will be
- * used.
- *
- * @return Cipher\CipherMethod
- *
- * @internal
- */
- abstract protected function buildCipherMethod($cipherName, $iv, $keySize);
-
- /**
- * Builds an AesStreamInterface and populates encryption metadata into the
- * supplied envelope.
- *
- * @param Stream $plaintext Plain-text data to be encrypted using the
- * materials, algorithm, and data provided.
- * @param array $options Options for use in encryption, including cipher
- * options, and encryption context.
- * @param MaterialsProviderV2 $provider A provider to supply and encrypt
- * materials used in encryption.
- * @param MetadataEnvelope $envelope A storage envelope for encryption
- * metadata to be added to.
- *
- * @return StreamInterface
- *
- * @throws \InvalidArgumentException Thrown when a value in $options['@CipherOptions']
- * is not valid.
- *s
- * @internal
- */
- public function encrypt(
- Stream $plaintext,
- array $options,
- MaterialsProviderV2 $provider,
- MetadataEnvelope $envelope
- ) {
- $options = array_change_key_case($options);
- $cipherOptions = array_intersect_key(
- $options['@cipheroptions'],
- self::$allowedOptions
- );
-
- if (empty($cipherOptions['Cipher'])) {
- throw new \InvalidArgumentException('An encryption cipher must be'
- . ' specified in @CipherOptions["Cipher"].');
- }
-
- $cipherOptions['Cipher'] = strtolower($cipherOptions['Cipher']);
-
- if (!self::isSupportedCipher($cipherOptions['Cipher'])) {
- throw new \InvalidArgumentException('The cipher requested is not'
- . ' supported by the SDK.');
- }
-
- if (empty($cipherOptions['KeySize'])) {
- $cipherOptions['KeySize'] = 256;
- }
- if (!is_int($cipherOptions['KeySize'])) {
- throw new \InvalidArgumentException('The cipher "KeySize" must be'
- . ' an integer.');
- }
-
- if (!MaterialsProviderV2::isSupportedKeySize(
- $cipherOptions['KeySize']
- )) {
- throw new \InvalidArgumentException('The cipher "KeySize" requested'
- . ' is not supported by AES (128 or 256).');
- }
-
- $cipherOptions['Iv'] = $provider->generateIv(
- $this->getCipherOpenSslName(
- $cipherOptions['Cipher'],
- $cipherOptions['KeySize']
- )
- );
-
- $encryptClass = self::$encryptClasses[$cipherOptions['Cipher']];
- $aesName = $encryptClass::getStaticAesName();
- $materialsDescription = ['aws:x-amz-cek-alg' => $aesName];
-
- $keys = $provider->generateCek(
- $cipherOptions['KeySize'],
- $materialsDescription,
- $options
- );
-
- // Some providers modify materials description based on options
- if (isset($keys['UpdatedContext'])) {
- $materialsDescription = $keys['UpdatedContext'];
- }
-
- $encryptingStream = $this->getEncryptingStream(
- $plaintext,
- $keys['Plaintext'],
- $cipherOptions
- );
-
- // Populate envelope data
- $envelope[MetadataEnvelope::CONTENT_KEY_V2_HEADER] = $keys['Ciphertext'];
- unset($keys);
-
- $envelope[MetadataEnvelope::IV_HEADER] =
- base64_encode($cipherOptions['Iv']);
- $envelope[MetadataEnvelope::KEY_WRAP_ALGORITHM_HEADER] =
- $provider->getWrapAlgorithmName();
- $envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER] = $aesName;
- $envelope[MetadataEnvelope::UNENCRYPTED_CONTENT_LENGTH_HEADER] =
- strlen($plaintext);
- $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER] =
- json_encode($materialsDescription);
- if (!empty($cipherOptions['Tag'])) {
- $envelope[MetadataEnvelope::CRYPTO_TAG_LENGTH_HEADER] =
- strlen($cipherOptions['Tag']) * 8;
- }
-
- return $encryptingStream;
- }
-
- /**
- * Generates a stream that wraps the plaintext with the proper cipher and
- * uses the content encryption key (CEK) to encrypt the data when read.
- *
- * @param Stream $plaintext Plain-text data to be encrypted using the
- * materials, algorithm, and data provided.
- * @param string $cek A content encryption key for use by the stream for
- * encrypting the plaintext data.
- * @param array $cipherOptions Options for use in determining the cipher to
- * be used for encrypting data.
- *
- * @return [AesStreamInterface, string]
- *
- * @internal
- */
- protected function getEncryptingStream(
- Stream $plaintext,
- $cek,
- &$cipherOptions
- ) {
- switch ($cipherOptions['Cipher']) {
- // Only 'gcm' is supported for encryption currently
- case 'gcm':
- $cipherOptions['TagLength'] = 16;
- $encryptClass = self::$encryptClasses['gcm'];
- $cipherTextStream = new $encryptClass(
- $plaintext,
- $cek,
- $cipherOptions['Iv'],
- $cipherOptions['Aad'] = isset($cipherOptions['Aad'])
- ? $cipherOptions['Aad']
- : '',
- $cipherOptions['TagLength'],
- $cipherOptions['KeySize']
- );
-
- if (!empty($cipherOptions['Aad'])) {
- trigger_error("'Aad' has been supplied for content encryption"
- . " with " . $cipherTextStream->getAesName() . ". The"
- . " PHP SDK encryption client can decrypt an object"
- . " encrypted in this way, but other AWS SDKs may not be"
- . " able to.", E_USER_WARNING);
- }
-
- $appendStream = new AppendStream([
- $cipherTextStream->createStream()
- ]);
- $cipherOptions['Tag'] = $cipherTextStream->getTag();
- $appendStream->addStream(Psr7\stream_for($cipherOptions['Tag']));
- return $appendStream;
- }
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/KmsMaterialsProvider.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/KmsMaterialsProvider.php
deleted file mode 100644
index fc75138b..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/KmsMaterialsProvider.php
+++ /dev/null
@@ -1,121 +0,0 @@
-kmsClient = $kmsClient;
- $this->kmsKeyId = $kmsKeyId;
- }
-
- public function fromDecryptionEnvelope(MetadataEnvelope $envelope)
- {
- if (empty($envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER])) {
- throw new \RuntimeException('Not able to detect the materials description.');
- }
-
- $materialsDescription = json_decode(
- $envelope[MetadataEnvelope::MATERIALS_DESCRIPTION_HEADER],
- true
- );
-
- if (empty($materialsDescription['kms_cmk_id'])
- && empty($materialsDescription['aws:x-amz-cek-alg'])) {
- throw new \RuntimeException('Not able to detect kms_cmk_id (legacy'
- . ' implementation) or aws:x-amz-cek-alg (current implementation)'
- . ' from kms materials description.');
- }
-
- return new self(
- $this->kmsClient,
- isset($materialsDescription['kms_cmk_id'])
- ? $materialsDescription['kms_cmk_id']
- : null
- );
- }
-
- /**
- * The KMS key id for use in matching this Provider to its keys,
- * consistently with other SDKs as 'kms_cmk_id'.
- *
- * @return array
- */
- public function getMaterialsDescription()
- {
- return ['kms_cmk_id' => $this->kmsKeyId];
- }
-
- public function getWrapAlgorithmName()
- {
- return self::WRAP_ALGORITHM_NAME;
- }
-
- /**
- * Takes a content encryption key (CEK) and description to return an encrypted
- * key by using KMS' Encrypt API.
- *
- * @param string $unencryptedCek Key for use in encrypting other data
- * that itself needs to be encrypted by the
- * Provider.
- * @param string $materialDescription Material Description for use in
- * encrypting the $cek.
- *
- * @return string
- */
- public function encryptCek($unencryptedCek, $materialDescription)
- {
- $encryptedDataKey = $this->kmsClient->encrypt([
- 'Plaintext' => $unencryptedCek,
- 'KeyId' => $this->kmsKeyId,
- 'EncryptionContext' => $materialDescription
- ]);
- return base64_encode($encryptedDataKey['CiphertextBlob']);
- }
-
- /**
- * Takes an encrypted content encryption key (CEK) and material description
- * for use decrypting the key by using KMS' Decrypt API.
- *
- * @param string $encryptedCek Encrypted key to be decrypted by the Provider
- * for use decrypting other data.
- * @param string $materialDescription Material Description for use in
- * encrypting the $cek.
- *
- * @return string
- */
- public function decryptCek($encryptedCek, $materialDescription)
- {
- $result = $this->kmsClient->decrypt([
- 'CiphertextBlob' => $encryptedCek,
- 'EncryptionContext' => $materialDescription
- ]);
-
- return $result['Plaintext'];
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/KmsMaterialsProviderV2.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/KmsMaterialsProviderV2.php
deleted file mode 100644
index e7da8b92..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/KmsMaterialsProviderV2.php
+++ /dev/null
@@ -1,100 +0,0 @@
-kmsClient = $kmsClient;
- $this->kmsKeyId = $kmsKeyId;
- }
-
- /**
- * @inheritDoc
- */
- public function getWrapAlgorithmName()
- {
- return self::WRAP_ALGORITHM_NAME;
- }
-
- /**
- * @inheritDoc
- */
- public function decryptCek($encryptedCek, $materialDescription, $options)
- {
- $params = [
- 'CiphertextBlob' => $encryptedCek,
- 'EncryptionContext' => $materialDescription
- ];
- if (empty($options['@KmsAllowDecryptWithAnyCmk'])) {
- if (empty($this->kmsKeyId)) {
- throw new CryptoException('KMS CMK ID was not specified and the'
- . ' operation is not opted-in to attempting to use any valid'
- . ' CMK it discovers. Please specify a CMK ID, or explicitly'
- . ' enable attempts to use any valid KMS CMK with the'
- . ' @KmsAllowDecryptWithAnyCmk option.');
- }
- $params['KeyId'] = $this->kmsKeyId;
- }
-
- $result = $this->kmsClient->decrypt($params);
- return $result['Plaintext'];
- }
-
- /**
- * @inheritDoc
- */
- public function generateCek($keySize, $context, $options)
- {
- if (empty($this->kmsKeyId)) {
- throw new CryptoException('A KMS key id is required for encryption'
- . ' with KMS keywrap. Use a KmsMaterialsProviderV2 that has been'
- . ' instantiated with a KMS key id.');
- }
- $options = array_change_key_case($options);
- if (!isset($options['@kmsencryptioncontext'])
- || !is_array($options['@kmsencryptioncontext'])
- ) {
- throw new CryptoException("'@KmsEncryptionContext' is a"
- . " required argument when using KmsMaterialsProviderV2, and"
- . " must be an associative array (or empty array).");
- }
- if (isset($options['@kmsencryptioncontext']['aws:x-amz-cek-alg'])) {
- throw new CryptoException("Conflict in reserved @KmsEncryptionContext"
- . " key aws:x-amz-cek-alg. This value is reserved for the S3"
- . " Encryption Client and cannot be set by the user.");
- }
- $context = array_merge($options['@kmsencryptioncontext'], $context);
- $result = $this->kmsClient->generateDataKey([
- 'KeyId' => $this->kmsKeyId,
- 'KeySpec' => "AES_{$keySize}",
- 'EncryptionContext' => $context
- ]);
- return [
- 'Plaintext' => $result['Plaintext'],
- 'Ciphertext' => base64_encode($result['CiphertextBlob']),
- 'UpdatedContext' => $context
- ];
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MaterialsProvider.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MaterialsProvider.php
deleted file mode 100644
index 1c6941c2..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MaterialsProvider.php
+++ /dev/null
@@ -1,105 +0,0 @@
- true,
- 192 => true,
- 256 => true,
- ];
-
- /**
- * Returns if the requested size is supported by AES.
- *
- * @param int $keySize Size of the requested key in bits.
- *
- * @return bool
- */
- public static function isSupportedKeySize($keySize)
- {
- return isset(self::$supportedKeySizes[$keySize]);
- }
-
- /**
- * Performs further initialization of the MaterialsProvider based on the
- * data inside the MetadataEnvelope.
- *
- * @param MetadataEnvelope $envelope A storage envelope for encryption
- * metadata to be read from.
- *
- * @return MaterialsProvider
- *
- * @throws \RuntimeException Thrown when there is an empty or improperly
- * formed materials description in the envelope.
- *
- * @internal
- */
- abstract public function fromDecryptionEnvelope(MetadataEnvelope $envelope);
-
- /**
- * Returns the material description for this Provider so it can be verified
- * by encryption mechanisms.
- *
- * @return string
- */
- abstract public function getMaterialsDescription();
-
- /**
- * Returns the wrap algorithm name for this Provider.
- *
- * @return string
- */
- abstract public function getWrapAlgorithmName();
-
- /**
- * Takes a content encryption key (CEK) and description to return an
- * encrypted key according to the Provider's specifications.
- *
- * @param string $unencryptedCek Key for use in encrypting other data
- * that itself needs to be encrypted by the
- * Provider.
- * @param string $materialDescription Material Description for use in
- * encrypting the $cek.
- *
- * @return string
- */
- abstract public function encryptCek($unencryptedCek, $materialDescription);
-
- /**
- * Takes an encrypted content encryption key (CEK) and material description
- * for use decrypting the key according to the Provider's specifications.
- *
- * @param string $encryptedCek Encrypted key to be decrypted by the Provider
- * for use decrypting other data.
- * @param string $materialDescription Material Description for use in
- * encrypting the $cek.
- *
- * @return string
- */
- abstract public function decryptCek($encryptedCek, $materialDescription);
-
- /**
- * @param string $keySize Length of a cipher key in bits for generating a
- * random content encryption key (CEK).
- *
- * @return string
- */
- public function generateCek($keySize)
- {
- return openssl_random_pseudo_bytes($keySize / 8);
- }
-
- /**
- * @param string $openSslName Cipher OpenSSL name to use for generating
- * an initialization vector.
- *
- * @return string
- */
- public function generateIv($openSslName)
- {
- return openssl_random_pseudo_bytes(
- openssl_cipher_iv_length($openSslName)
- );
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MaterialsProviderInterface.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MaterialsProviderInterface.php
deleted file mode 100644
index a22016d6..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MaterialsProviderInterface.php
+++ /dev/null
@@ -1,61 +0,0 @@
- true,
- 256 => true,
- ];
-
- /**
- * Returns if the requested size is supported by AES.
- *
- * @param int $keySize Size of the requested key in bits.
- *
- * @return bool
- */
- public static function isSupportedKeySize($keySize)
- {
- return isset(self::$supportedKeySizes[$keySize]);
- }
-
- /**
- * Returns the wrap algorithm name for this Provider.
- *
- * @return string
- */
- abstract public function getWrapAlgorithmName();
-
- /**
- * Takes an encrypted content encryption key (CEK) and material description
- * for use decrypting the key according to the Provider's specifications.
- *
- * @param string $encryptedCek Encrypted key to be decrypted by the Provider
- * for use decrypting other data.
- * @param string $materialDescription Material Description for use in
- * decrypting the CEK.
- * @param string $options Options for use in decrypting the CEK.
- *
- * @return string
- */
- abstract public function decryptCek($encryptedCek, $materialDescription, $options);
-
- /**
- * @param string $keySize Length of a cipher key in bits for generating a
- * random content encryption key (CEK).
- * @param array $context Context map needed for key encryption
- * @param array $options Additional options to be used in CEK generation
- *
- * @return array
- */
- abstract public function generateCek($keySize, $context, $options);
-
- /**
- * @param string $openSslName Cipher OpenSSL name to use for generating
- * an initialization vector.
- *
- * @return string
- */
- public function generateIv($openSslName)
- {
- return openssl_random_pseudo_bytes(
- openssl_cipher_iv_length($openSslName)
- );
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MetadataEnvelope.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MetadataEnvelope.php
deleted file mode 100644
index 043a6433..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MetadataEnvelope.php
+++ /dev/null
@@ -1,56 +0,0 @@
-getConstants()) as $constant) {
- self::$constants[$constant] = true;
- }
- }
-
- return array_keys(self::$constants);
- }
-
- public function offsetSet($name, $value)
- {
- $constants = self::getConstantValues();
- if (is_null($name) || !in_array($name, $constants)) {
- throw new InvalidArgumentException('MetadataEnvelope fields must'
- . ' must match a predefined offset; use the header constants.');
- }
-
- $this->data[$name] = $value;
- }
-
- public function jsonSerialize()
- {
- return $this->data;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MetadataStrategyInterface.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MetadataStrategyInterface.php
deleted file mode 100644
index 5270c7e8..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/MetadataStrategyInterface.php
+++ /dev/null
@@ -1,30 +0,0 @@
- 0 && $blockSize <= PHP_INT_MAX,
- 'Block size must be a positive integer.',
- RangeException::class
- );
- self::needs(
- $aesKey->length() << 3 === $keySize,
- 'Incorrect key size; expected ' . $keySize . ' bits, got ' . ($aesKey->length() << 3) . ' bits.'
- );
- $this->aesKey = $aesKey;
- $this->keySize = $keySize;
- }
-
- /**
- * Encryption interface for AES-GCM
- *
- * @param string $plaintext Message to be encrypted
- * @param string $nonce Number to be used ONCE
- * @param Key $key AES Key
- * @param string $aad Additional authenticated data
- * @param string &$tag Reference to variable to hold tag
- * @param int $keySize Key size (bits)
- * @param int $blockSize Block size (bytes) -- How much memory to buffer
- * @return string
- * @throws InvalidArgumentException
- */
- public static function encrypt(
- $plaintext,
- $nonce,
- Key $key,
- $aad,
- &$tag,
- $keySize = 256,
- $blockSize = 8192
- ) {
- self::needs(
- self::strlen($nonce) === 12,
- 'Nonce must be exactly 12 bytes',
- InvalidArgumentException::class
- );
-
- $encryptor = new AesGcm($key, $keySize, $blockSize);
- list($aadLength, $gmac) = $encryptor->gmacInit($nonce, $aad);
-
- $ciphertext = \openssl_encrypt(
- $plaintext,
- "aes-{$encryptor->keySize}-ctr",
- $key->get(),
- OPENSSL_NO_PADDING | OPENSSL_RAW_DATA,
- $nonce . "\x00\x00\x00\x02"
- );
-
- /* Calculate auth tag in a streaming fashion to minimize memory usage: */
- $ciphertextLength = self::strlen($ciphertext);
- for ($i = 0; $i < $ciphertextLength; $i += $encryptor->blockSize) {
- $cBlock = new ByteArray(self::substr($ciphertext, $i, $encryptor->blockSize));
- $gmac->update($cBlock);
- }
- $tag = $gmac->finish($aadLength, $ciphertextLength)->toString();
- return $ciphertext;
- }
-
- /**
- * Decryption interface for AES-GCM
- *
- * @param string $ciphertext Ciphertext to decrypt
- * @param string $nonce Number to be used ONCE
- * @param Key $key AES key
- * @param string $aad Additional authenticated data
- * @param string $tag Authentication tag
- * @param int $keySize Key size (bits)
- * @param int $blockSize Block size (bytes) -- How much memory to buffer
- * @return string Plaintext
- *
- * @throws CryptoPolyfillException
- * @throws InvalidArgumentException
- */
- public static function decrypt(
- $ciphertext,
- $nonce,
- Key $key,
- $aad,
- &$tag,
- $keySize = 256,
- $blockSize = 8192
- ) {
- /* Precondition: */
- self::needs(
- self::strlen($nonce) === 12,
- 'Nonce must be exactly 12 bytes',
- InvalidArgumentException::class
- );
-
- $encryptor = new AesGcm($key, $keySize, $blockSize);
- list($aadLength, $gmac) = $encryptor->gmacInit($nonce, $aad);
-
- /* Calculate auth tag in a streaming fashion to minimize memory usage: */
- $ciphertextLength = self::strlen($ciphertext);
- for ($i = 0; $i < $ciphertextLength; $i += $encryptor->blockSize) {
- $cBlock = new ByteArray(self::substr($ciphertext, $i, $encryptor->blockSize));
- $gmac->update($cBlock);
- }
-
- /* Validate auth tag in constant-time: */
- $calc = $gmac->finish($aadLength, $ciphertextLength);
- $expected = new ByteArray($tag);
- self::needs($calc->equals($expected), 'Invalid authentication tag');
-
- /* Return plaintext if auth tag check succeeded: */
- return \openssl_decrypt(
- $ciphertext,
- "aes-{$encryptor->keySize}-ctr",
- $key->get(),
- OPENSSL_NO_PADDING | OPENSSL_RAW_DATA,
- $nonce . "\x00\x00\x00\x02"
- );
- }
-
- /**
- * Initialize a Gmac object with the nonce and this object's key.
- *
- * @param string $nonce Must be exactly 12 bytes long.
- * @param string|null $aad
- * @return array
- */
- protected function gmacInit($nonce, $aad = null)
- {
- $gmac = new Gmac(
- $this->aesKey,
- $nonce . "\x00\x00\x00\x01",
- $this->keySize
- );
- $aadBlock = new ByteArray($aad);
- $aadLength = $aadBlock->count();
- $gmac->update($aadBlock);
- $gmac->flush();
- return [$aadLength, $gmac];
- }
-
- /**
- * Calculate the length of a string.
- *
- * Uses the appropriate PHP function without being brittle to
- * mbstring.func_overload.
- *
- * @param string $string
- * @return int
- */
- protected static function strlen($string)
- {
- if (\is_callable('\\mb_strlen')) {
- return (int) \mb_strlen($string, '8bit');
- }
- return (int) \strlen($string);
- }
-
- /**
- * Return a substring of the provided string.
- *
- * Uses the appropriate PHP function without being brittle to
- * mbstring.func_overload.
- *
- * @param string $string
- * @param int $offset
- * @param int|null $length
- * @return string
- */
- protected static function substr($string, $offset = 0, $length = null)
- {
- if (\is_callable('\\mb_substr')) {
- return \mb_substr($string, $offset, $length, '8bit');
- } elseif (!\is_null($length)) {
- return \substr($string, $offset, $length);
- }
- return \substr($string, $offset);
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/ByteArray.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/ByteArray.php
deleted file mode 100644
index c3472b04..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/ByteArray.php
+++ /dev/null
@@ -1,258 +0,0 @@
-toArray();
- $size = $size->count();
- } elseif (!\is_int($size)) {
- throw new \InvalidArgumentException(
- 'Argument must be an integer, string, or array of integers.'
- );
- }
-
- parent::__construct($size);
-
- if (!empty($arr)) {
- // Populate this object with values from constructor argument
- foreach ($arr as $i => $v) {
- $this->offsetSet($i, $v);
- }
- } else {
- // Initialize to zero.
- for ($i = 0; $i < $size; ++$i) {
- $this->offsetSet($i, 0);
- }
- }
- }
-
- /**
- * Encode an integer into a byte array. 32-bit (unsigned), big endian byte order.
- *
- * @param int $num
- * @return self
- */
- public static function enc32be($num)
- {
- return new ByteArray(\pack('N', $num));
- }
-
- /**
- * @param ByteArray $other
- * @return bool
- */
- public function equals(ByteArray $other)
- {
- if ($this->count() !== $other->count()) {
- return false;
- }
- $d = 0;
- for ($i = $this->count() - 1; $i >= 0; --$i) {
- $d |= $this[$i] ^ $other[$i];
- }
- return $d === 0;
- }
-
- /**
- * @param ByteArray $array
- * @return ByteArray
- */
- public function exclusiveOr(ByteArray $array)
- {
- self::needs(
- $this->count() === $array->count(),
- 'Both ByteArrays must be equal size for exclusiveOr()'
- );
- $out = clone $this;
- for ($i = 0; $i < $this->count(); ++$i) {
- $out[$i] = $array[$i] ^ $out[$i];
- }
- return $out;
- }
-
- /**
- * Returns a new ByteArray incremented by 1 (big endian byte order).
- *
- * @param int $increase
- * @return self
- */
- public function getIncremented($increase = 1)
- {
- $clone = clone $this;
- $index = $clone->count();
- while ($index > 0) {
- --$index;
- $tmp = ($clone[$index] + $increase) & PHP_INT_MAX;
- $clone[$index] = $tmp & 0xff;
- $increase = $tmp >> 8;
- }
- return $clone;
- }
-
- /**
- * Sets a value. See SplFixedArray for more.
- *
- * @param int $index
- * @param int $newval
- * @return void
- */
- public function offsetSet($index, $newval)
- {
- parent::offsetSet($index, $newval & 0xff);
- }
-
- /**
- * Return a copy of this ByteArray, bitshifted to the right by 1.
- * Used in Gmac.
- *
- * @return self
- */
- public function rshift()
- {
- $out = clone $this;
- for ($j = $this->count() - 1; $j > 0; --$j) {
- $out[$j] = (($out[$j - 1] & 1) << 7) | ($out[$j] >> 1);
- }
- $out[0] >>= 1;
- return $out;
- }
-
- /**
- * Constant-time conditional select. This is meant to read like a ternary operator.
- *
- * $z = ByteArray::select(1, $x, $y); // $z is equal to $x
- * $z = ByteArray::select(0, $x, $y); // $z is equal to $y
- *
- * @param int $select
- * @param ByteArray $left
- * @param ByteArray $right
- * @return ByteArray
- */
- public static function select($select, ByteArray $left, ByteArray $right)
- {
- self::needs(
- $left->count() === $right->count(),
- 'Both ByteArrays must be equal size for select()'
- );
- $rightLength = $right->count();
- $out = clone $right;
- $mask = (-($select & 1)) & 0xff;
- for ($i = 0; $i < $rightLength; $i++) {
- $out[$i] = $out[$i] ^ (($left[$i] ^ $right[$i]) & $mask);
- }
- return $out;
- }
-
- /**
- * Overwrite values of this ByteArray based on a separate ByteArray, with
- * a given starting offset and length.
- *
- * See JavaScript's Uint8Array.set() for more information.
- *
- * @param ByteArray $input
- * @param int $offset
- * @param int|null $length
- * @return self
- */
- public function set(ByteArray $input, $offset = 0, $length = null)
- {
- self::needs(
- is_int($offset) && $offset >= 0,
- 'Offset must be a positive integer or zero'
- );
- if (is_null($length)) {
- $length = $input->count();
- }
-
- $i = 0; $j = $offset;
- while ($i < $length && $j < $this->count()) {
- $this[$j] = $input[$i];
- ++$i;
- ++$j;
- }
- return $this;
- }
-
- /**
- * Returns a slice of this ByteArray.
- *
- * @param int $start
- * @param null $length
- * @return self
- */
- public function slice($start = 0, $length = null)
- {
- return new ByteArray(\array_slice($this->toArray(), $start, $length));
- }
-
- /**
- * Mutates the current state and sets all values to zero.
- *
- * @return void
- */
- public function zeroize()
- {
- for ($i = $this->count() - 1; $i >= 0; --$i) {
- $this->offsetSet($i, 0);
- }
- }
-
- /**
- * Converts the ByteArray to a raw binary string.
- *
- * @return string
- */
- public function toString()
- {
- $count = $this->count();
- if ($count === 0) {
- return '';
- }
- $args = $this->toArray();
- \array_unshift($args, \str_repeat('C', $count));
- // constant-time, PHP <5.6 equivalent to pack('C*', ...$args);
- return \call_user_func_array('\\pack', $args);
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/Gmac.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/Gmac.php
deleted file mode 100644
index 535cfcaa..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/Gmac.php
+++ /dev/null
@@ -1,223 +0,0 @@
-buf = new ByteArray(16);
- $this->h = new ByteArray(
- \openssl_encrypt(
- \str_repeat("\0", 16),
- "aes-{$keySize}-ecb",
- $aesKey->get(),
- OPENSSL_RAW_DATA | OPENSSL_NO_PADDING
- )
- );
- $this->key = $aesKey;
- $this->x = new ByteArray(16);
- $this->hf = new ByteArray(
- \openssl_encrypt(
- $nonce,
- "aes-{$keySize}-ecb",
- $aesKey->get(),
- OPENSSL_RAW_DATA | OPENSSL_NO_PADDING
- )
- );
- }
-
- /**
- * Update the object with some data.
- *
- * This method mutates this Gmac object.
- *
- * @param ByteArray $blocks
- * @return self
- */
- public function update(ByteArray $blocks)
- {
- if (($blocks->count() + $this->bufLength) < self::BLOCK_SIZE) {
- // Write to internal buffer until we reach enough to write.
- $this->buf->set($blocks, $this->bufLength);
- $this->bufLength += $blocks->count();
- return $this;
- }
-
- // Process internal buffer first.
- if ($this->bufLength > 0) {
- // 0 <= state.buf_len < BLOCK_SIZE is an invariant
- $tmp = new ByteArray(self::BLOCK_SIZE);
- $tmp->set($this->buf->slice(0, $this->bufLength));
- $remainingBlockLength = self::BLOCK_SIZE - $this->bufLength;
- $tmp->set($blocks->slice(0, $remainingBlockLength), $this->bufLength);
- $blocks = $blocks->slice($remainingBlockLength);
- $this->bufLength = 0;
- $this->x = $this->blockMultiply($this->x->exclusiveOr($tmp), $this->h);
- }
-
- // Process full blocks.
- $numBlocks = $blocks->count() >> 4;
- for ($i = 0; $i < $numBlocks; ++$i) {
- $tmp = $blocks->slice($i << 4, self::BLOCK_SIZE);
- $this->x = $this->blockMultiply($this->x->exclusiveOr($tmp), $this->h);
- }
- $last = $numBlocks << 4;
-
- // Zero-fill buffer
- for ($i = 0; $i < 16; ++$i) {
- $this->buf[$i] = 0;
- }
- // Feed leftover into buffer.
- if ($last < $blocks->count()) {
- $tmp = $blocks->slice($last);
- $this->buf->set($tmp);
- $this->bufLength += ($blocks->count() - $last);
- }
- return $this;
- }
-
- /**
- * Finish processing the authentication tag.
- *
- * This method mutates this Gmac object (effectively resetting it).
- *
- * @param int $aadLength
- * @param int $ciphertextLength
- * @return ByteArray
- */
- public function finish($aadLength, $ciphertextLength)
- {
- $lengthBlock = new ByteArray(16);
- $state = $this->flush();
-
- // AES-GCM expects bit lengths, not byte lengths.
- $lengthBlock->set(ByteArray::enc32be($aadLength >> 29), 0);
- $lengthBlock->set(ByteArray::enc32be($aadLength << 3), 4);
- $lengthBlock->set(ByteArray::enc32be($ciphertextLength >> 29), 8);
- $lengthBlock->set(ByteArray::enc32be($ciphertextLength << 3), 12);
-
- $state->update($lengthBlock);
- $output = $state->x->exclusiveOr($state->hf);
-
- // Zeroize the internal values as a best-effort.
- $state->buf->zeroize();
- $state->x->zeroize();
- $state->h->zeroize();
- $state->hf->zeroize();
- return $output;
- }
-
- /**
- * Get a specific bit from the provided array, at the given index.
- *
- * [01234567], 8+[01234567], 16+[01234567], ...
- *
- * @param ByteArray $x
- * @param int $i
- * @return int
- */
- protected function bit(ByteArray $x, $i)
- {
- $byte = $i >> 3;
- return ($x[$byte] >> ((7 - $i) & 7)) & 1;
- }
-
- /**
- * Galois Field Multiplication
- *
- * This function is the critical path that must be constant-time in order to
- * avoid timing side-channels against AES-GCM.
- *
- * The contents of each are always calculated, regardless of the branching
- * condition, to prevent another kind of timing leak.
- *
- * @param ByteArray $x
- * @param ByteArray $y
- * @return ByteArray
- */
- protected function blockMultiply(ByteArray $x, ByteArray $y)
- {
- static $fieldPolynomial = null;
- if (!$fieldPolynomial) {
- $fieldPolynomial = new ByteArray([
- 0xe1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- ]);
- }
- self::needs($x->count() === 16, 'Argument 1 must be a ByteArray of exactly 16 bytes');
- self::needs($y->count() === 16, 'Argument 2 must be a ByteArray of exactly 16 bytes');
-
- $v = clone $y;
- $z = new ByteArray(16);
-
- for ($i = 0; $i < 128; ++$i) {
- // if ($b) $z = $z->exclusiveOr($v);
- $b = $this->bit($x, $i);
- $z = ByteArray::select(
- $b,
- $z->exclusiveOr($v),
- $z
- );
-
- // if ($b) $v = $v->exclusiveOr($fieldPolynomial);
- $b = $v[15] & 1;
- $v = $v->rshift();
- $v = ByteArray::select(
- $b,
- $v->exclusiveOr($fieldPolynomial),
- $v
- );
- }
- return $z;
- }
-
- /**
- * Finish processing any leftover bytes in the internal buffer.
- *
- * @return self
- */
- public function flush()
- {
- if ($this->bufLength !== 0) {
- $this->x = $this->blockMultiply(
- $this->x->exclusiveOr($this->buf),
- $this->h
- );
- $this->bufLength = 0;
- }
- return $this;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/Key.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/Key.php
deleted file mode 100644
index 49d0c698..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/Key.php
+++ /dev/null
@@ -1,77 +0,0 @@
-internalString = $str;
- }
-
- /**
- * Defense in depth:
- *
- * PHP 7.2 includes the Sodium cryptography library, which (among other things)
- * exposes a function called sodium_memzero() that we can use to zero-fill strings
- * to minimize the risk of sensitive cryptographic materials persisting in memory.
- *
- * If this function is not available, we XOR the string in-place with itself as a
- * best-effort attempt.
- */
- public function __destruct()
- {
- if (extension_loaded('sodium') && function_exists('sodium_memzero')) {
- try {
- \sodium_memzero($this->internalString);
- } catch (\SodiumException $ex) {
- // This is a best effort, but does not provide the same guarantees as sodium_memzero():
- $this->internalString ^= $this->internalString;
- }
- }
- }
-
- /**
- * @return string
- */
- public function get()
- {
- return $this->internalString;
- }
-
- /**
- * @return int
- */
- public function length()
- {
- if (\is_callable('\\mb_strlen')) {
- return (int) \mb_strlen($this->internalString, '8bit');
- }
- return (int) \strlen($this->internalString);
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/NeedsTrait.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/NeedsTrait.php
deleted file mode 100644
index 5ba4d647..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Crypto/Polyfill/NeedsTrait.php
+++ /dev/null
@@ -1,38 +0,0 @@
-getHandlerList()->appendInit(
- PresignUrlMiddleware::wrap(
- $this,
- $args['endpoint_provider'],
- [
- 'operations' => [
- 'CopyDBClusterSnapshot',
- 'CreateDBCluster',
- ],
- 'service' => 'rds',
- 'presign_param' => 'PreSignedUrl',
- 'require_different_region' => true,
- 'extra_query_params' => [
- 'CopyDBClusterSnapshot' => ['DestinationRegion'],
- 'CreateDBCluster' => ['DestinationRegion'],
- ]
- ]
- ),
- 'rds.presigner'
- );
- };
- parent::__construct($args);
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DocDB/Exception/DocDBException.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DocDB/Exception/DocDBException.php
deleted file mode 100644
index 046b0cfa..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DocDB/Exception/DocDBException.php
+++ /dev/null
@@ -1,9 +0,0 @@
-cache = $cache;
- }
-
- public function get($key)
- {
- return $this->cache->fetch($key);
- }
-
- public function fetch($key)
- {
- return $this->get($key);
- }
-
- public function set($key, $value, $ttl = 0)
- {
- return $this->cache->save($key, $value, $ttl);
- }
-
- public function save($key, $value, $ttl = 0)
- {
- return $this->set($key, $value, $ttl);
- }
-
- public function remove($key)
- {
- return $this->cache->delete($key);
- }
-
- public function delete($key)
- {
- return $this->remove($key);
- }
-
- public function contains($key)
- {
- return $this->cache->contains($key);
- }
-
- public function getStats()
- {
- return $this->cache->getStats();
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/BinaryValue.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/BinaryValue.php
deleted file mode 100644
index 1b2965d1..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/BinaryValue.php
+++ /dev/null
@@ -1,36 +0,0 @@
-value = (string) $value;
- }
-
- public function jsonSerialize()
- {
- return $this->value;
- }
-
- public function __toString()
- {
- return $this->value;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/DynamoDbClient.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/DynamoDbClient.php
deleted file mode 100644
index d62cb3b5..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/DynamoDbClient.php
+++ /dev/null
@@ -1,190 +0,0 @@
-register();
-
- return $handler;
- }
-
- /** @internal */
- public static function _applyRetryConfig($value, array &$args, HandlerList $list)
- {
- if ($value) {
- $config = \Aws\Retry\ConfigurationProvider::unwrap($value);
-
- if ($config->getMode() === 'legacy') {
- $list->appendSign(
- Middleware::retry(
- RetryMiddleware::createDefaultDecider(
- $config->getMaxAttempts() - 1,
- ['error_codes' => ['TransactionInProgressException']]
- ),
- function ($retries) {
- return $retries
- ? RetryMiddleware::exponentialDelay($retries) / 2
- : 0;
- },
- isset($args['stats']['retries'])
- ? (bool)$args['stats']['retries']
- : false
- ),
- 'retry'
- );
- } else {
- $list->appendSign(
- RetryMiddlewareV2::wrap(
- $config,
- [
- 'collect_stats' => $args['stats']['retries'],
- 'transient_error_codes' => ['TransactionInProgressException']
- ]
- ),
- 'retry'
- );
- }
- }
- }
-
- /** @internal */
- public static function _applyApiProvider($value, array &$args, HandlerList $list)
- {
- ClientResolver::_apply_api_provider($value, $args);
- $args['parser'] = new Crc32ValidatingParser($args['parser']);
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/Exception/DynamoDbException.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/Exception/DynamoDbException.php
deleted file mode 100644
index 0360388a..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/Exception/DynamoDbException.php
+++ /dev/null
@@ -1,9 +0,0 @@
- $this->getTableName(),
- 'Key' => $this->formatKey($id),
- 'Expected' => ['lock' => ['Exists' => false]],
- 'AttributeUpdates' => ['lock' => ['Value' => ['N' => '1']]],
- 'ReturnValues' => 'ALL_NEW',
- ];
-
- // Acquire the lock and fetch the item data.
- $timeout = time() + $this->getMaxLockWaitTime();
- while (true) {
- try {
- $item = [];
- $result = $this->client->updateItem($params);
- if (isset($result['Attributes'])) {
- foreach ($result['Attributes'] as $key => $value) {
- $item[$key] = current($value);
- }
- }
- return $item;
- } catch (DynamoDbException $e) {
- if ($e->getAwsErrorCode() === 'ConditionalCheckFailedException'
- && time() < $timeout
- ) {
- usleep(rand(
- $this->getMinLockRetryMicrotime(),
- $this->getMaxLockRetryMicrotime()
- ));
- } else {
- break;
- }
- }
- }
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/Marshaler.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/Marshaler.php
deleted file mode 100644
index f86452c6..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/Marshaler.php
+++ /dev/null
@@ -1,320 +0,0 @@
- false,
- 'nullify_invalid' => false,
- 'wrap_numbers' => false,
- ];
-
- /** @var array Marshaler options. */
- private $options;
-
- /**
- * Instantiates a DynamoDB Marshaler.
- *
- * The following options are valid.
- *
- * - ignore_invalid: (bool) Set to `true` if invalid values should be
- * ignored (i.e., not included) during marshaling.
- * - nullify_invalid: (bool) Set to `true` if invalid values should be set
- * to null.
- * - wrap_numbers: (bool) Set to `true` to wrap numbers with `NumberValue`
- * objects during unmarshaling to preserve the precision.
- *
- * @param array $options Marshaler options
- */
- public function __construct(array $options = [])
- {
- $this->options = $options + self::$defaultOptions;
- }
-
- /**
- * Creates a special object to represent a DynamoDB binary (B) value.
- *
- * This helps disambiguate binary values from string (S) values.
- *
- * @param mixed $value A binary value compatible with Guzzle streams.
- *
- * @return BinaryValue
- * @see GuzzleHttp\Stream\Stream::factory
- */
- public function binary($value)
- {
- return new BinaryValue($value);
- }
-
- /**
- * Creates a special object to represent a DynamoDB number (N) value.
- *
- * This helps maintain the precision of large integer/float in PHP.
- *
- * @param string|int|float $value A number value.
- *
- * @return NumberValue
- */
- public function number($value)
- {
- return new NumberValue($value);
- }
-
- /**
- * Creates a special object to represent a DynamoDB set (SS/NS/BS) value.
- *
- * This helps disambiguate set values from list (L) values.
- *
- * @param array $values The values of the set.
- *
- * @return SetValue
- *
- */
- public function set(array $values)
- {
- return new SetValue($values);
- }
-
- /**
- * Marshal a JSON document from a string to a DynamoDB item.
- *
- * The result is an array formatted in the proper parameter structure
- * required by the DynamoDB API for items.
- *
- * @param string $json A valid JSON document.
- *
- * @return array Item formatted for DynamoDB.
- * @throws \InvalidArgumentException if the JSON is invalid.
- */
- public function marshalJson($json)
- {
- $data = json_decode($json);
- if (!($data instanceof \stdClass)) {
- throw new \InvalidArgumentException(
- 'The JSON document must be valid and be an object at its root.'
- );
- }
-
- return current($this->marshalValue($data));
- }
-
- /**
- * Marshal a native PHP array of data to a DynamoDB item.
- *
- * The result is an array formatted in the proper parameter structure
- * required by the DynamoDB API for items.
- *
- * @param array|\stdClass $item An associative array of data.
- *
- * @return array Item formatted for DynamoDB.
- */
- public function marshalItem($item)
- {
- return current($this->marshalValue($item));
- }
-
- /**
- * Marshal a native PHP value into a DynamoDB attribute value.
- *
- * The result is an associative array that is formatted in the proper
- * `[TYPE => VALUE]` parameter structure required by the DynamoDB API.
- *
- * @param mixed $value A scalar, array, or `stdClass` value.
- *
- * @return array Attribute formatted for DynamoDB.
- * @throws \UnexpectedValueException if the value cannot be marshaled.
- */
- public function marshalValue($value)
- {
- $type = gettype($value);
-
- // Handle string values.
- if ($type === 'string') {
- return ['S' => $value];
- }
-
- // Handle number values.
- if ($type === 'integer'
- || $type === 'double'
- || $value instanceof NumberValue
- ) {
- return ['N' => (string) $value];
- }
-
- // Handle boolean values.
- if ($type === 'boolean') {
- return ['BOOL' => $value];
- }
-
- // Handle null values.
- if ($type === 'NULL') {
- return ['NULL' => true];
- }
-
- // Handle set values.
- if ($value instanceof SetValue) {
- if (count($value) === 0) {
- return $this->handleInvalid('empty sets are invalid');
- }
- $previousType = null;
- $data = [];
- foreach ($value as $v) {
- $marshaled = $this->marshalValue($v);
- $setType = key($marshaled);
- if (!$previousType) {
- $previousType = $setType;
- } elseif ($setType !== $previousType) {
- return $this->handleInvalid('sets must be uniform in type');
- }
- $data[] = current($marshaled);
- }
-
- return [$previousType . 'S' => array_values(array_unique($data))];
- }
-
- // Handle list and map values.
- $dbType = 'L';
- if ($value instanceof \stdClass) {
- $type = 'array';
- $dbType = 'M';
- }
- if ($type === 'array' || $value instanceof \Traversable) {
- $data = [];
- $index = 0;
- foreach ($value as $k => $v) {
- if ($v = $this->marshalValue($v)) {
- $data[$k] = $v;
- if ($dbType === 'L' && (!is_int($k) || $k != $index++)) {
- $dbType = 'M';
- }
- }
- }
- return [$dbType => $data];
- }
-
- // Handle binary values.
- if (is_resource($value) || $value instanceof StreamInterface) {
- $value = $this->binary($value);
- }
- if ($value instanceof BinaryValue) {
- return ['B' => (string) $value];
- }
-
- // Handle invalid values.
- return $this->handleInvalid('encountered unexpected value');
- }
-
- /**
- * Unmarshal a document (item) from a DynamoDB operation result into a JSON
- * document string.
- *
- * @param array $data Item/document from a DynamoDB result.
- * @param int $jsonEncodeFlags Flags to use with `json_encode()`.
- *
- * @return string
- */
- public function unmarshalJson(array $data, $jsonEncodeFlags = 0)
- {
- return json_encode(
- $this->unmarshalValue(['M' => $data], true),
- $jsonEncodeFlags
- );
- }
-
- /**
- * Unmarshal an item from a DynamoDB operation result into a native PHP
- * array. If you set $mapAsObject to true, then a stdClass value will be
- * returned instead.
- *
- * @param array $data Item from a DynamoDB result.
- * @param bool $mapAsObject Whether maps should be represented as stdClass.
- *
- * @return array|\stdClass
- */
- public function unmarshalItem(array $data, $mapAsObject = false)
- {
- return $this->unmarshalValue(['M' => $data], $mapAsObject);
- }
-
- /**
- * Unmarshal a value from a DynamoDB operation result into a native PHP
- * value. Will return a scalar, array, or (if you set $mapAsObject to true)
- * stdClass value.
- *
- * @param array $value Value from a DynamoDB result.
- * @param bool $mapAsObject Whether maps should be represented as stdClass.
- *
- * @return mixed
- * @throws \UnexpectedValueException
- */
- public function unmarshalValue(array $value, $mapAsObject = false)
- {
- $type = key($value);
- $value = $value[$type];
- switch ($type) {
- case 'S':
- case 'BOOL':
- return $value;
- case 'NULL':
- return null;
- case 'N':
- if ($this->options['wrap_numbers']) {
- return new NumberValue($value);
- }
-
- // Use type coercion to unmarshal numbers to int/float.
- return $value + 0;
- case 'M':
- if ($mapAsObject) {
- $data = new \stdClass;
- foreach ($value as $k => $v) {
- $data->$k = $this->unmarshalValue($v, $mapAsObject);
- }
- return $data;
- }
- // NOBREAK: Unmarshal M the same way as L, for arrays.
- case 'L':
- foreach ($value as $k => $v) {
- $value[$k] = $this->unmarshalValue($v, $mapAsObject);
- }
- return $value;
- case 'B':
- return new BinaryValue($value);
- case 'SS':
- case 'NS':
- case 'BS':
- foreach ($value as $k => $v) {
- $value[$k] = $this->unmarshalValue([$type[0] => $v]);
- }
- return new SetValue($value);
- }
-
- throw new \UnexpectedValueException("Unexpected type: {$type}.");
- }
-
- /**
- * Handle invalid value based on marshaler configuration.
- *
- * @param string $message Error message
- *
- * @return array|null
- */
- private function handleInvalid($message)
- {
- if ($this->options['ignore_invalid']) {
- return null;
- }
-
- if ($this->options['nullify_invalid']) {
- return ['NULL' => true];
- }
-
- throw new \UnexpectedValueException("Marshaling error: {$message}.");
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/NumberValue.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/NumberValue.php
deleted file mode 100644
index 093143b4..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/NumberValue.php
+++ /dev/null
@@ -1,29 +0,0 @@
-value = (string) $value;
- }
-
- public function jsonSerialize()
- {
- return $this->value;
- }
-
- public function __toString()
- {
- return $this->value;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SessionConnectionConfigTrait.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SessionConnectionConfigTrait.php
deleted file mode 100644
index 371a932d..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SessionConnectionConfigTrait.php
+++ /dev/null
@@ -1,262 +0,0 @@
- ThisIsATest
- * and it uses it in order to set the values.
- *
- * @param array $config
- */
- public function initConfig( array $config = [] )
- {
- if (!empty($config))
- {
- foreach ($config as $key => $value)
- {
- $method = 'set' . str_replace('_', '', ucwords($key, '_'));
- if(method_exists($this,$method))
- {
- call_user_func_array(array($this, $method), array($value));
- }
- }
- }
-
- // It applies the default PHP session lifetime, if no session lifetime config is provided
- if(!isset($config['session_lifetime']))
- {
- $this->setSessionLifetime((int) ini_get('session.gc_maxlifetime'));
- }
- }
-
- /**
- * @return string
- */
- public function getTableName()
- {
- return $this->tableName;
- }
-
- /**
- * @param string $tableName
- */
- public function setTableName($tableName)
- {
- $this->tableName = $tableName;
- }
-
- /**
- * @return string
- */
- public function getHashKey()
- {
- return $this->hashKey;
- }
-
- /**
- * @param string $hashKey
- */
- public function setHashKey($hashKey)
- {
- $this->hashKey = $hashKey;
- }
-
- /**
- * @return string
- */
- public function getDataAttribute()
- {
- return $this->dataAttribute;
- }
-
- /**
- * @param string $dataAttribute
- */
- public function setDataAttribute($dataAttribute)
- {
- $this->dataAttribute = $dataAttribute;
- }
-
- /**
- * @return string
- */
- public function getDataAttributeType()
- {
- return $this->dataAttributeType;
- }
-
- /**
- * @param string $dataAttributeType
- */
- public function setDataAttributeType($dataAttributeType)
- {
- $this->dataAttributeType = $dataAttributeType;
- }
-
- /**
- * @return number
- */
- public function getSessionLifetime()
- {
- return $this->sessionLifetime;
- }
-
- /**
- * @param number $sessionLifetime
- */
- public function setSessionLifetime($sessionLifetime)
- {
- $this->sessionLifetime = $sessionLifetime;
- }
-
- /**
- * @return string
- */
- public function getSessionLifetimeAttribute()
- {
- return $this->sessionLifetimeAttribute;
- }
-
- /**
- * @param string $sessionLifetimeAttribute
- */
- public function setSessionLifetimeAttribute($sessionLifetimeAttribute)
- {
- $this->sessionLifetimeAttribute = $sessionLifetimeAttribute;
- }
-
- /**
- * @return boolean
- */
- public function isConsistentRead()
- {
- return $this->consistentRead;
- }
-
- /**
- * @param boolean $consistentRead
- */
- public function setConsistentRead($consistentRead)
- {
- $this->consistentRead = $consistentRead;
- }
-
- /**
- * @return mixed
- */
- public function getBatchConfig()
- {
- return $this->batchConfig;
- }
-
- /**
- * @param mixed $batchConfig
- */
- public function setBatchConfig($batchConfig)
- {
- $this->batchConfig = $batchConfig;
- }
- /**
- * @return boolean
- */
- public function isLocking()
- {
- return $this->locking;
- }
-
- /**
- * @param boolean $locking
- */
- public function setLocking($locking)
- {
- $this->locking = $locking;
- }
-
- /**
- * @return number
- */
- public function getMaxLockWaitTime()
- {
- return $this->maxLockWaitTime;
- }
-
- /**
- * @param number $maxLockWaitTime
- */
- public function setMaxLockWaitTime($maxLockWaitTime)
- {
- $this->maxLockWaitTime = $maxLockWaitTime;
- }
-
- /**
- * @return number
- */
- public function getMinLockRetryMicrotime()
- {
- return $this->minLockRetryMicrotime;
- }
-
- /**
- * @param number $minLockRetryMicrotime
- */
- public function setMinLockRetryMicrotime($minLockRetryMicrotime)
- {
- $this->minLockRetryMicrotime = $minLockRetryMicrotime;
- }
-
- /**
- * @return number
- */
- public function getMaxLockRetryMicrotime()
- {
- return $this->maxLockRetryMicrotime;
- }
-
- /**
- * @param number $maxLockRetryMicrotime
- */
- public function setMaxLockRetryMicrotime($maxLockRetryMicrotime)
- {
- $this->maxLockRetryMicrotime = $maxLockRetryMicrotime;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SessionConnectionInterface.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SessionConnectionInterface.php
deleted file mode 100644
index 0c46a7d1..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SessionConnectionInterface.php
+++ /dev/null
@@ -1,45 +0,0 @@
- false];
- if ($config['locking']) {
- $connection = new LockingSessionConnection($client, $config);
- } else {
- $connection = new StandardSessionConnection($client, $config);
- }
-
- return new static($connection);
- }
-
- /**
- * @param SessionConnectionInterface $connection
- */
- public function __construct(SessionConnectionInterface $connection)
- {
- $this->connection = $connection;
- }
-
- /**
- * Register the DynamoDB session handler.
- *
- * @return bool Whether or not the handler was registered.
- * @codeCoverageIgnore
- */
- public function register()
- {
- return session_set_save_handler($this, true);
- }
-
- /**
- * Open a session for writing. Triggered by session_start().
- *
- * @param string $savePath Session save path.
- * @param string $sessionName Session name.
- *
- * @return bool Whether or not the operation succeeded.
- */
- public function open($savePath, $sessionName)
- {
- $this->savePath = $savePath;
- $this->sessionName = $sessionName;
-
- return true;
- }
-
- /**
- * Close a session from writing.
- *
- * @return bool Success
- */
- public function close()
- {
- $id = session_id();
- // Make sure the session is unlocked and the expiration time is updated,
- // even if the write did not occur
- if ($this->openSessionId !== $id || !$this->sessionWritten) {
- $result = $this->connection->write($this->formatId($id), '', false);
- $this->sessionWritten = (bool) $result;
- }
-
- return $this->sessionWritten;
- }
-
- /**
- * Read a session stored in DynamoDB.
- *
- * @param string $id Session ID.
- *
- * @return string Session data.
- */
- public function read($id)
- {
- $this->openSessionId = $id;
- // PHP expects an empty string to be returned from this method if no
- // data is retrieved
- $this->dataRead = '';
-
- // Get session data using the selected locking strategy
- $item = $this->connection->read($this->formatId($id));
-
- $dataAttribute = $this->connection->getDataAttribute();
- $sessionLifetimeAttribute = $this->connection->getSessionLifetimeAttribute();
-
- // Return the data if it is not expired. If it is expired, remove it
- if (isset($item[$sessionLifetimeAttribute]) && isset($item[$dataAttribute])) {
- $this->dataRead = $item[$dataAttribute];
- if ($item[$sessionLifetimeAttribute] <= time()) {
- $this->dataRead = '';
- $this->destroy($id);
- }
- }
-
- return $this->dataRead;
- }
-
- /**
- * Write a session to DynamoDB.
- *
- * @param string $id Session ID.
- * @param string $data Serialized session data to write.
- *
- * @return bool Whether or not the operation succeeded.
- */
- public function write($id, $data)
- {
- $changed = $id !== $this->openSessionId
- || $data !== $this->dataRead;
- $this->openSessionId = $id;
-
- // Write the session data using the selected locking strategy
- $this->sessionWritten = $this->connection
- ->write($this->formatId($id), $data, $changed);
-
- return $this->sessionWritten;
- }
-
- /**
- * Delete a session stored in DynamoDB.
- *
- * @param string $id Session ID.
- *
- * @return bool Whether or not the operation succeeded.
- */
- public function destroy($id)
- {
- $this->openSessionId = $id;
- // Delete the session data using the selected locking strategy
- $this->sessionWritten
- = $this->connection->delete($this->formatId($id));
-
- return $this->sessionWritten;
- }
-
- /**
- * Satisfies the session handler interface, but does nothing. To do garbage
- * collection, you must manually call the garbageCollect() method.
- *
- * @param int $maxLifetime Ignored.
- *
- * @return bool Whether or not the operation succeeded.
- * @codeCoverageIgnore
- */
- public function gc($maxLifetime)
- {
- // Garbage collection for a DynamoDB table must be triggered manually.
- return true;
- }
-
- /**
- * Triggers garbage collection on expired sessions.
- * @codeCoverageIgnore
- */
- public function garbageCollect()
- {
- $this->connection->deleteExpired();
- }
-
- /**
- * Prepend the session ID with the session name.
- *
- * @param string $id The session ID.
- *
- * @return string Prepared session ID.
- */
- private function formatId($id)
- {
- return trim($this->sessionName . '_' . $id, '_');
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SetValue.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SetValue.php
deleted file mode 100644
index 5bee62bf..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/SetValue.php
+++ /dev/null
@@ -1,44 +0,0 @@
-values = $values;
- }
-
- /**
- * Get the values formatted for PHP and JSON.
- *
- * @return array
- */
- public function toArray()
- {
- return $this->values;
- }
-
- public function count()
- {
- return count($this->values);
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->values);
- }
-
- public function jsonSerialize()
- {
- return $this->toArray();
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/StandardSessionConnection.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/StandardSessionConnection.php
deleted file mode 100644
index cf64f18a..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/StandardSessionConnection.php
+++ /dev/null
@@ -1,148 +0,0 @@
-client = $client;
- $this->initConfig($config);
- }
-
- public function read($id)
- {
- $item = [];
- try {
- // Execute a GetItem command to retrieve the item.
- $result = $this->client->getItem([
- 'TableName' => $this->getTableName(),
- 'Key' => $this->formatKey($id),
- 'ConsistentRead' => $this->isConsistentRead(),
- ]);
-
- // Get the item values
- $result = isset($result['Item']) ? $result['Item'] : [];
- foreach ($result as $key => $value) {
- $item[$key] = current($value);
- }
- } catch (DynamoDbException $e) {
- // Could not retrieve item, so return nothing.
- }
-
- return $item;
- }
-
- public function write($id, $data, $isChanged)
- {
- // Prepare the attributes
- $expires = time() + $this->getSessionLifetime();
- $attributes = [
- $this->getSessionLifetimeAttribute() => ['Value' => ['N' => (string) $expires]],
- 'lock' => ['Action' => 'DELETE'],
- ];
- if ($isChanged) {
- if ($data != '') {
- $type = $this->getDataAttributeType();
- if ($type == 'binary') {
- $attributes[$this->getDataAttribute()] = ['Value' => ['B' => $data]];
- } else {
- $attributes[$this->getDataAttribute()] = ['Value' => ['S' => $data]];
- }
-
- } else {
- $attributes[$this->getDataAttribute()] = ['Action' => 'DELETE'];
- }
- }
-
- // Perform the UpdateItem command
- try {
- return (bool) $this->client->updateItem([
- 'TableName' => $this->getTableName(),
- 'Key' => $this->formatKey($id),
- 'AttributeUpdates' => $attributes,
- ]);
- } catch (DynamoDbException $e) {
- return $this->triggerError("Error writing session $id: {$e->getMessage()}");
- }
- }
-
- public function delete($id)
- {
- try {
- return (bool) $this->client->deleteItem([
- 'TableName' => $this->getTableName(),
- 'Key' => $this->formatKey($id),
- ]);
- } catch (DynamoDbException $e) {
- return $this->triggerError("Error deleting session $id: {$e->getMessage()}");
- }
- }
-
- public function deleteExpired()
- {
- // Create a Scan iterator for finding expired session items
- $scan = $this->client->getPaginator('Scan', [
- 'TableName' => $this->getTableName(),
- 'AttributesToGet' => [$this->getHashKey()],
- 'ScanFilter' => [
- $this->getSessionLifetimeAttribute() => [
- 'ComparisonOperator' => 'LT',
- 'AttributeValueList' => [['N' => (string) time()]],
- ],
- 'lock' => [
- 'ComparisonOperator' => 'NULL',
- ]
- ],
- ]);
-
- // Create a WriteRequestBatch for deleting the expired items
- $batch = new WriteRequestBatch($this->client, $this->getBatchConfig());
-
- // Perform Scan and BatchWriteItem (delete) operations as needed
- foreach ($scan->search('Items') as $item) {
- $batch->delete(
- [$this->getHashKey() => $item[$this->getHashKey()]],
- $this->getTableName()
- );
- }
-
- // Delete any remaining items that were not auto-flushed
- $batch->flush();
- }
-
- /**
- * @param string $key
- *
- * @return array
- */
- protected function formatKey($key)
- {
- return [$this->getHashKey() => ['S' => $key]];
- }
-
- /**
- * @param string $error
- *
- * @return bool
- */
- protected function triggerError($error)
- {
- trigger_error($error, E_USER_WARNING);
-
- return false;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/WriteRequestBatch.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/WriteRequestBatch.php
deleted file mode 100644
index c5e5eaf3..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDb/WriteRequestBatch.php
+++ /dev/null
@@ -1,266 +0,0 @@
- null,
- 'batch_size' => 25,
- 'pool_size' => 1,
- 'autoflush' => true,
- 'before' => null,
- 'error' => null
- ];
-
- // Ensure the batch size is valid
- if ($config['batch_size'] > 25 || $config['batch_size'] < 2) {
- throw new \InvalidArgumentException('"batch_size" must be between 2 and 25.');
- }
-
- // Ensure the callbacks are valid
- if ($config['before'] && !is_callable($config['before'])) {
- throw new \InvalidArgumentException('"before" must be callable.');
- }
- if ($config['error'] && !is_callable($config['error'])) {
- throw new \InvalidArgumentException('"error" must be callable.');
- }
-
- // If autoflush is enabled, set the threshold
- if ($config['autoflush']) {
- $config['threshold'] = $config['batch_size'] * $config['pool_size'];
- }
-
- $this->client = $client;
- $this->config = $config;
- $this->queue = [];
- }
-
- /**
- * Adds a put item request to the batch.
- *
- * @param array $item Data for an item to put. Format:
- * [
- * 'attribute1' => ['type' => 'value'],
- * 'attribute2' => ['type' => 'value'],
- * ...
- * ]
- * @param string|null $table The name of the table. This must be specified
- * unless the "table" option was provided in the
- * config of the WriteRequestBatch.
- *
- * @return $this
- */
- public function put(array $item, $table = null)
- {
- $this->queue[] = [
- 'table' => $this->determineTable($table),
- 'data' => ['PutRequest' => ['Item' => $item]],
- ];
-
- $this->autoFlush();
-
- return $this;
- }
-
- /**
- * Adds a delete item request to the batch.
- *
- * @param array $key Key of an item to delete. Format:
- * [
- * 'key1' => ['type' => 'value'],
- * ...
- * ]
- * @param string|null $table The name of the table. This must be specified
- * unless the "table" option was provided in the
- * config of the WriteRequestBatch.
- *
- * @return $this
- */
- public function delete(array $key, $table = null)
- {
- $this->queue[] = [
- 'table' => $this->determineTable($table),
- 'data' => ['DeleteRequest' => ['Key' => $key]],
- ];
-
- $this->autoFlush();
-
- return $this;
- }
-
- /**
- * Flushes the batch by combining all the queued put and delete requests
- * into BatchWriteItem commands and executing them. Unprocessed items are
- * automatically re-queued.
- *
- * @param bool $untilEmpty If true, flushing will continue until the queue
- * is completely empty. This will make sure that
- * unprocessed items are all eventually sent.
- *
- * @return $this
- */
- public function flush($untilEmpty = true)
- {
- // Send BatchWriteItem requests until the queue is empty
- $keepFlushing = true;
- while ($this->queue && $keepFlushing) {
- $commands = $this->prepareCommands();
- $pool = new CommandPool($this->client, $commands, [
- 'before' => $this->config['before'],
- 'concurrency' => $this->config['pool_size'],
- 'fulfilled' => function (ResultInterface $result) {
- // Re-queue any unprocessed items
- if ($result->hasKey('UnprocessedItems')) {
- $this->retryUnprocessed($result['UnprocessedItems']);
- }
- },
- 'rejected' => function ($reason) {
- if ($reason instanceof AwsException) {
- $code = $reason->getAwsErrorCode();
- if ($code === 'ProvisionedThroughputExceededException') {
- $this->retryUnprocessed($reason->getCommand()['RequestItems']);
- } elseif (is_callable($this->config['error'])) {
- $this->config['error']($reason);
- }
- }
- }
- ]);
- $pool->promise()->wait();
- $keepFlushing = (bool) $untilEmpty;
- }
-
- return $this;
- }
-
- /**
- * Creates BatchWriteItem commands from the items in the queue.
- *
- * @return CommandInterface[]
- */
- private function prepareCommands()
- {
- // Chunk the queue into batches
- $batches = array_chunk($this->queue, $this->config['batch_size']);
- $this->queue = [];
-
- // Create BatchWriteItem commands for each batch
- $commands = [];
- foreach ($batches as $batch) {
- $requests = [];
- foreach ($batch as $item) {
- if (!isset($requests[$item['table']])) {
- $requests[$item['table']] = [];
- }
- $requests[$item['table']][] = $item['data'];
- }
- $commands[] = $this->client->getCommand(
- 'BatchWriteItem',
- ['RequestItems' => $requests]
- );
- }
-
- return $commands;
- }
-
- /**
- * Re-queues unprocessed results with the correct data.
- *
- * @param array $unprocessed Unprocessed items from a result.
- */
- private function retryUnprocessed(array $unprocessed)
- {
- foreach ($unprocessed as $table => $requests) {
- foreach ($requests as $request) {
- $this->queue[] = [
- 'table' => $table,
- 'data' => $request,
- ];
- }
- }
- }
-
- /**
- * If autoflush is enabled and the threshold is met, flush the batch
- */
- private function autoFlush()
- {
- if ($this->config['autoflush']
- && count($this->queue) >= $this->config['threshold']
- ) {
- // Flush only once. Unprocessed items are handled in a later flush.
- $this->flush(false);
- }
- }
-
- /**
- * Determine the table name by looking at what was provided and what the
- * WriteRequestBatch was originally configured with.
- *
- * @param string|null $table The table name.
- *
- * @return string
- * @throws \RuntimeException if there was no table specified.
- */
- private function determineTable($table)
- {
- $table = $table ?: $this->config['table'];
- if (!$table) {
- throw new \RuntimeException('There was no table specified.');
- }
-
- return $table;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDbStreams/DynamoDbStreamsClient.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDbStreams/DynamoDbStreamsClient.php
deleted file mode 100644
index 7c2cb422..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/DynamoDbStreams/DynamoDbStreamsClient.php
+++ /dev/null
@@ -1,29 +0,0 @@
-getHandlerList()->appendInit(
- PresignUrlMiddleware::wrap(
- $this,
- $args['endpoint_provider'],
- [
- 'operations' => [
- 'CopySnapshot',
- ],
- 'service' => 'ec2',
- 'presign_param' => 'PresignedUrl',
- ]
- ),
- 'ec2.copy_snapshot'
- );
- };
-
- parent::__construct($args);
- }
-
- /**
- * @internal
- * @codeCoverageIgnore
- */
- public static function applyDocFilters(array $api, array $docs)
- {
- // Several copy snapshot parameters are optional.
- $docs['shapes']['String']['refs']['CopySnapshotRequest$PresignedUrl']
- = '
- * // First try an INI file at this location.
- * $a = ConfigurationProvider::ini(null, '/path/to/file.ini');
- * // Then try an INI file at this location.
- * $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');
- * // Then try loading from environment variables.
- * $c = ConfigurationProvider::env();
- * // Combine the three providers together.
- * $composed = ConfigurationProvider::chain($a, $b, $c);
- * // Returns a promise that is fulfilled with a configuration or throws.
- * $promise = $composed();
- * // Wait on the configuration to resolve.
- * $config = $promise->wait();
- *
- */
-class ConfigurationProvider extends AbstractConfigurationProvider
- implements ConfigurationProviderInterface
-{
- const DEFAULT_ENABLED = false;
- const DEFAULT_CACHE_LIMIT = 1000;
- const ENV_ENABLED = 'AWS_ENDPOINT_DISCOVERY_ENABLED';
- const ENV_ENABLED_ALT = 'AWS_ENABLE_ENDPOINT_DISCOVERY';
- const ENV_PROFILE = 'AWS_PROFILE';
-
- public static $cacheKey = 'aws_cached_endpoint_discovery_config';
-
- protected static $interfaceClass = ConfigurationInterface::class;
- protected static $exceptionClass = ConfigurationException::class;
-
- /**
- * Create a default config provider that first checks for environment
- * variables, then checks for a specified profile in the environment-defined
- * config file location (env variable is 'AWS_CONFIG_FILE', file location
- * defaults to ~/.aws/config), then checks for the "default" profile in the
- * environment-defined config file location, and failing those uses a default
- * fallback set of configuration options.
- *
- * This provider is automatically wrapped in a memoize function that caches
- * previously provided config options.
- *
- * @param array $config
- *
- * @return callable
- */
- public static function defaultProvider(array $config = [])
- {
- $configProviders = [self::env()];
- if (
- !isset($config['use_aws_shared_config_files'])
- || $config['use_aws_shared_config_files'] != false
- ) {
- $configProviders[] = self::ini();
- }
- $configProviders[] = self::fallback($config);
-
- $memo = self::memoize(
- call_user_func_array('self::chain', $configProviders)
- );
-
- if (isset($config['endpoint_discovery'])
- && $config['endpoint_discovery'] instanceof CacheInterface
- ) {
- return self::cache($memo, $config['endpoint_discovery'], self::$cacheKey);
- }
-
- return $memo;
- }
-
- /**
- * Provider that creates config from environment variables.
- *
- * @param $cacheLimit
- * @return callable
- */
- public static function env($cacheLimit = self::DEFAULT_CACHE_LIMIT)
- {
- return function () use ($cacheLimit) {
- // Use config from environment variables, if available
- $enabled = getenv(self::ENV_ENABLED);
- if ($enabled === false || $enabled === '') {
- $enabled = getenv(self::ENV_ENABLED_ALT);
- }
- if ($enabled !== false && $enabled !== '') {
- return Promise\promise_for(
- new Configuration($enabled, $cacheLimit)
- );
- }
-
- return self::reject('Could not find environment variable config'
- . ' in ' . self::ENV_ENABLED);
- };
- }
-
- /**
- * Fallback config options when other sources are not set. Will check the
- * service model for any endpoint discovery required operations, and enable
- * endpoint discovery in that case. If no required operations found, will use
- * the class default values.
- *
- * @param array $config
- * @return callable
- */
- public static function fallback($config = [])
- {
- $enabled = self::DEFAULT_ENABLED;
- if (!empty($config['api_provider'])
- && !empty($config['service'])
- && !empty($config['version'])
- ) {
- $provider = $config['api_provider'];
- $apiData = $provider('api', $config['service'], $config['version']);
- if (!empty($apiData['operations'])) {
- foreach ($apiData['operations'] as $operation) {
- if (!empty($operation['endpointdiscovery']['required'])) {
- $enabled = true;
- }
- }
- }
- }
-
- return function () use ($enabled) {
- return Promise\promise_for(
- new Configuration(
- $enabled,
- self::DEFAULT_CACHE_LIMIT
- )
- );
- };
- }
-
- /**
- * Config provider that creates config using a config file whose location
- * is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to
- * ~/.aws/config if not specified
- *
- * @param string|null $profile Profile to use. If not specified will use
- * the "default" profile.
- * @param string|null $filename If provided, uses a custom filename rather
- * than looking in the default directory.
- * @param int $cacheLimit
- *
- * @return callable
- */
- public static function ini(
- $profile = null,
- $filename = null,
- $cacheLimit = self::DEFAULT_CACHE_LIMIT
- ) {
- $filename = $filename ?: (self::getDefaultConfigFilename());
- $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');
-
- return function () use ($profile, $filename, $cacheLimit) {
- if (!is_readable($filename)) {
- return self::reject("Cannot read configuration from $filename");
- }
- $data = \Aws\parse_ini_file($filename, true);
- if ($data === false) {
- return self::reject("Invalid config file: $filename");
- }
- if (!isset($data[$profile])) {
- return self::reject("'$profile' not found in config file");
- }
- if (!isset($data[$profile]['endpoint_discovery_enabled'])) {
- return self::reject("Required endpoint discovery config values
- not present in INI profile '{$profile}' ({$filename})");
- }
-
- return Promise\promise_for(
- new Configuration(
- $data[$profile]['endpoint_discovery_enabled'],
- $cacheLimit
- )
- );
- };
- }
-
- /**
- * Unwraps a configuration object in whatever valid form it is in,
- * always returning a ConfigurationInterface object.
- *
- * @param mixed $config
- * @return ConfigurationInterface
- * @throws \InvalidArgumentException
- */
- public static function unwrap($config)
- {
- if (is_callable($config)) {
- $config = $config();
- }
- if ($config instanceof PromiseInterface) {
- $config = $config->wait();
- }
- if ($config instanceof ConfigurationInterface) {
- return $config;
- } elseif (is_array($config) && isset($config['enabled'])) {
- if (isset($config['cache_limit'])) {
- return new Configuration(
- $config['enabled'],
- $config['cache_limit']
- );
- }
- return new Configuration(
- $config['enabled'],
- self::DEFAULT_CACHE_LIMIT
- );
- }
-
- throw new \InvalidArgumentException('Not a valid endpoint_discovery '
- . 'configuration argument.');
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/EndpointDiscoveryMiddleware.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/EndpointDiscoveryMiddleware.php
deleted file mode 100644
index c8cc1646..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/EndpointDiscoveryMiddleware.php
+++ /dev/null
@@ -1,420 +0,0 @@
-nextHandler = $handler;
- $this->client = $client;
- $this->args = $args;
- $this->service = $client->getApi();
- $this->config = $config;
- }
-
- public function __invoke(CommandInterface $cmd, RequestInterface $request)
- {
- $nextHandler = $this->nextHandler;
- $op = $this->service->getOperation($cmd->getName())->toArray();
-
- // Continue only if endpointdiscovery trait is set
- if (isset($op['endpointdiscovery'])) {
- $config = ConfigurationProvider::unwrap($this->config);
- $isRequired = !empty($op['endpointdiscovery']['required']);
-
- if ($isRequired && !($config->isEnabled())) {
- throw new UnresolvedEndpointException('This operation '
- . 'requires the use of endpoint discovery, but this has '
- . 'been disabled in the configuration. Enable endpoint '
- . 'discovery or use a different operation.');
- }
-
- // Continue only if enabled by config
- if ($config->isEnabled()) {
- if (isset($op['endpointoperation'])) {
- throw new UnresolvedEndpointException('This operation is '
- . 'contradictorily marked both as using endpoint discovery '
- . 'and being the endpoint discovery operation. Please '
- . 'verify the accuracy of your model files.');
- }
-
- // Original endpoint may be used if discovery optional
- $originalUri = $request->getUri();
-
- $identifiers = $this->getIdentifiers($op);
-
- $cacheKey = $this->getCacheKey(
- $this->client->getCredentials()->wait(),
- $cmd,
- $identifiers
- );
-
- // Check/create cache
- if (!isset(self::$cache)) {
- self::$cache = new LruArrayCache($config->getCacheLimit());
- }
-
- if (empty($endpointList = self::$cache->get($cacheKey))) {
- $endpointList = new EndpointList([]);
- }
- $endpoint = $endpointList->getActive();
-
- // Retrieve endpoints if there is no active endpoint
- if (empty($endpoint)) {
- try {
- $endpoint = $this->discoverEndpoint(
- $cacheKey,
- $cmd,
- $identifiers
- );
- } catch (\Exception $e) {
- // Use cached endpoint, expired or active, if any remain
- $endpoint = $endpointList->getEndpoint();
-
- if (empty($endpoint)) {
- return $this->handleDiscoveryException(
- $isRequired,
- $originalUri,
- $e,
- $cmd,
- $request
- );
- }
- }
- }
-
- $request = $this->modifyRequest($request, $endpoint);
-
- $g = function ($value) use (
- $cacheKey,
- $cmd,
- $identifiers,
- $isRequired,
- $originalUri,
- $request,
- &$endpoint,
- &$g
- ) {
- if ($value instanceof AwsException
- && (
- $value->getAwsErrorCode() == 'InvalidEndpointException'
- || $value->getStatusCode() == 421
- )
- ) {
- return $this->handleInvalidEndpoint(
- $cacheKey,
- $cmd,
- $identifiers,
- $isRequired,
- $originalUri,
- $request,
- $value,
- $endpoint,
- $g
- );
- }
-
- return $value;
- };
-
- return $nextHandler($cmd, $request)->otherwise($g);
- }
- }
-
- return $nextHandler($cmd, $request);
- }
-
- private function discoverEndpoint(
- $cacheKey,
- CommandInterface $cmd,
- array $identifiers
- ) {
- $discCmd = $this->getDiscoveryCommand($cmd, $identifiers);
- $this->discoveryTimes[$cacheKey] = time();
- $result = $this->client->execute($discCmd);
-
- if (isset($result['Endpoints'])) {
- $endpointData = [];
- foreach ($result['Endpoints'] as $datum) {
- $endpointData[$datum['Address']] = time()
- + ($datum['CachePeriodInMinutes'] * 60);
- }
- $endpointList = new EndpointList($endpointData);
- self::$cache->set($cacheKey, $endpointList);
- return $endpointList->getEndpoint();
- }
-
- throw new UnresolvedEndpointException('The endpoint discovery operation '
- . 'yielded a response that did not contain properly formatted '
- . 'endpoint data.');
- }
-
- private function getCacheKey(
- CredentialsInterface $creds,
- CommandInterface $cmd,
- array $identifiers
- ) {
- $key = $this->service->getServiceName() . '_' . $creds->getAccessKeyId();
- if (!empty($identifiers)) {
- $key .= '_' . $cmd->getName();
- foreach ($identifiers as $identifier) {
- $key .= "_{$cmd[$identifier]}";
- }
- }
-
- return $key;
- }
-
- private function getDiscoveryCommand(
- CommandInterface $cmd,
- array $identifiers
- ) {
- foreach ($this->service->getOperations() as $op) {
- if (isset($op['endpointoperation'])) {
- $endpointOperation = $op->toArray()['name'];
- break;
- }
- }
-
- if (!isset($endpointOperation)) {
- throw new UnresolvedEndpointException('This command is set to use '
- . 'endpoint discovery, but no endpoint discovery operation was '
- . 'found. Please verify the accuracy of your model files.');
- }
-
- $params = [];
- if (!empty($identifiers)) {
- $params['Operation'] = $cmd->getName();
- $params['Identifiers'] = [];
- foreach ($identifiers as $identifier) {
- $params['Identifiers'][$identifier] = $cmd[$identifier];
- }
- }
- $command = $this->client->getCommand($endpointOperation, $params);
- $command->getHandlerList()->appendBuild(
- Middleware::mapRequest(function (RequestInterface $r) {
- return $r->withHeader(
- 'x-amz-api-version',
- $this->service->getApiVersion()
- );
- }),
- 'x-amz-api-version-header'
- );
-
- return $command;
- }
-
- private function getIdentifiers(array $operation)
- {
- $inputShape = $this->service->getShapeMap()
- ->resolve($operation['input'])
- ->toArray();
- $identifiers = [];
- foreach ($inputShape['members'] as $key => $member) {
- if (!empty($member['endpointdiscoveryid'])) {
- $identifiers[] = $key;
- }
- }
- return $identifiers;
- }
-
- private function handleDiscoveryException(
- $isRequired,
- $originalUri,
- \Exception $e,
- CommandInterface $cmd,
- RequestInterface $request
- ) {
- // If no cached endpoints and discovery required,
- // throw exception
- if ($isRequired) {
- $message = 'The endpoint required for this service is currently '
- . 'unable to be retrieved, and your request can not be fulfilled '
- . 'unless you manually specify an endpoint.';
- throw new AwsException(
- $message,
- $cmd,
- [
- 'code' => 'EndpointDiscoveryException',
- 'message' => $message
- ],
- $e
- );
- }
-
- // If discovery isn't required, use original endpoint
- return $this->useOriginalUri(
- $originalUri,
- $cmd,
- $request
- );
- }
-
- private function handleInvalidEndpoint(
- $cacheKey,
- $cmd,
- $identifiers,
- $isRequired,
- $originalUri,
- $request,
- $value,
- &$endpoint,
- &$g
- ) {
- $nextHandler = $this->nextHandler;
- $endpointList = self::$cache->get($cacheKey);
- if ($endpointList instanceof EndpointList) {
-
- // Remove invalid endpoint from cached list
- $endpointList->remove($endpoint);
-
- // If possible, get another cached endpoint
- $newEndpoint = $endpointList->getEndpoint();
- }
- if (empty($newEndpoint)) {
-
- // If no more cached endpoints, make discovery call
- // if none made within cooldown for given key
- if (time() - $this->discoveryTimes[$cacheKey]
- < self::$discoveryCooldown
- ) {
-
- // If no more cached endpoints and it's required,
- // fail with original exception
- if ($isRequired) {
- return $value;
- }
-
- // Use original endpoint if not required
- return $this->useOriginalUri(
- $originalUri,
- $cmd,
- $request
- );
- }
-
- $newEndpoint = $this->discoverEndpoint(
- $cacheKey,
- $cmd,
- $identifiers
- );
- }
- $endpoint = $newEndpoint;
- $request = $this->modifyRequest($request, $endpoint);
- return $nextHandler($cmd, $request)->otherwise($g);
- }
-
- private function modifyRequest(RequestInterface $request, $endpoint)
- {
- $parsed = $this->parseEndpoint($endpoint);
- if (!empty($request->getHeader('User-Agent'))) {
- $userAgent = $request->getHeader('User-Agent')[0];
- if (strpos($userAgent, 'endpoint-discovery') === false) {
- $userAgent = $userAgent . ' endpoint-discovery';
- }
- } else {
- $userAgent = 'endpoint-discovery';
- }
-
- return $request
- ->withUri(
- $request->getUri()
- ->withHost($parsed['host'])
- ->withPath($parsed['path'])
- )
- ->withHeader('User-Agent', $userAgent);
- }
-
- /**
- * Parses an endpoint returned from the discovery API into an array with
- * 'host' and 'path' keys.
- *
- * @param $endpoint
- * @return array
- */
- private function parseEndpoint($endpoint)
- {
- $parsed = parse_url($endpoint);
-
- // parse_url() will correctly parse full URIs with schemes
- if (isset($parsed['host'])) {
- return $parsed;
- }
-
- // parse_url() will put host & path in 'path' if scheme is not provided
- if (isset($parsed['path'])) {
- $split = explode('/', $parsed['path'], 2);
- $parsed['host'] = $split[0];
- if (isset($split[1])) {
- $parsed['path'] = $split[1];
- } else {
- $parsed['path'] = '';
- }
- return $parsed;
- }
-
- throw new UnresolvedEndpointException("The supplied endpoint '"
- . "{$endpoint}' is invalid.");
- }
-
- private function useOriginalUri(
- UriInterface $uri,
- CommandInterface $cmd,
- RequestInterface $request
- ) {
- $nextHandler = $this->nextHandler;
- $endpoint = $uri->getHost() . $uri->getPath();
- $request = $this->modifyRequest(
- $request,
- $endpoint
- );
- return $nextHandler($cmd, $request);
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/EndpointList.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/EndpointList.php
deleted file mode 100644
index 80ccc472..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/EndpointList.php
+++ /dev/null
@@ -1,85 +0,0 @@
-active = $endpoints;
- reset($this->active);
- }
-
- /**
- * Gets an active (unexpired) endpoint. Returns null if none found.
- *
- * @return null|string
- */
- public function getActive()
- {
- if (count($this->active) < 1) {
- return null;
- }
- while (time() > current($this->active)) {
- $key = key($this->active);
- $this->expired[$key] = current($this->active);
- $this->increment($this->active);
- unset($this->active[$key]);
- if (count($this->active) < 1) {
- return null;
- }
- }
- $active = key($this->active);
- $this->increment($this->active);
- return $active;
- }
-
- /**
- * Gets an active endpoint if possible, then an expired endpoint if possible.
- * Returns null if no endpoints found.
- *
- * @return null|string
- */
- public function getEndpoint()
- {
- if (!empty($active = $this->getActive())) {
- return $active;
- }
- return $this->getExpired();
- }
-
- /**
- * Removes an endpoint from both lists.
- *
- * @param string $key
- */
- public function remove($key)
- {
- unset($this->active[$key]);
- unset($this->expired[$key]);
- }
-
- /**
- * Get an expired endpoint. Returns null if none found.
- *
- * @return null|string
- */
- private function getExpired()
- {
- if (count($this->expired) < 1) {
- return null;
- }
- $expired = key($this->expired);
- $this->increment($this->expired);
- return $expired;
- }
-
- private function increment(&$array)
- {
- if (next($array) === false) {
- reset($array);
- }
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/Exception/ConfigurationException.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/Exception/ConfigurationException.php
deleted file mode 100644
index f87cdbfa..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EndpointDiscovery/Exception/ConfigurationException.php
+++ /dev/null
@@ -1,14 +0,0 @@
-nextHandler = $nextHandler;
- $this->service = $service;
- }
-
- public function __invoke(CommandInterface $command, RequestInterface $request)
- {
- $nextHandler = $this->nextHandler;
-
- $operation = $this->service->getOperation($command->getName());
-
- if (!empty($operation['endpoint']['hostPrefix'])) {
- $prefix = $operation['endpoint']['hostPrefix'];
-
- // Captures endpoint parameters stored in the modeled host.
- // These are denoted by enclosure in braces, i.e. '{param}'
- preg_match_all("/\{([a-zA-Z0-9]+)}/", $prefix, $parameters);
-
- if (!empty($parameters[1])) {
-
- // Captured parameters without braces stored in $parameters[1],
- // which should correspond to members in the Command object
- foreach ($parameters[1] as $index => $parameter) {
- if (empty($command[$parameter])) {
- throw new \InvalidArgumentException(
- "The parameter '{$parameter}' must be set and not empty."
- );
- }
-
- // Captured parameters with braces stored in $parameters[0],
- // which are replaced by their corresponding Command value
- $prefix = str_replace(
- $parameters[0][$index],
- $command[$parameter],
- $prefix
- );
- }
- }
-
- $uri = $request->getUri();
- $host = $prefix . $uri->getHost();
- if (!\Aws\is_valid_hostname($host)) {
- throw new \InvalidArgumentException(
- "The supplied parameters result in an invalid hostname: '{$host}'."
- );
- }
- $request = $request->withUri($uri->withHost($host));
- }
-
- return $nextHandler($command, $request);
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EventBridge/EventBridgeClient.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EventBridge/EventBridgeClient.php
deleted file mode 100644
index 91a382b6..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/EventBridge/EventBridgeClient.php
+++ /dev/null
@@ -1,89 +0,0 @@
-data = isset($context['body']) ? $context['body'] : [];
- $this->command = $command;
- $this->response = isset($context['response']) ? $context['response'] : null;
- $this->request = isset($context['request']) ? $context['request'] : null;
- $this->requestId = isset($context['request_id'])
- ? $context['request_id']
- : null;
- $this->errorType = isset($context['type']) ? $context['type'] : null;
- $this->errorCode = isset($context['code']) ? $context['code'] : null;
- $this->errorShape = isset($context['error_shape']) ? $context['error_shape'] : null;
- $this->connectionError = !empty($context['connection_error']);
- $this->result = isset($context['result']) ? $context['result'] : null;
- $this->transferInfo = isset($context['transfer_stats'])
- ? $context['transfer_stats']
- : [];
- $this->errorMessage = isset($context['message'])
- ? $context['message']
- : null;
- $this->monitoringEvents = [];
- $this->maxRetriesExceeded = false;
- parent::__construct($message, 0, $previous);
- }
-
- public function __toString()
- {
- if (!$this->getPrevious()) {
- return parent::__toString();
- }
-
- // PHP strangely shows the innermost exception first before the outer
- // exception message. It also has a default character limit for
- // exception message strings such that the "next" exception (this one)
- // might not even get shown, causing developers to attempt to catch
- // the inner exception instead of the actual exception because they
- // can't see the outer exception's __toString output.
- return sprintf(
- "exception '%s' with message '%s'\n\n%s",
- get_class($this),
- $this->getMessage(),
- parent::__toString()
- );
- }
-
- /**
- * Get the command that was executed.
- *
- * @return CommandInterface
- */
- public function getCommand()
- {
- return $this->command;
- }
-
- /**
- * Get the concise error message if any.
- *
- * @return string|null
- */
- public function getAwsErrorMessage()
- {
- return $this->errorMessage;
- }
-
- /**
- * Get the sent HTTP request if any.
- *
- * @return RequestInterface|null
- */
- public function getRequest()
- {
- return $this->request;
- }
-
- /**
- * Get the received HTTP response if any.
- *
- * @return ResponseInterface|null
- */
- public function getResponse()
- {
- return $this->response;
- }
-
- /**
- * Get the result of the exception if available
- *
- * @return ResultInterface|null
- */
- public function getResult()
- {
- return $this->result;
- }
-
- /**
- * Returns true if this is a connection error.
- *
- * @return bool
- */
- public function isConnectionError()
- {
- return $this->connectionError;
- }
-
- /**
- * If available, gets the HTTP status code of the corresponding response
- *
- * @return int|null
- */
- public function getStatusCode()
- {
- return $this->response ? $this->response->getStatusCode() : null;
- }
-
- /**
- * Get the request ID of the error. This value is only present if a
- * response was received and is not present in the event of a networking
- * error.
- *
- * @return string|null Returns null if no response was received
- */
- public function getAwsRequestId()
- {
- return $this->requestId;
- }
-
- /**
- * Get the AWS error type.
- *
- * @return string|null Returns null if no response was received
- */
- public function getAwsErrorType()
- {
- return $this->errorType;
- }
-
- /**
- * Get the AWS error code.
- *
- * @return string|null Returns null if no response was received
- */
- public function getAwsErrorCode()
- {
- return $this->errorCode;
- }
-
- /**
- * Get the AWS error shape.
- *
- * @return Shape|null Returns null if no response was received
- */
- public function getAwsErrorShape()
- {
- return $this->errorShape;
- }
-
- /**
- * Get all transfer information as an associative array if no $name
- * argument is supplied, or gets a specific transfer statistic if
- * a $name attribute is supplied (e.g., 'retries_attempted').
- *
- * @param string $name Name of the transfer stat to retrieve
- *
- * @return mixed|null|array
- */
- public function getTransferInfo($name = null)
- {
- if (!$name) {
- return $this->transferInfo;
- }
-
- return isset($this->transferInfo[$name])
- ? $this->transferInfo[$name]
- : null;
- }
-
- /**
- * Replace the transfer information associated with an exception.
- *
- * @param array $info
- */
- public function setTransferInfo(array $info)
- {
- $this->transferInfo = $info;
- }
-
- /**
- * Returns whether the max number of retries is exceeded.
- *
- * @return bool
- */
- public function isMaxRetriesExceeded()
- {
- return $this->maxRetriesExceeded;
- }
-
- /**
- * Sets the flag for max number of retries exceeded.
- */
- public function setMaxRetriesExceeded()
- {
- $this->maxRetriesExceeded = true;
- }
-
- public function hasKey($name)
- {
- return isset($this->data[$name]);
- }
-
- public function get($key)
- {
- return $this[$key];
- }
-
- public function search($expression)
- {
- return JmesPath::search($expression, $this->toArray());
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/CouldNotCreateChecksumException.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/CouldNotCreateChecksumException.php
deleted file mode 100644
index 5c5f80ef..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/CouldNotCreateChecksumException.php
+++ /dev/null
@@ -1,25 +0,0 @@
-errorCode = $code;
- $this->errorMessage = $message;
- parent::__construct($message);
- }
-
- /**
- * Get the AWS error code.
- *
- * @return string|null Returns null if no response was received
- */
- public function getAwsErrorCode()
- {
- return $this->errorCode;
- }
-
- /**
- * Get the concise error message if any.
- *
- * @return string|null
- */
- public function getAwsErrorMessage()
- {
- return $this->errorMessage;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/IncalculablePayloadException.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/IncalculablePayloadException.php
deleted file mode 100644
index a64e7428..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/IncalculablePayloadException.php
+++ /dev/null
@@ -1,11 +0,0 @@
- 'uploading parts to']);
- $msg .= ". The following parts had errors:\n";
- /** @var $error AwsException */
- foreach ($prev as $part => $error) {
- $msg .= "- Part {$part}: " . $error->getMessage(). "\n";
- }
- } elseif ($prev instanceof AwsException) {
- switch ($prev->getCommand()->getName()) {
- case 'CreateMultipartUpload':
- case 'InitiateMultipartUpload':
- $action = 'initiating';
- break;
- case 'CompleteMultipartUpload':
- $action = 'completing';
- break;
- }
- if (isset($action)) {
- $msg = strtr($msg, ['performing' => $action]);
- }
- $msg .= ": {$prev->getMessage()}";
- }
-
- if (!$prev instanceof \Exception) {
- $prev = null;
- }
-
- parent::__construct($msg, 0, $prev);
- $this->state = $state;
- }
-
- /**
- * Get the state of the transfer
- *
- * @return UploadState
- */
- public function getState()
- {
- return $this->state;
- }
-}
diff --git a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/UnresolvedApiException.php b/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/UnresolvedApiException.php
deleted file mode 100644
index e204571b..00000000
--- a/vendor/composer/50af3e3c/aws-aws-sdk-php-539d523/src/Exception/UnresolvedApiException.php
+++ /dev/null
@@ -1,11 +0,0 @@
-getHandlerList();
- $stack->appendBuild($this->getApiVersionMiddleware(), 'glacier.api_version');
- $stack->appendBuild($this->getChecksumsMiddleware(), 'glacier.checksum');
- $stack->appendBuild(
- Middleware::contentType(['UploadArchive', 'UploadPart']),
- 'glacier.content_type'
- );
- $stack->appendInit(
- Middleware::sourceFile($this->getApi(), 'body', 'sourceFile'),
- 'glacier.source_file'
- );
- }
-
- /**
- * {@inheritdoc}
- *
- * Sets the default accountId to "-" for all operations.
- */
- public function getCommand($name, array $args = [])
- {
- return parent::getCommand($name, $args + ['accountId' => '-']);
- }
-
- /**
- * Creates a middleware that updates a command with the content and tree
- * hash headers for upload operations.
- *
- * @return callable
- * @throws CouldNotCreateChecksumException if the body is not seekable.
- */
- private function getChecksumsMiddleware()
- {
- return function (callable $handler) {
- return function (
- CommandInterface $command,
- RequestInterface $request = null
- ) use ($handler) {
- // Accept "ContentSHA256" with a lowercase "c" to match other Glacier params.
- if (!$command['ContentSHA256'] && $command['contentSHA256']) {
- $command['ContentSHA256'] = $command['contentSHA256'];
- unset($command['contentSHA256']);
- }
-
- // If uploading, then make sure checksums are added.
- $name = $command->getName();
- if (($name === 'UploadArchive' || $name === 'UploadMultipartPart')
- && (!$command['checksum'] || !$command['ContentSHA256'])
- ) {
- $body = $request->getBody();
- if (!$body->isSeekable()) {
- throw new CouldNotCreateChecksumException('sha256');
- }
-
- // Add a tree hash if not provided.
- if (!$command['checksum']) {
- $body = new HashingStream(
- $body, new TreeHash(),
- function ($result) use (&$request) {
- $request = $request->withHeader(
- 'x-amz-sha256-tree-hash',
- bin2hex($result)
- );
- }
- );
- }
-
- // Add a linear content hash if not provided.
- if (!$command['ContentSHA256']) {
- $body = new HashingStream(
- $body, new PhpHash('sha256'),
- function ($result) use ($command) {
- $command['ContentSHA256'] = bin2hex($result);
- }
- );
- }
-
- // Read the stream in order to calculate the hashes.
- while (!$body->eof()) {
- $body->read(1048576);
- }
- $body->seek(0);
- }
-
- // Set the content hash header if a value is in the command.
- if ($command['ContentSHA256']) {
- $request = $request->withHeader(
- 'x-amz-content-sha256',
- $command['ContentSHA256']
- );
- }
-
- return $handler($command, $request);
- };
- };
- }
-
- /**
- * Creates a middleware that adds the API version header for all requests.
- *
- * @return callable
- */
- private function getApiVersionMiddleware()
- {
- return function (callable $handler) {
- return function (
- CommandInterface $command,
- RequestInterface $request = null
- ) use ($handler) {
- return $handler($command, $request->withHeader(
- 'x-amz-glacier-version',
- $this->getApi()->getMetadata('apiVersion')
- ));
- };
- };
- }
-
- /**
- * @internal
- * @codeCoverageIgnore
- */
- public static function applyDocFilters(array $api, array $docs)
- {
- // Add the SourceFile parameter.
- $docs['shapes']['SourceFile']['base'] = 'The path to a file on disk to use instead of the body parameter.';
- $api['shapes']['SourceFile'] = ['type' => 'string'];
- $api['shapes']['UploadArchiveInput']['members']['sourceFile'] = ['shape' => 'SourceFile'];
- $api['shapes']['UploadMultipartPartInput']['members']['sourceFile'] = ['shape' => 'SourceFile'];
-
- // Add the ContentSHA256 parameter.
- $docs['shapes']['ContentSHA256']['base'] = 'A SHA256 hash of the content of the request body';
- $api['shapes']['ContentSHA256'] = ['type' => 'string'];
- $api['shapes']['UploadArchiveInput']['members']['contentSHA256'] = ['shape' => 'ContentSHA256'];
- $api['shapes']['UploadMultipartPartInput']['members']['contentSHA256'] = ['shape' => 'ContentSHA256'];
-
- // Add information about "checksum" and "ContentSHA256" being optional.
- $optional = '