summaryrefslogtreecommitdiff
path: root/internal/configuration/helpers.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2023-08-18 20:34:23 +1000
committerGitHub <noreply@github.com>2023-08-18 20:34:23 +1000
commit58d99d60b797fd94e24081c4a9ee9d943b7f38c2 (patch)
tree83e31d38012c19d227713e2a4d7604e23d5b9fce /internal/configuration/helpers.go
parent09037d07c03e794eb1390cdf0eb3b46d15fccdf5 (diff)
docs: fix secret and env key gen (#5866)
Fixes a documentation issue which was caused by inaccurate documentation generator logic. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/configuration/helpers.go')
-rw-r--r--internal/configuration/helpers.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/configuration/helpers.go b/internal/configuration/helpers.go
index ab3f44cf5..57e00fa43 100644
--- a/internal/configuration/helpers.go
+++ b/internal/configuration/helpers.go
@@ -62,7 +62,19 @@ func IsSecretKey(key string) (isSecretKey bool) {
return false
}
- return utils.IsStringInSliceSuffix(key, secretSuffixes)
+ if strings.Contains(key, ".*.") {
+ return false
+ }
+
+ if utils.IsStringInSlice(key, secretExclusionExact) {
+ return false
+ }
+
+ if utils.IsStringInSliceF(key, secretExclusionPrefix, strings.HasPrefix) {
+ return false
+ }
+
+ return utils.IsStringInSliceF(key, secretSuffix, strings.HasSuffix)
}
func loadSecret(path string) (value string, err error) {