I have generated a pre-signed url for an object in one of my buckets using boto3:
s3.generate_presigned_url('get_object', Params = {'Bucket': 'https://s3.amazonaws.com/<>', 'Key': '<>.json'}, ExpiresIn = 100)
Now, how do I get_object
it in boto3? The boto3's get_object
reference doesn't specify any argument for a pre-signed url.
So, how do I get that object from S3 using it's pre-signed url in boto3?
If you have a pre-signed URL, you don't need boto -- you can download the object using any HTTP user agent library.
Conversely, if you have boto and the credentials, you don't need a pre-signed URL.
Pre-signed URLs are intended for allowing someone with credentials to enable someone else without credentials to access a resource, without exposing the credentials to them.
A pre-signed URL includes the access-key-id and possibly a session-token, but not the access-key-secret, and are computationally-infeasible to reverse-engineer... and in this sense, they do not expose the credentials in a way that allows the entity possessing the pre-signed URL to use the associated credentials for any other purpose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With