debug(webhook): log full HMAC diagnostics on 401 - #6
Merged
Conversation
Adds a verbose ?LOG_WARNING on the verify_signature=false branch that exposes everything we'd need to spot the actual mismatch, without leaking the secret bytes: - secret_type / secret_byte_size / secret_fingerprint (first 8 hex chars of SHA-256(secret); compare equality without exposure) - body_byte_size / body_fingerprint (same idea) - sig_header (the value GitHub sent; safe to log) - sig_prefix_match (does it start with sha256=) - expected_signature (what we computed; safe — it's only sensitive combined with the body which never leaves the request) Once the root cause is found, this gets reverted to the lean line.
🔴 Code Coverage — 13.2%23 of 174 lines covered. ✅ ELP LintNo diagnostics. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds diagnostic logging to surface why
verify_signaturereturns false in production. Doesn't leak the secret; logs byte sizes, SHA-256 fingerprints, the received signature header, and the computed expected signature. After we find the cause we revert this PR.