Preserve inspection redaction for resource lists

This commit is contained in:
2026-11-02 03:58:49 +00:00
parent c3ce15a4ab
commit a6f4d67e15
5 changed files with 106 additions and 72 deletions

View File

@@ -2,6 +2,7 @@ package configuration
import (
"io"
"strconv"
"strings"
"go.maximumdirect.net/configkit"
@@ -66,11 +67,16 @@ func secretProviderPath(path configkit.Path) bool {
}
func providerExtraParamsPath(parts []string) bool {
if len(parts) >= 4 && parts[1] != "" &&
if len(parts) >= 4 && sequenceIndex(parts[1]) &&
(parts[0] == "backends" || parts[0] == "profiles") && parts[2] == "extra_params" {
return true
}
return len(parts) >= 6 && parts[0] == "collections" && parts[1] != "" &&
(parts[2] == "backends" || parts[2] == "profiles") &&
parts[3] != "" && parts[4] == "extra_params"
sequenceIndex(parts[3]) && parts[4] == "extra_params"
}
func sequenceIndex(segment string) bool {
index, err := strconv.Atoi(segment)
return err == nil && index >= 0 && strconv.Itoa(index) == segment
}