Repository navigation
fix(api): report a missing sha256 claim in WebhookReceiver - #860
Merged
Merged
Conversation
TokenVerifier.verify() returns sha256 as "" when the claim is absent, so the `claims.sha256 is None` check never fired and such tokens were rejected with "hash mismatch" instead of "sha256 was not found in the token".
ANDROIDHASSAN
requested review from
changt,
cloudwebrtc,
lukasIO and
xianshijing-lk
as code owners
October 13, 2026 17:09
lukasIO
approved these changes
Oct 14, 2026
lukasIO
left a comment
Contributor
There was a problem hiding this comment.
that's a good improvement, thanks!
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.
WebhookReceiver.receive()checksclaims.sha256 is Noneto report a token without a body hash, butTokenVerifier.verify()fills a missingsha256claim with"", so that branch never runs. A webhook token withoutsha256falls through to the hash comparison and is rejected with a misleading message:The check is now
if not claims.sha256, so it raisessha256 was not found in the token. The token is rejected in both cases; only the reason changes.test_missing_hashintests/api/test_webhook.pyfails onmain(hash mismatch) and passes with this change;pytest tests/api: 11 passed, 28 skipped.