Add 'Period' support to AWS IAM token renewal (#3220)

This commit is contained in:
EXPEddrewery 2017-08-22 23:50:53 +10:00 committed by Jeff Mitchell
parent be57fd0594
commit a4f4e5bf34

View file

@ -943,7 +943,13 @@ func (b *backend) pathLoginRenewIam(
}
}
return framework.LeaseExtend(roleEntry.TTL, roleEntry.MaxTTL, b.System())(req, data)
// If 'Period' is set on the role, then the token should never expire.
if roleEntry.Period > time.Duration(0) {
req.Auth.TTL = roleEntry.Period
return &logical.Response{Auth: req.Auth}, nil
} else {
return framework.LeaseExtend(roleEntry.TTL, roleEntry.MaxTTL, b.System())(req, data)
}
}
func (b *backend) pathLoginRenewEc2(