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:
commit
6eff047ed7
2 changed files with 9 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue