diff --git a/packages/providers/upload-aws-s3/README.md b/packages/providers/upload-aws-s3/README.md index 1d8bbefe80..29f2433521 100644 --- a/packages/providers/upload-aws-s3/README.md +++ b/packages/providers/upload-aws-s3/README.md @@ -27,7 +27,7 @@ npm install @strapi/provider-upload-aws-s3 --save - `providerOptions` is passed down during the construction of the provider. (ex: `new AWS.S3(config)`). [Complete list of options](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property) - `providerOptions.params` is passed directly to the parameters to each method respectively. - `ACL` is the access control list for the object. Defaults to `public-read`. - - `signedUrlExpires` is the number of seconds before a signed URL expires. (See [how signed URLs work](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls.html)). Defaults to 7 days and URLs are only signed when ACL is set to `private`. + - `signedUrlExpires` is the number of seconds before a signed URL expires. (See [how signed URLs work](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls.html)). Defaults to 15 minutes and URLs are only signed when ACL is set to `private`. - `Bucket` is the name of the bucket to upload to. - `actionOptions` is passed directly to the parameters to each method respectively. You can find the complete list of [upload/ uploadStream options](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property) and [delete options](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#deleteObject-property) @@ -54,7 +54,7 @@ module.exports = ({ env }) => ({ region: env('AWS_REGION'), params: { ACL: env('AWS_ACL', 'public-read'), - signedUrlExpires: env('AWS_SIGNED_URL_EXPIRES', 60 * 60 * 24 * 7), + signedUrlExpires: env('AWS_SIGNED_URL_EXPIRES', 15 * 60), Bucket: env('AWS_BUCKET'), }, }, diff --git a/packages/providers/upload-aws-s3/lib/index.js b/packages/providers/upload-aws-s3/lib/index.js index 51f0d9c557..c2c680bc0a 100644 --- a/packages/providers/upload-aws-s3/lib/index.js +++ b/packages/providers/upload-aws-s3/lib/index.js @@ -96,7 +96,7 @@ module.exports = { { Bucket: config.params.Bucket, Key: fileKey, - Expires: getOr(60 * 60 * 24 * 7, ['params', 'signedUrlExpires'], config), // 7 days + Expires: getOr(15 * 60, ['params', 'signedUrlExpires'], config), // 15 minutes }, (err, url) => { if (err) {