MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / webhook_payload_with_hmac

Function webhook_payload_with_hmac

nodedb/src/control/security/siem.rs:255–266  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253
254 #[test]
255 fn webhook_payload_with_hmac() {
256 let config = SiemConfig {
257 webhook_hmac_secret: "test_secret".into(),
258 ..Default::default()
259 };
260 let exporter = SiemExporter::new(config);
261
262 let (body, signature) = exporter.build_webhook_payload(&[test_entry()]);
263 assert!(body.contains("nodedb"));
264 assert!(!signature.is_empty());
265 assert_eq!(signature.len(), 64); // SHA-256 hex = 64 chars.
266 }
267
268 #[test]
269 fn hmac_consistency() {

Callers

nothing calls this directly

Calls 2

test_entryFunction · 0.85
build_webhook_payloadMethod · 0.80

Tested by

no test coverage detected