Merge pull request #2 from MSR97/feature/expand-s3fs-with-aws-session-token-support

feat: add support for AWS session token in S3 configuration
This commit is contained in:
Mohammad 2025-09-10 14:21:30 +02:00 committed by GitHub
commit 6eff047ed7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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: