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

Method mac_input

atomic-agent/src/turn/capture.rs:155–159  ·  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

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