From dc7b7af9eb33067908262c9975f676f549c6b7e5 Mon Sep 17 00:00:00 2001 From: Hector Valcarcel Date: Thu, 6 Feb 2025 12:04:30 +0100 Subject: [PATCH] feat(s3_config): add support for S3 session token configuration - Introduced logic to handle S3 session token using environment variables. - Supports session token from both a file and direct environment variable. - Defaults to an empty token if no value is provided. Signed-off-by: Hector Valcarcel --- .config/s3.config.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/s3.config.php b/.config/s3.config.php index a17e4037..40379fe6 100644 --- a/.config/s3.config.php +++ b/.config/s3.config.php @@ -40,6 +40,14 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) { $CONFIG['objectstore']['arguments']['secret'] = ''; } + if (getenv('OBJECTSTORE_S3_SESSION_TOKEN_FILE')) { + $CONFIG['objectstore']['arguments']['session_token'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SESSION_TOKEN_FILE'))); + } elseif (getenv('OBJECTSTORE_S3_SESSION_TOKEN')) { + $CONFIG['objectstore']['arguments']['session_token'] = getenv('OBJECTSTORE_S3_SESSION_TOKEN'); + } else { + $CONFIG['objectstore']['arguments']['session_token'] = ''; + } + if (getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')) { $CONFIG['objectstore']['arguments']['sse_c_key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE'))); } elseif (getenv('OBJECTSTORE_S3_SSE_C_KEY')) {