Skip to content

Commit ae2587d

Browse files
authored
Increase STS Session duration to 12 hours (#2434)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
1 parent cac8445 commit ae2587d

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

pkg/auth/token/config.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,11 @@ import (
2323
"github.com/minio/pkg/env"
2424
)
2525

26-
// GetConsoleSTSDuration returns the default session duration for the STS requested tokens (defaults to 1h)
26+
// GetConsoleSTSDuration returns the default session duration for the STS requested tokens (defaults to 12h)
2727
func GetConsoleSTSDuration() time.Duration {
28-
durationSeconds := env.Get(ConsoleSTSDurationSeconds, "")
29-
if durationSeconds != "" {
30-
duration, err := time.ParseDuration(durationSeconds + "s")
31-
if err != nil {
32-
duration = 1 * time.Hour
33-
}
34-
return duration
35-
}
36-
duration, err := time.ParseDuration(env.Get(ConsoleSTSDuration, "1h"))
28+
duration, err := time.ParseDuration(env.Get(ConsoleSTSDuration, "12h"))
3729
if err != nil {
38-
duration = 1 * time.Hour
30+
duration = 12 * time.Hour
3931
}
4032
return duration
4133
}

pkg/auth/token/const.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
package token
1818

1919
const (
20-
ConsoleSTSDurationSeconds = "CONSOLE_STS_DURATION_SECONDS" // (deprecated), set value in seconds for sts session, ie: 3600
21-
ConsoleSTSDuration = "CONSOLE_STS_DURATION" // time.Duration format, ie: 3600s, 2h45m, 1h, etc
22-
ConsolePBKDFPassphrase = "CONSOLE_PBKDF_PASSPHRASE"
23-
ConsolePBKDFSalt = "CONSOLE_PBKDF_SALT"
20+
ConsoleSTSDuration = "CONSOLE_STS_DURATION" // time.Duration format, ie: 3600s, 2h45m, 1h, etc
21+
ConsolePBKDFPassphrase = "CONSOLE_PBKDF_PASSPHRASE"
22+
ConsolePBKDFSalt = "CONSOLE_PBKDF_SALT"
2423
)

0 commit comments

Comments
 (0)