(envMap map[string]any, allowed map[string]struct {
})
| 129 | } |
| 130 | |
| 131 | func findUnsafeEngineEnvSecretKeys(envMap map[string]any, allowed map[string]struct { |
| 132 | }) map[string]struct { |
| 133 | } { |
| 134 | unsafe := make(map[string]struct { |
| 135 | }) |
| 136 | for key, value := range envMap { |
| 137 | if setutil.Contains(allowed, key) { |
| 138 | continue |
| 139 | } |
| 140 | strVal, ok := value.(string) |
| 141 | if !ok { |
| 142 | continue |
| 143 | } |
| 144 | if len(workflow.ExtractSecretsFromMap(map[string]string{key: strVal})) > 0 { |
| 145 | unsafe[key] = struct { |
| 146 | }{} |
| 147 | } |
| 148 | } |
| 149 | engineEnvSecretsCodemodLog.Printf("Found %d unsafe engine.env secret keys out of %d total keys", len(unsafe), len(envMap)) |
| 150 | return unsafe |
| 151 | } |
| 152 | |
| 153 | func removeUnsafeEngineEnvKeys(lines []string, unsafeKeys map[string]struct { |
| 154 | }) ([]string, bool) { |
no test coverage detected