feat: add support for AWS session token in S3 configuration

This commit is contained in:
Mohammad 2025-09-10 14:20:42 +02:00
parent e2ed279314
commit a0c951336e
2 changed files with 9 additions and 2 deletions

View file

@ -21,7 +21,11 @@ class S3FileStorage(Storage):
def __init__(self, storage_path: str):
self.storage_path = storage_path
s3_config = get_s3_config()
if s3_config.aws_access_key_id is not None and s3_config.aws_secret_access_key is not None and s3_config.aws_session_token is not None:
if (
s3_config.aws_access_key_id is not None
and s3_config.aws_secret_access_key is not None
and s3_config.aws_session_token is not None
):
self.s3 = s3fs.S3FileSystem(
key=s3_config.aws_access_key_id,
secret=s3_config.aws_secret_access_key,

View file

@ -32,7 +32,10 @@ async def resolve_data_directories(
import s3fs
fs = s3fs.S3FileSystem(
key=s3_config.aws_access_key_id, secret=s3_config.aws_secret_access_key,token=s3_config.aws_session_token, anon=False
key=s3_config.aws_access_key_id,
secret=s3_config.aws_secret_access_key,
token=s3_config.aws_session_token,
anon=False,
)
for item in data: