/usr/share/php/Aws/Sts/StsClient.php is in php-aws-sdk 3.15.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | <?php
namespace Aws\Sts;
use Aws\AwsClient;
use Aws\Result;
use Aws\Credentials\Credentials;
/**
* This client is used to interact with the **AWS Security Token Service (AWS STS)**.
*
* @method \Aws\Result assumeRole(array $args = [])
* @method \GuzzleHttp\Promise\Promise assumeRoleAsync(array $args = [])
* @method \Aws\Result assumeRoleWithSAML(array $args = [])
* @method \GuzzleHttp\Promise\Promise assumeRoleWithSAMLAsync(array $args = [])
* @method \Aws\Result assumeRoleWithWebIdentity(array $args = [])
* @method \GuzzleHttp\Promise\Promise assumeRoleWithWebIdentityAsync(array $args = [])
* @method \Aws\Result decodeAuthorizationMessage(array $args = [])
* @method \GuzzleHttp\Promise\Promise decodeAuthorizationMessageAsync(array $args = [])
* @method \Aws\Result getFederationToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFederationTokenAsync(array $args = [])
* @method \Aws\Result getSessionToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSessionTokenAsync(array $args = [])
*/
class StsClient extends AwsClient
{
/**
* Creates credentials from the result of an STS operations
*
* @param Result $result Result of an STS operation
*
* @return Credentials
* @throws \InvalidArgumentException if the result contains no credentials
*/
public function createCredentials(Result $result)
{
if (!$result->hasKey('Credentials')) {
throw new \InvalidArgumentException('Result contains no credentials');
}
$c = $result['Credentials'];
return new Credentials(
$c['AccessKeyId'],
$c['SecretAccessKey'],
isset($c['SessionToken']) ? $c['SessionToken'] : null,
isset($c['Expiration']) && $c['Expiration'] instanceof \DateTimeInterface
? (int) $c['Expiration']->format('U')
: null
);
}
}
|