MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / sanitize_id

Function sanitize_id

libatomic/src/daemon/services_agent.rs:687–697  ·  view source on GitHub ↗

The sanitized id used for sidecar/vault attestation paths — mirrors the CLI bridge's sanitizer (ASCII alphanumerics, `-`, `_`; everything else becomes `_`).

(id: &str)

Source from the content-addressed store, hash-verified

685/// CLI bridge's sanitizer (ASCII alphanumerics, `-`, `_`; everything else
686/// becomes `_`).
687fn sanitize_id(id: &str) -> String {
688 id.chars()
689 .map(|c| {
690 if c.is_ascii_alphanumeric() || c == '-' || c == '_' {
691 c
692 } else {
693 '_'
694 }
695 })
696 .collect()
697}
698
699/// The normalized intent key (repo resolver first, uppercased fallback) —
700/// mirrors the CLI bridge's `normalized_id`.

Callers 5

intent_list_attestationFunction · 0.70
memory_list_attestationFunction · 0.70
record_attestationMethod · 0.70

Calls 1

collectMethod · 0.45

Tested by

no test coverage detected