MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / expectedHMAC

Function expectedHMAC

internal/agent/billing_hook_test.go:69–73  ·  view source on GitHub ↗

expectedHMAC re-derives the X-E2A-Internal-Signature for the recorded body. Independent computation, so a bug in either side shows up.

(secret string, body []byte)

Source from the content-addressed store, hash-verified

67// expectedHMAC re-derives the X-E2A-Internal-Signature for the recorded body.
68// Independent computation, so a bug in either side shows up.
69func expectedHMAC(secret string, body []byte) string {
70 h := hmac.New(sha256.New, []byte(secret))
71 h.Write(body)
72 return hex.EncodeToString(h.Sum(nil))
73}
74
75// TestDeleteUser_FiresBillingHook: deletion notifies billing with the user_id
76// body + a matching HMAC signature, then the cascade removes the user.

Callers 1

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected