debug: logger=debug + try/catch verify_signature - #7
Merged
Conversation
Two complementary changes to surface what is actually going wrong with webhook verification: 1. prod logger_level: info -> debug. Wider net so nothing is filtered. 2. Wrap gakudan_tickets_github:verify_signature/3 in try/catch with a ?LOG_ERROR that captures the crash class/reason/stack and the byte sizes of secret/body/sig. crypto:hash_equals/2 raises badarg when the two binaries differ in size; without this wrap the handler crashes and Nova renders a generic 500, which is what we just saw when probing with a short test signature. Real GitHub deliveries should not hit this, but the safety net + error log will tell us immediately if they do for some reason.
🔴 Code Coverage — 12.8%23 of 179 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.
Two changes to dig into the persistent 401:
logger_levelfrominfotodebugso nothing is filtered.verify_signature/3in try/catch with a structured?LOG_ERRORcapturing class/reason/stack + byte sizes.crypto:hash_equals/2crashes on unequal-length binaries; without this wrap, any sig length mismatch becomes a generic 500 with no log line. Real GitHub deliveries shouldn't trigger this but the safety net + error log makes it visible if they do.