feat: increase allowed maximum STS expiration timeout to 365 days (#12704)

This commit is contained in:
Harshavardhana
2021-07-14 00:08:22 -07:00
committed by GitHub
parent 83c37a44b6
commit 8d19efe7e0
6 changed files with 27 additions and 25 deletions

View File

@@ -197,8 +197,8 @@ func GetDefaultExpiration(dsecs string) (time.Duration, error) {
// The duration, in seconds, of the role session.
// The value can range from 900 seconds (15 minutes)
// up to 7 days.
if expirySecs < 900 || expirySecs > 604800 {
// up to 365 days.
if expirySecs < 900 || expirySecs > 31536000 {
return 0, auth.ErrInvalidDuration
}

View File

@@ -172,7 +172,7 @@ func TestDefaultExpiryDuration(t *testing.T) {
expectErr: true,
},
{
reqURL: "http://localhost:8443/?DurationSeconds=604801",
reqURL: "http://localhost:8443/?DurationSeconds=31536001",
expectErr: true,
},
{