mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
fix: expiration time for share link when using OpenID (#18297)
This commit is contained in:
@@ -67,7 +67,8 @@ const (
|
||||
EnvRootDriveThresholdSize = "MINIO_ROOTDRIVE_THRESHOLD_SIZE"
|
||||
EnvRootDiskThresholdSize = "MINIO_ROOTDISK_THRESHOLD_SIZE" // Deprecated Sep 2023
|
||||
EnvBrowserLoginAnimation = "MINIO_BROWSER_LOGIN_ANIMATION"
|
||||
EnvBrowserSessionDuration = "MINIO_BROWSER_SESSION_DURATION"
|
||||
EnvBrowserSessionDuration = "MINIO_BROWSER_SESSION_DURATION" // Deprecated after November 2023
|
||||
EnvMinioStsDuration = "MINIO_STS_DURATION"
|
||||
EnvMinIOLogQueryURL = "MINIO_LOG_QUERY_URL"
|
||||
EnvMinIOLogQueryAuthToken = "MINIO_LOG_QUERY_AUTH_TOKEN"
|
||||
EnvMinIOPrometheusURL = "MINIO_PROMETHEUS_URL"
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
"github.com/minio/minio/internal/config"
|
||||
"github.com/minio/minio/internal/config/identity/openid/provider"
|
||||
"github.com/minio/minio/internal/hash/sha256"
|
||||
"github.com/minio/pkg/v2/env"
|
||||
xnet "github.com/minio/pkg/v2/net"
|
||||
"github.com/minio/pkg/v2/policy"
|
||||
)
|
||||
@@ -599,7 +600,11 @@ func (r Config) GetRoleInfo() map[arn.ARN]string {
|
||||
|
||||
// GetDefaultExpiration - returns the expiration seconds expected.
|
||||
func GetDefaultExpiration(dsecs string) (time.Duration, error) {
|
||||
defaultExpiryDuration := time.Duration(60) * time.Minute // Defaults to 1hr.
|
||||
timeout := env.Get(config.EnvMinioStsDuration, "")
|
||||
defaultExpiryDuration, err := time.ParseDuration(timeout)
|
||||
if err != nil {
|
||||
defaultExpiryDuration = time.Duration(60) * time.Minute
|
||||
}
|
||||
if dsecs != "" {
|
||||
expirySecs, err := strconv.ParseInt(dsecs, 10, 64)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user