From 75ba48cde40beeff78ef3f578c18664f189530d6 Mon Sep 17 00:00:00 2001 From: Kevin Iuretig Date: Wed, 13 Dec 2023 00:36:34 +0100 Subject: [PATCH] Add aws session token (#39) * config.php: added AWS_SESSION_TOKEN support * TextToSpeechManager.php: added token field to Credentials This allows AWS to load also the AWS_SESSION_TOKEN in order for lambda to work as IAM key and secret are empty --- config/config.php | 1 + src/TextToSpeechManager.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/config.php b/config/config.php index 12e679d..af75341 100644 --- a/config/config.php +++ b/config/config.php @@ -96,6 +96,7 @@ 'credentials' => [ 'key' => env('AWS_ACCESS_KEY_ID', ''), 'secret' => env('AWS_SECRET_ACCESS_KEY', ''), + 'token' => env('AWS_SESSION_TOKEN', ''), ], 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), diff --git a/src/TextToSpeechManager.php b/src/TextToSpeechManager.php index 83c2d6d..e4fa7d1 100644 --- a/src/TextToSpeechManager.php +++ b/src/TextToSpeechManager.php @@ -66,7 +66,7 @@ protected function setPollyClient(array $config, Credentials $credentials) */ protected function getCredentials(array $credentials) { - return new Credentials($credentials['key'], $credentials['secret']); + return new Credentials($credentials['key'], $credentials['secret'], $credentials['token']); } /**