RefreshableInstanceProfileCredentials
extends AbstractRefreshableCredentials
in package
Credentials decorator used to implement retrieving credentials from the EC2 metadata server
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructs a new instance profile credentials decorator
- getAccessKeyId() : string
- Returns the AWS access key ID for this credentials object.
- getCredentials() : Credentials
- Get the underlying credentials, refreshing if necessary.
- getExpiration() : int|null
- Get the UNIX timestamp in which the credentials will expire
- getSecretKey() : string
- Returns the AWS secret access key for this credentials object.
- getSecurityToken() : string|null
- Get the associated security token if available
- isExpired() : bool
- Check if the credentials are expired
- serialize() : mixed
- {@inheritdoc}
- setAccessKeyId() : self
- Set the AWS access key ID for this credentials object.
- setClient() : mixed
- setExpiration() : self
- Set the UNIX timestamp in which the credentials will expire
- setSecretKey() : CredentialsInterface
- Set the AWS secret access key for this credentials object.
- setSecurityToken() : self
- Set the security token to use with this credentials object
- unserialize() : mixed
- {@inheritdoc}
- refresh() : mixed
- Attempt to get new credentials from the instance profile
Properties
$client
protected
InstanceMetadataClient
$client
$credentials
protected
CredentialsInterface
$credentials
Wrapped credentials object
$customClient
private
bool
$customClient
Methods
__construct()
Constructs a new instance profile credentials decorator
public
__construct(CredentialsInterface $credentials[, InstanceMetadataClient $client = null ]) : mixed
Parameters
- $credentials : CredentialsInterface
-
Credentials to adapt
- $client : InstanceMetadataClient = null
-
Client used to get new credentials
getAccessKeyId()
Returns the AWS access key ID for this credentials object.
public
getAccessKeyId() : string
Return values
stringgetCredentials()
Get the underlying credentials, refreshing if necessary.
public
getCredentials() : Credentials
Return values
CredentialsgetExpiration()
Get the UNIX timestamp in which the credentials will expire
public
getExpiration() : int|null
Return values
int|nullgetSecretKey()
Returns the AWS secret access key for this credentials object.
public
getSecretKey() : string
Return values
stringgetSecurityToken()
Get the associated security token if available
public
getSecurityToken() : string|null
Return values
string|nullisExpired()
Check if the credentials are expired
public
isExpired() : bool
Return values
boolserialize()
{@inheritdoc}
public
serialize() : mixed
setAccessKeyId()
Set the AWS access key ID for this credentials object.
public
setAccessKeyId(mixed $key) : self
Parameters
- $key : mixed
-
AWS access key ID
Return values
selfsetClient()
public
setClient([InstanceMetadataClient $client = null ]) : mixed
Parameters
- $client : InstanceMetadataClient = null
setExpiration()
Set the UNIX timestamp in which the credentials will expire
public
setExpiration(mixed $timestamp) : self
Parameters
- $timestamp : mixed
-
UNIX timestamp expiration
Return values
selfsetSecretKey()
Set the AWS secret access key for this credentials object.
public
setSecretKey(mixed $secret) : CredentialsInterface
Parameters
- $secret : mixed
-
AWS secret access key
Return values
CredentialsInterfacesetSecurityToken()
Set the security token to use with this credentials object
public
setSecurityToken(mixed $token) : self
Parameters
- $token : mixed
-
Security token
Return values
selfunserialize()
{@inheritdoc}
public
unserialize(mixed $value) : mixed
Parameters
- $value : mixed
refresh()
Attempt to get new credentials from the instance profile
protected
refresh() : mixed