summaryrefslogtreecommitdiff
path: root/internal/configuration/schema/authentication.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2023-11-23 08:20:36 +1100
committerGitHub <noreply@github.com>2023-11-23 08:20:36 +1100
commitc49b973120c7fd755923a2b88afd794c7d320d6e (patch)
tree5fcef6de1a85568eee3c67470f73b790b294dda8 /internal/configuration/schema/authentication.go
parentfa141929a39e546f3f3ca6bcbc7bd72c64e575c8 (diff)
fix(configuration): illogical refresh interval default (#6319)
When using the file provider with watch enabled, the refresh interval should just be set to always default as the cost is minimal. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/configuration/schema/authentication.go')
-rw-r--r--internal/configuration/schema/authentication.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/configuration/schema/authentication.go b/internal/configuration/schema/authentication.go
index 6232ae640..56c1f8f39 100644
--- a/internal/configuration/schema/authentication.go
+++ b/internal/configuration/schema/authentication.go
@@ -10,7 +10,7 @@ import (
type AuthenticationBackend struct {
PasswordReset AuthenticationBackendPasswordReset `koanf:"password_reset" json:"password_reset" jsonschema:"title=Password Reset" jsonschema_description:"Allows configuration of the password reset behaviour"`
- RefreshInterval string `koanf:"refresh_interval" json:"refresh_interval" jsonschema:"title=Refresh Interval" jsonschema_description:"How frequently the user details are refreshed from the backend"`
+ RefreshInterval RefreshIntervalDuration `koanf:"refresh_interval" json:"refresh_interval" jsonschema:"default=5 minutes,title=Refresh Interval" jsonschema_description:"How frequently the user details are refreshed from the backend"`
// The file authentication backend configuration.
File *AuthenticationBackendFile `koanf:"file" json:"file" jsonschema:"title=File Backend" jsonschema_description:"The file authentication backend configuration"`
@@ -141,6 +141,10 @@ type AuthenticationBackendLDAPAttributes struct {
GroupName string `koanf:"group_name" json:"group_name" jsonschema:"title=Attribute: Group Name" jsonschema_description:"The directory server attribute which contains the group name for all groups"`
}
+var DefaultAuthenticationBackendConfig = AuthenticationBackend{
+ RefreshInterval: NewRefreshIntervalDuration(time.Minute * 5),
+}
+
// DefaultPasswordConfig represents the default configuration related to Argon2id hashing.
var DefaultPasswordConfig = AuthenticationBackendFilePassword{
Algorithm: argon2,