Repository navigation
Require a signature when a signing secret is configured - #228
Merged
Merged
Conversation
The three-argument B2EventNotification.parse overloads now throw B2SignatureVerificationException when the signature header is missing or empty, and IllegalArgumentException when the signing secret is null or empty. Signatures are compared in constant time. Add parseUnverified for callers that intentionally skip verification, and deprecate the one-argument parse overloads, whose Javadoc wrongly mentioned a check. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sophiecarreras
force-pushed
the
require-signature-when-secret-configured
branch
from
November 2, 2026 20:18
f9fc792 to
2fcc3a1
Compare
ffumero2003
approved these changes
Nov 2, 2026
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.
The three-argument
B2EventNotification.parseoverloads now require a signature header and a signing secret.A missing or empty header throws
B2SignatureVerificationException; a null or empty secret throwsIllegalArgumentException.Signature comparison is constant-time; comma-separated multi-signature headers still work.
Added
parseUnverifiedfor callers that intentionally skip verification; the one-argumentparseoverloads still work but are deprecated and their Javadoc is corrected.Behaviour change noted in the CHANGELOG: receivers should answer HTTP 401 on
B2SignatureVerificationException.Tests: updated the tests that expected a missing header or secret to be accepted, and added tests for empty header, null/empty secret, multi-signature headers, wrong signature, and the unverified path.
🤖 Generated with Claude Code