mirror of
https://github.com/minio/minio.git
synced 2025-11-10 14:09:48 -05:00
Fix time formatting of Expiration field in STS (#8043)
Without explicit conversion to UTC() from Unix time the zone information is lost, this leads to XML marshallers marshaling the time into a wrong format. This PR fixes the compatibility issue with AWS STS API by keeping Expiration format close to ISO8601 or RFC3339 Fixes #8041
This commit is contained in:
@@ -170,7 +170,7 @@ func GetNewCredentialsWithMetadata(m map[string]interface{}, tokenSecret string)
|
||||
m["accessKey"] = cred.AccessKey
|
||||
jwt := jwtgo.NewWithClaims(jwtgo.SigningMethodHS512, jwtgo.MapClaims(m))
|
||||
|
||||
cred.Expiration = time.Unix(expiry, 0)
|
||||
cred.Expiration = time.Unix(expiry, 0).UTC()
|
||||
cred.SessionToken, err = jwt.SignedString([]byte(tokenSecret))
|
||||
if err != nil {
|
||||
return cred, err
|
||||
|
||||
Reference in New Issue
Block a user