patternEntityActions merges a pattern detector's per-pattern Action overrides into its entity_actions map. A pattern reports matches under its Name, so a per-pattern action is just an entity_actions[Name] entry; explicit entity_actions still win if both are set.
(cfg config.ModelConfig)
| 310 | // per-pattern action is just an entity_actions[Name] entry; explicit |
| 311 | // entity_actions still win if both are set. |
| 312 | func patternEntityActions(cfg config.ModelConfig) map[string]string { |
| 313 | out := cfg.PIIDetectionEntityActions() |
| 314 | for _, p := range cfg.PIIDetection.Patterns { |
| 315 | if p.Action == "" || p.Name == "" { |
| 316 | continue |
| 317 | } |
| 318 | if out == nil { |
| 319 | out = map[string]string{} |
| 320 | } |
| 321 | if _, exists := out[p.Name]; !exists { |
| 322 | out[p.Name] = p.Action |
| 323 | } |
| 324 | } |
| 325 | return out |
| 326 | } |
| 327 | |
| 328 | // ResolvePIIPolicy resolves the effective request-side PII policy for a |
| 329 | // consuming model, layering the instance-wide default detector |
no test coverage detected