Skip to content

sdkharness: conformance check refuses a missing webhook signature header when a secret is given - #226

Draft
sophiecarreras wants to merge 1 commit into
masterfrom
test/webhook-conformance-missing-signature
Draft

sophiecarreras wants to merge 1 commit into
masterfrom
test/webhook-conformance-missing-signature

Conversation

@sophiecarreras

Copy link
Copy Markdown
Contributor

Draft. Extends the repository-owned harness check .sdkharness/tests/conformance/BucketInboundWebhook.java (the one added in #222) with one more case: a missing signature header must be refused when a signing secret is given, for both B2EventNotification.parse overloads (byte[] and String).

Why

The check already refuses an empty signature header. A null header with a secret is not covered: parse(...) only verifies the signature when both the header and the secret are non-null, so on current master this new case reports a failure (a missing signature header with a secret was accepted). The unit tests in B2EventNotificationTest currently pin that behavior on purpose (testParseSuccessWithNoSignature, testParseBytesSuccessWithNoSignature), so whether it is intended is a team decision; this PR only records the question as a check and does not change production code or unit tests.

What it changes

  • .sdkharness/tests/conformance/BucketInboundWebhook.java only: one new step with two refused(...) cases and the Javadoc line. It keeps the check independent of the SDK's code (its own HMAC sign).
  • This check runs in the harness (backblaze-labs/demand-side-ai), not in this repository's CI, so this repository's build and unit tests are unaffected. Nothing in core/ changes.

Verification

Run against master in the harness it reports: bucket.inbound_webhook @simulator: FAIL (… a missing signature header with a secret was accepted). With a fail-closed implementation the same case passes. The 17 other B2EventNotificationTest cases are unchanged and pass.

If the team decides the behavior is intended, this case can be dropped or inverted; if it decides to fail closed, the fix also needs the two WithNoSignature unit tests updated.

🤖 Generated with Claude Code

… a secret is given

B2EventNotification.parse(...) skips verification when the X-Bz-Event-Notification-Signature header is null even though a signing secret was passed. The check already refuses an empty header; add the null-header case for both overloads, so the harness reports it (known issue tracking in backblaze-labs/demand-side-ai).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant