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