Fix expired token error while generating presigned URLs

Adds renewIAMToken() call in GeneratePresignedURL.

On token expiry, GeneratePresignedURL would not renew it until
other methods that renew tokens are called.
This commit is contained in:
Abhinav Raut
2025-09-17 22:50:51 +05:30
parent 59a29ac4b1
commit aa72271c58
+4
View File
@@ -31,6 +31,10 @@ type PresignedInput struct {
// for Authentication using Query Parameters.
// (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html)
func (s3 *S3) GeneratePresignedURL(in PresignedInput) string {
if err := s3.renewIAMToken(); err != nil {
return ""
}
var (
nowTime = nowTime()