s3_multipart icon indicating copy to clipboard operation
s3_multipart copied to clipboard

Pass in AWS credentials instead of hardcoding in aws.yml

Open donpinkus opened this issue 10 years ago • 2 comments

First of all, this gem is amazing and thanks for making it. Second, bitcast.io is sweet, we never knew about it.

Issue: Is it possible to set different AWS credentials for each user, instead of hard coding into "aws.yml"?

Details: We let users upload files to an S3 bucket they specify, using their own AWS credentials that we encrypt & store in a model. From the s3_multipart readme.md, we have to hardcode AWS credentials in "aws.yml".

donpinkus avatar Apr 20 '14 18:04 donpinkus

Looking through your code, if we can pass in our own s3_access_key and s3_identity to calculate_authorization_hash(), this would simply overwrite Config.instance.s3_access_key on Ln 101, 103, 105.

https://github.com/maxgillett/s3_multipart/blob/a0cc68364a067cb6ab6192e2762d1e7e90543012/lib/s3_multipart/transfer_helpers.rb#L105

Then this gem could be used for applications that let people upload to their own S3 buckets or many S3 buckets, instead of just apps with a single bucket.

donpinkus avatar Apr 20 '14 18:04 donpinkus

SO question: http://stackoverflow.com/questions/23186265/upload-files-directly-to-s3-but-using-arbitrary-aws-credentials

donpinkus avatar Apr 20 '14 18:04 donpinkus