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)
| 67 | // expectedHMAC re-derives the X-E2A-Internal-Signature for the recorded body. |
| 68 | // Independent computation, so a bug in either side shows up. |
| 69 | func 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. |
no test coverage detected