Skip to content

Commit dc7b7af

Browse files
committed
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 <[email protected]>
1 parent 69c1e4a commit dc7b7af

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.config/s3.config.php

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
$CONFIG['objectstore']['arguments']['secret'] = '';
4141
}
4242

43+
if (getenv('OBJECTSTORE_S3_SESSION_TOKEN_FILE')) {
44+
$CONFIG['objectstore']['arguments']['session_token'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SESSION_TOKEN_FILE')));
45+
} elseif (getenv('OBJECTSTORE_S3_SESSION_TOKEN')) {
46+
$CONFIG['objectstore']['arguments']['session_token'] = getenv('OBJECTSTORE_S3_SESSION_TOKEN');
47+
} else {
48+
$CONFIG['objectstore']['arguments']['session_token'] = '';
49+
}
50+
4351
if (getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')) {
4452
$CONFIG['objectstore']['arguments']['sse_c_key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')));
4553
} elseif (getenv('OBJECTSTORE_S3_SSE_C_KEY')) {

0 commit comments

Comments
 (0)