(envs []string)
| 39 | } |
| 40 | |
| 41 | func (s *SecretAwareRedactor) AddSecretEnv(envs []string) { |
| 42 | for _, v := range envs { |
| 43 | if slices.ContainsFunc(allowedEnvPrefixes, func(prefix string) bool { return strings.HasPrefix(v, prefix) }) { |
| 44 | continue |
| 45 | } |
| 46 | |
| 47 | parts := strings.SplitN(v, "=", 2) |
| 48 | if len(parts) != 2 || len(parts[1]) < minRedactingLength { |
| 49 | continue |
| 50 | } |
| 51 | |
| 52 | s.secrets[parts[1]] = parts[0] |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | type SecretAwareWriter struct { |
| 57 | out io.Writer |
no outgoing calls