Increase STS Session duration to 12 hours (#2434)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user