Skip to content

Commit

Permalink
Add comment to explain security concerns when using presigned URL
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel San <[email protected]>
  • Loading branch information
danielsanfr committed Feb 2, 2021
1 parent 2330ac6 commit 8edfec0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ class S3Adapter {
let presignedUrl = '';
if (this._presignedUrl) {
const params = { Bucket: this._bucket, Key: fileKey, Expires: this._presignedUrlExpires };
// Always use the "getObject" operation, and we recommend that you protect the URL appropriately:
// https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html
presignedUrl = this._s3Client.getSignedUrl('getObject', params);
if (!this._baseUrl) {
return presignedUrl;
Expand Down

0 comments on commit 8edfec0

Please sign in to comment.