scottwernervt / cloudstorage

Unified cloud storage API for storage services.
http://cloudstorage.readthedocs.io/en/latest/
MIT License
93 stars 27 forks source link

allow using aws_session_token in s3 driver #42

Closed jachicao closed 5 years ago

jachicao commented 5 years ago

Hi,

I'm using this library in AWS Lambda, it works great but Lambda requires also a token called "aws_session_token" to authenticate.

I've added that in this PR.

Right now I'm doing this:

driver = S3Driver(
    key=environ.get('AWS_ACCESS_KEY_ID'),
    secret=environ.get('AWS_SECRET_ACCESS_KEY')
)
driver._session = Session(
    aws_access_key_id=environ.get('AWS_ACCESS_KEY_ID'),
    aws_secret_access_key=environ.get('AWS_SECRET_ACCESS_KEY'),
    aws_session_token=environ.get('AWS_SESSION_TOKEN')
)
jachicao commented 5 years ago

I've found a better way to do it so i'm closing this PR. (using key=None)

Thank you