summaryrefslogtreecommitdiff
path: root/internal/configuration/helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/configuration/helpers.go')
-rw-r--r--internal/configuration/helpers.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/internal/configuration/helpers.go b/internal/configuration/helpers.go
index 57e00fa43..db4450727 100644
--- a/internal/configuration/helpers.go
+++ b/internal/configuration/helpers.go
@@ -7,7 +7,7 @@ import (
"github.com/authelia/authelia/v4/internal/utils"
)
-func getEnvConfigMap(keys []string, prefix, delimiter string) (keyMap map[string]string, ignoredKeys []string) {
+func getEnvConfigMap(keys []string, prefix, delimiter string, ds map[string]Deprecation) (keyMap map[string]string, ignoredKeys []string) {
keyMap = make(map[string]string)
for _, key := range keys {
@@ -21,6 +21,12 @@ func getEnvConfigMap(keys []string, prefix, delimiter string) (keyMap map[string
}
}
+ for key := range ds {
+ if IsSecretKey(key) {
+ ignoredKeys = append(ignoredKeys, ToEnvironmentSecretKey(key, prefix, delimiter))
+ }
+ }
+
for _, deprecation := range deprecations {
if !deprecation.AutoMap {
continue
@@ -32,7 +38,7 @@ func getEnvConfigMap(keys []string, prefix, delimiter string) (keyMap map[string
return keyMap, ignoredKeys
}
-func getSecretConfigMap(keys []string, prefix, delimiter string) (keyMap map[string]string) {
+func getSecretConfigMap(keys []string, prefix, delimiter string, ds map[string]Deprecation) (keyMap map[string]string) {
keyMap = make(map[string]string)
for _, key := range keys {
@@ -43,6 +49,14 @@ func getSecretConfigMap(keys []string, prefix, delimiter string) (keyMap map[str
}
}
+ for key := range ds {
+ if IsSecretKey(key) {
+ originalKey := strings.ToUpper(strings.ReplaceAll(key, constDelimiter, delimiter)) + constSecretSuffix
+
+ keyMap[prefix+originalKey] = key
+ }
+ }
+
return keyMap
}