Pass effective paths through configuration loading

This commit is contained in:
2026-10-17 05:33:03 +00:00
parent 5e58b6944b
commit 0cd833513c
5 changed files with 90 additions and 32 deletions

View File

@@ -53,7 +53,7 @@ func secretProviderPath(path configkit.Path) bool {
return false
}
parts := strings.Split(strings.TrimPrefix(pointer, "/"), "/")
if len(parts) < 4 || (parts[0] != "backends" && parts[0] != "profiles") || parts[2] != "extra_params" {
if !providerExtraParamsPath(parts) {
return false
}
key := strings.ToLower(strings.ReplaceAll(strings.ReplaceAll(parts[len(parts)-1], "~1", "/"), "~0", "~"))
@@ -64,3 +64,8 @@ func secretProviderPath(path configkit.Path) bool {
return false
}
}
func providerExtraParamsPath(parts []string) bool {
return len(parts) >= 4 && parts[1] != "" &&
(parts[0] == "backends" || parts[0] == "profiles") && parts[2] == "extra_params"
}