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

Method mac_input

atomic-agent/src/turn/capture.rs:153–157  ·  view source on GitHub ↗

The canonical MAC input: the capture's JSON with `mac` cleared. JSON with sorted field order (serde_json preserves struct order) is deterministic for this struct, so the MAC binds exactly these bytes.

(&self)

Source from the content-addressed store, hash-verified

151 /// JSON with sorted field order (serde_json preserves struct order) is
152 /// deterministic for this struct, so the MAC binds exactly these bytes.
153 fn mac_input(&self) -> Vec<u8> {
154 let mut unsigned = self.clone();
155 unsigned.mac = String::new();
156 serde_json::to_vec(&unsigned).expect("capture canonical JSON")
157 }
158
159 /// Compute the MAC under `key_hex` (64 hex chars → 32 bytes).
160 fn mac(key_hex: &str, input: &[u8]) -> String {

Callers 2

signMethod · 0.80
verifyMethod · 0.80

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected