feat(HTTPReceiver): add invalidRequestSignatureHandler callback#2827
Open
mvanhorn wants to merge 1 commit intoslackapi:mainfrom
Open
feat(HTTPReceiver): add invalidRequestSignatureHandler callback#2827mvanhorn wants to merge 1 commit intoslackapi:mainfrom
mvanhorn wants to merge 1 commit intoslackapi:mainfrom
Conversation
Adds an optional invalidRequestSignatureHandler to HTTPReceiver, matching the callback added to AwsLambdaReceiver in PR slackapi#2154. When signature verification fails, the handler fires with the raw body, signature header, and timestamp. Defaults to a noop. Refs slackapi#2156
Member
|
Hey @mvanhorn 👋🏻 This sounds like a reasonable enhancement and thank you the explaining the motivation related to the I'll add a few maintainers to review this PR 👏🏻 In the meantime, can you please add tests for the new changes? I imagine that'll be one of the first requests from the reviewers as well. 🙇🏻 |
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 invalidRequestSignatureHandler to HTTPReceiver.
Why this matters
PR #2154 added this callback to AwsLambdaReceiver. HTTPReceiver was missing it. Now HTTP apps can hook into signature verification failures too.
Changes
HTTPReceiverInvalidRequestSignatureHandlerArgsinterface. New option inHTTPReceiverOptions. Constructor wiring with noop default. Fires in the signature-verification catch block with rawBody, signature header, and timestamp.ExpressReceiver support can follow in a separate PR.
Testing
Codex ran
npm testagainst the change. All existing tests pass.Refs #2156
This contribution was developed with AI assistance (Claude Code).