fix: negative STS IAM token TTL value (#10866)

This commit is contained in:
Steven Reitsma 2020-11-10 21:24:01 +01:00 committed by GitHub
parent 06899210a7
commit 4683a623dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -725,7 +725,7 @@ func (sys *IAMSys) SetTempUser(accessKey string, cred auth.Credentials, policyNa
sys.store.lock()
defer sys.store.unlock()
ttl := int64(UTCNow().Sub(cred.Expiration).Seconds())
ttl := int64(cred.Expiration.Sub(UTCNow()).Seconds())
// If OPA is not set we honor any policy claims for this
// temporary user which match with pre-configured canned