Integrate indexed sensitivity propagation
This commit is contained in:
@@ -89,7 +89,7 @@ func referenceSecretDependencyClosure(paths map[string]Path, seed map[string]boo
|
||||
for {
|
||||
changed := false
|
||||
for _, dependency := range dependencies {
|
||||
if secretIntersectsPath(paths, secret, dependency.dependency) && !secret[dependency.target.String()] {
|
||||
if referenceSecretIntersectsPath(paths, secret, dependency.dependency) && !secret[dependency.target.String()] {
|
||||
secret[dependency.target.String()] = true
|
||||
changed = true
|
||||
}
|
||||
@@ -110,6 +110,19 @@ func referenceSecretDependencyClosure(paths map[string]Path, seed map[string]boo
|
||||
}
|
||||
}
|
||||
|
||||
func referenceSecretIntersectsPath(paths map[string]Path, secret map[string]bool, candidate Path) bool {
|
||||
for pointer := range secret {
|
||||
classified, ok := paths[pointer]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if pathContains(classified, candidate) || pathContains(candidate, classified) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func secretPaths(paths ...Path) map[string]Path {
|
||||
result := make(map[string]Path, len(paths))
|
||||
for _, path := range paths {
|
||||
|
||||
Reference in New Issue
Block a user