diff options
author | Andrew Dolgov <[email protected]> | 2022-11-23 21:14:33 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-11-23 21:14:33 +0300 |
commit | 0c8af4992cb0f7589dcafaad65ada12753c64594 (patch) | |
tree | 18e83d068c3e7dd2499331de977782b382279396 /vendor/aws/aws-sdk-php/src/CognitoIdentity |
initial
Diffstat (limited to 'vendor/aws/aws-sdk-php/src/CognitoIdentity')
3 files changed, 126 insertions, 0 deletions
diff --git a/vendor/aws/aws-sdk-php/src/CognitoIdentity/CognitoIdentityClient.php b/vendor/aws/aws-sdk-php/src/CognitoIdentity/CognitoIdentityClient.php new file mode 100644 index 0000000..e9f89cc --- /dev/null +++ b/vendor/aws/aws-sdk-php/src/CognitoIdentity/CognitoIdentityClient.php @@ -0,0 +1,56 @@ +<?php +namespace Aws\CognitoIdentity; + +use Aws\AwsClient; + +/** + * This client is used to interact with the **Amazon Cognito Identity** service. + * + * @method \Aws\Result createIdentityPool(array $args = []) + * @method \GuzzleHttp\Promise\Promise createIdentityPoolAsync(array $args = []) + * @method \Aws\Result deleteIdentities(array $args = []) + * @method \GuzzleHttp\Promise\Promise deleteIdentitiesAsync(array $args = []) + * @method \Aws\Result deleteIdentityPool(array $args = []) + * @method \GuzzleHttp\Promise\Promise deleteIdentityPoolAsync(array $args = []) + * @method \Aws\Result describeIdentity(array $args = []) + * @method \GuzzleHttp\Promise\Promise describeIdentityAsync(array $args = []) + * @method \Aws\Result describeIdentityPool(array $args = []) + * @method \GuzzleHttp\Promise\Promise describeIdentityPoolAsync(array $args = []) + * @method \Aws\Result getCredentialsForIdentity(array $args = []) + * @method \GuzzleHttp\Promise\Promise getCredentialsForIdentityAsync(array $args = []) + * @method \Aws\Result getId(array $args = []) + * @method \GuzzleHttp\Promise\Promise getIdAsync(array $args = []) + * @method \Aws\Result getIdentityPoolRoles(array $args = []) + * @method \GuzzleHttp\Promise\Promise getIdentityPoolRolesAsync(array $args = []) + * @method \Aws\Result getOpenIdToken(array $args = []) + * @method \GuzzleHttp\Promise\Promise getOpenIdTokenAsync(array $args = []) + * @method \Aws\Result getOpenIdTokenForDeveloperIdentity(array $args = []) + * @method \GuzzleHttp\Promise\Promise getOpenIdTokenForDeveloperIdentityAsync(array $args = []) + * @method \Aws\Result getPrincipalTagAttributeMap(array $args = []) + * @method \GuzzleHttp\Promise\Promise getPrincipalTagAttributeMapAsync(array $args = []) + * @method \Aws\Result listIdentities(array $args = []) + * @method \GuzzleHttp\Promise\Promise listIdentitiesAsync(array $args = []) + * @method \Aws\Result listIdentityPools(array $args = []) + * @method \GuzzleHttp\Promise\Promise listIdentityPoolsAsync(array $args = []) + * @method \Aws\Result listTagsForResource(array $args = []) + * @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) + * @method \Aws\Result lookupDeveloperIdentity(array $args = []) + * @method \GuzzleHttp\Promise\Promise lookupDeveloperIdentityAsync(array $args = []) + * @method \Aws\Result mergeDeveloperIdentities(array $args = []) + * @method \GuzzleHttp\Promise\Promise mergeDeveloperIdentitiesAsync(array $args = []) + * @method \Aws\Result setIdentityPoolRoles(array $args = []) + * @method \GuzzleHttp\Promise\Promise setIdentityPoolRolesAsync(array $args = []) + * @method \Aws\Result setPrincipalTagAttributeMap(array $args = []) + * @method \GuzzleHttp\Promise\Promise setPrincipalTagAttributeMapAsync(array $args = []) + * @method \Aws\Result tagResource(array $args = []) + * @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) + * @method \Aws\Result unlinkDeveloperIdentity(array $args = []) + * @method \GuzzleHttp\Promise\Promise unlinkDeveloperIdentityAsync(array $args = []) + * @method \Aws\Result unlinkIdentity(array $args = []) + * @method \GuzzleHttp\Promise\Promise unlinkIdentityAsync(array $args = []) + * @method \Aws\Result untagResource(array $args = []) + * @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) + * @method \Aws\Result updateIdentityPool(array $args = []) + * @method \GuzzleHttp\Promise\Promise updateIdentityPoolAsync(array $args = []) + */ +class CognitoIdentityClient extends AwsClient {} diff --git a/vendor/aws/aws-sdk-php/src/CognitoIdentity/CognitoIdentityProvider.php b/vendor/aws/aws-sdk-php/src/CognitoIdentity/CognitoIdentityProvider.php new file mode 100644 index 0000000..6284847 --- /dev/null +++ b/vendor/aws/aws-sdk-php/src/CognitoIdentity/CognitoIdentityProvider.php @@ -0,0 +1,61 @@ +<?php +namespace Aws\CognitoIdentity; + +use Aws\Credentials\Credentials; +use GuzzleHttp\Promise; + +class CognitoIdentityProvider +{ + /** @var CognitoIdentityClient */ + private $client; + /** @var string */ + private $identityPoolId; + /** @var string|null */ + private $accountId; + /** @var array */ + private $logins; + + public function __construct( + $poolId, + array $clientOptions, + array $logins = [], + $accountId = null + ) { + $this->identityPoolId = $poolId; + $this->logins = $logins; + $this->accountId = $accountId; + $this->client = new CognitoIdentityClient($clientOptions + [ + 'credentials' => false, + ]); + } + + public function __invoke() + { + return Promise\Coroutine::of(function () { + $params = $this->logins ? ['Logins' => $this->logins] : []; + $getIdParams = $params + ['IdentityPoolId' => $this->identityPoolId]; + if ($this->accountId) { + $getIdParams['AccountId'] = $this->accountId; + } + + $id = (yield $this->client->getId($getIdParams)); + $result = (yield $this->client->getCredentialsForIdentity([ + 'IdentityId' => $id['IdentityId'], + ] + $params)); + + yield new Credentials( + $result['Credentials']['AccessKeyId'], + $result['Credentials']['SecretKey'], + $result['Credentials']['SessionToken'], + (int) $result['Credentials']['Expiration']->format('U') + ); + }); + } + + public function updateLogin($key, $value) + { + $this->logins[$key] = $value; + + return $this; + } +} diff --git a/vendor/aws/aws-sdk-php/src/CognitoIdentity/Exception/CognitoIdentityException.php b/vendor/aws/aws-sdk-php/src/CognitoIdentity/Exception/CognitoIdentityException.php new file mode 100644 index 0000000..4d58f72 --- /dev/null +++ b/vendor/aws/aws-sdk-php/src/CognitoIdentity/Exception/CognitoIdentityException.php @@ -0,0 +1,9 @@ +<?php +namespace Aws\CognitoIdentity\Exception; + +use Aws\Exception\AwsException; + +/** + * Represents an error interacting with the Amazon Cognito Identity Logs service. + */ +class CognitoIdentityException extends AwsException {} |