From bb0248ba78f04a824ed28ff630fa77c75e66b46c Mon Sep 17 00:00:00 2001 From: Robert Chettleburgh Date: Fri, 22 Nov 2024 16:40:48 +0000 Subject: [PATCH] [10.x] Fix: Prevent invalid AWS credentials options being created Improves on 909ea24597b86cfc7a49ce41074280d0347bf6a3 which could create credentials arrays with only a token --- BusServiceProvider.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BusServiceProvider.php b/BusServiceProvider.php index 4031e15..ae0c362 100644 --- a/BusServiceProvider.php +++ b/BusServiceProvider.php @@ -69,10 +69,10 @@ protected function registerBatchServices() ]; if (! empty($config['key']) && ! empty($config['secret'])) { - $dynamoConfig['credentials'] = Arr::only( - $config, - ['key', 'secret', 'token'] - ); + $dynamoConfig['credentials'] = Arr::only($config, ['key', 'secret']); + if (! empty($config['token'])) { + $dynamoConfig['credentials']['token'] = $config['token']; + } } return new DynamoBatchRepository(