| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
namespace AWS\CRT\Auth; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
final class StaticCredentialsProvider extends CredentialsProvider { |
| 17 |
|
| 18 |
private $credentials; |
| 19 |
|
| 20 |
public function __get($name) { |
| 21 |
return $this->$name; |
| 22 |
} |
| 23 |
|
| 24 |
function __construct(array $options = []) { |
| 25 |
parent::__construct(); |
| 26 |
$this->credentials = new AwsCredentials($options); |
| 27 |
|
| 28 |
$provider_options = self::$crt->credentials_provider_static_options_new(); |
| 29 |
self::$crt->credentials_provider_static_options_set_access_key_id($provider_options, $this->credentials->access_key_id); |
| 30 |
self::$crt->credentials_provider_static_options_set_secret_access_key($provider_options, $this->credentials->secret_access_key); |
| 31 |
self::$crt->credentials_provider_static_options_set_session_token($provider_options, $this->credentials->session_token); |
| 32 |
$this->acquire(self::$crt->credentials_provider_static_new($provider_options)); |
| 33 |
self::$crt->credentials_provider_static_options_release($provider_options); |
| 34 |
} |
| 35 |
} |