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)
| 94 | /// Sanitize an intent id/key for use as a directory name in the sidecar/vault |
| 95 | /// path. Keeps ASCII alphanumerics, `-` and `_`; everything else becomes `_`. |
| 96 | fn sanitize_id(id: &str) -> String { |
| 97 | id.chars() |
| 98 | .map(|c| { |
| 99 | if c.is_ascii_alphanumeric() || c == '-' || c == '_' { |
| 100 | c |
| 101 | } else { |
| 102 | '_' |
| 103 | } |
| 104 | }) |
| 105 | .collect() |
| 106 | } |
| 107 | |
| 108 | /// The normalized intent id used to key BOTH the tracked vault attestation path |
| 109 | /// and the legacy `.atomic` sidecar dir, so the dual-read fallback lines up |