Sanitize an intent id/key for use as a directory name in the sidecar/vault path. Keeps ASCII alphanumerics, `-` and `_`; everything else becomes `_`.
(id: &str)
| 167 | /// Sanitize an intent id/key for use as a directory name in the sidecar/vault |
| 168 | /// path. Keeps ASCII alphanumerics, `-` and `_`; everything else becomes `_`. |
| 169 | fn sanitize_id(id: &str) -> String { |
| 170 | id.chars() |
| 171 | .map(|c| { |
| 172 | if c.is_ascii_alphanumeric() || c == '-' || c == '_' { |
| 173 | c |
| 174 | } else { |
| 175 | '_' |
| 176 | } |
| 177 | }) |
| 178 | .collect() |
| 179 | } |
| 180 | |
| 181 | /// The normalized intent id used to key BOTH the tracked vault attestation path |
| 182 | /// and the legacy `.atomic` sidecar dir, so the dual-read fallback lines up |