InstanceProvider
in package
implements
CredentialProvider
FinalYes
Provides Credentials from the running EC2 metadata server using the IMDSv1 and IMDSv2.
Tags
Table of Contents
Interfaces
- CredentialProvider
- Interface for providing Credential.
Constants
- METADATA_ENDPOINT = 'http://169.254.169.254/latest/meta-data/iam/security-credentials'
- TOKEN_ENDPOINT = 'http://169.254.169.254/latest/api/token'
Properties
- $httpClient : HttpClientInterface
- $logger : LoggerInterface
- $timeout : float
- $tokenTtl : int
Methods
- __construct() : mixed
- getCredentials() : Credentials|null
- Return a Credential when possible. Return null otherwise.
- getToken() : string|null
- toArray() : array<string, mixed>
- Copy of Symfony\Component\HttpClient\Response::toArray without assertion on Content-Type header.
Constants
METADATA_ENDPOINT
private
mixed
METADATA_ENDPOINT
= 'http://169.254.169.254/latest/meta-data/iam/security-credentials'
TOKEN_ENDPOINT
private
mixed
TOKEN_ENDPOINT
= 'http://169.254.169.254/latest/api/token'
Properties
$httpClient
private
HttpClientInterface
$httpClient
$logger
private
LoggerInterface
$logger
$timeout
private
float
$timeout
$tokenTtl
private
int
$tokenTtl
Methods
__construct()
public
__construct([HttpClientInterface|null $httpClient = null ][, LoggerInterface|null $logger = null ][, float $timeout = 1.0 ][, int $tokenTtl = 21600 ]) : mixed
Parameters
- $httpClient : HttpClientInterface|null = null
- $logger : LoggerInterface|null = null
- $timeout : float = 1.0
- $tokenTtl : int = 21600
getCredentials()
Return a Credential when possible. Return null otherwise.
public
getCredentials(Configuration $configuration) : Credentials|null
Parameters
- $configuration : Configuration
Return values
Credentials|nullgetToken()
private
getToken() : string|null
Return values
string|nulltoArray()
Copy of Symfony\Component\HttpClient\Response::toArray without assertion on Content-Type header.
private
toArray(ResponseInterface $response) : array<string, mixed>
Parameters
- $response : ResponseInterface