diff --git a/pkg/auth/token/config.go b/pkg/auth/token/config.go index d482c5f4d..9ee918881 100644 --- a/pkg/auth/token/config.go +++ b/pkg/auth/token/config.go @@ -23,19 +23,11 @@ import ( "github.com/minio/pkg/env" ) -// GetConsoleSTSDuration returns the default session duration for the STS requested tokens (defaults to 1h) +// GetConsoleSTSDuration returns the default session duration for the STS requested tokens (defaults to 12h) func GetConsoleSTSDuration() time.Duration { - durationSeconds := env.Get(ConsoleSTSDurationSeconds, "") - if durationSeconds != "" { - duration, err := time.ParseDuration(durationSeconds + "s") - if err != nil { - duration = 1 * time.Hour - } - return duration - } - duration, err := time.ParseDuration(env.Get(ConsoleSTSDuration, "1h")) + duration, err := time.ParseDuration(env.Get(ConsoleSTSDuration, "12h")) if err != nil { - duration = 1 * time.Hour + duration = 12 * time.Hour } return duration } diff --git a/pkg/auth/token/const.go b/pkg/auth/token/const.go index 17182269b..ad3750565 100644 --- a/pkg/auth/token/const.go +++ b/pkg/auth/token/const.go @@ -17,8 +17,7 @@ package token const ( - ConsoleSTSDurationSeconds = "CONSOLE_STS_DURATION_SECONDS" // (deprecated), set value in seconds for sts session, ie: 3600 - ConsoleSTSDuration = "CONSOLE_STS_DURATION" // time.Duration format, ie: 3600s, 2h45m, 1h, etc - ConsolePBKDFPassphrase = "CONSOLE_PBKDF_PASSPHRASE" - ConsolePBKDFSalt = "CONSOLE_PBKDF_SALT" + ConsoleSTSDuration = "CONSOLE_STS_DURATION" // time.Duration format, ie: 3600s, 2h45m, 1h, etc + ConsolePBKDFPassphrase = "CONSOLE_PBKDF_PASSPHRASE" + ConsolePBKDFSalt = "CONSOLE_PBKDF_SALT" )