Add all extra parameters and expiration to geturl method#91
Add all extra parameters and expiration to geturl method#91franagustin wants to merge 1 commit intoPyFilesystem:masterfrom
Conversation
|
Hi. Sorry, I must've missed your first mention. I'm not that familiar with S3. Could you provide some additional context on why this change is needed / what benefit it provides? |
@atollk Heya! Sure. When we generate a presigned URL from an S3 bucket, the token which gets appended to the URL has an expiration timestamp. The extra keyword arguments can be used to take further advantage of S3 options. Check this example in which we set a content-disposition and a default filename for downloads (because the file in the bucket has a different name based on internal ID): kwargs = {
"ResponseContentDisposition": f"attachment; filename = example.csv",
"ResponseContentType": "csv",
} |
|
Makes sense to me. Maybe a small comment for that function explaining the meaning of the arguments (or at least linking to something like https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/generate_presigned_url.html) would be helpful for future users here? Other than that, I'm okay with this being merged. But tbh I have no idea how the release process for this package is, so you might still have to refer to the git repository for your dependency to include your change. |
Allow for users to provide extra parameters (i.e. ResponseContentDisposition, ResponseContentType) and custom expiration time for presigned urls generated by geturl.
@willmcgugan @zopyx @atollk @althonos