From cf7718f8dc98290a36c1210491130ad4b7b0ff63 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 12 May 2024 08:03:56 +0800 Subject: [PATCH] chore: update presign expires --- plugin/storage/s3/s3.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/storage/s3/s3.go b/plugin/storage/s3/s3.go index a8c6a3b5..06793a35 100644 --- a/plugin/storage/s3/s3.go +++ b/plugin/storage/s3/s3.go @@ -70,7 +70,9 @@ func (c *Client) PresignGetObject(ctx context.Context, key string) (string, erro Bucket: aws.String(*c.Bucket), Key: aws.String(key), }, func(opts *s3.PresignOptions) { - opts.Expires = time.Duration(7 * 24 * time.Hour) + // Set the expiration time of the presigned URL to 5 days. + // Reference: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html + opts.Expires = time.Duration(5 * 24 * time.Hour) }) if err != nil { return "", errors.Wrap(err, "failed to presign put object")