fix: lambda function expiration when cred.Expiration is set (#17029)

This commit is contained in:
Klaus Post 2023-04-13 08:10:57 -07:00 committed by GitHub
parent 62151a751d
commit 958a480e53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,8 +46,9 @@ func getLambdaEventData(bucket, object string, cred auth.Credentials, r *http.Re
secure = globalMinioEndpointURL.Scheme == "https"
}
duration := time.Since(cred.Expiration)
if cred.Expiration.IsZero() {
duration := time.Until(cred.Expiration)
if cred.Expiration.IsZero() || duration > time.Hour {
// Always limit to 1 hour.
duration = time.Hour
}