Skip to content

Conversation

@habara-k
Copy link
Contributor

Changes

  • Allow skipping signature verification for webhooks

Motivation

The signature returned with webhooks is calculated using a single channel secret. If the bot owner changes their channel secret, the signature for webhooks starts being calculated using the new channel secret. To avoid signature verification failures, the bot owner must update the channel secret on their server, which is used for signature verification. However, if there is a timing mismatch in the update—and such a mismatch is almost unavoidable—verification will fail during that period.

In such cases, having an option to skip signature verification for webhooks would be a convenient way to avoid these issues.

@habara-k habara-k requested a review from a team September 19, 2025 02:01
})();

if (!validateSignature(body, secret, signature)) {
// Check if signature verification should be skipped
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable name represents this enough, so inline comment seems unnecessary!

listen(TEST_PORT, m);
});

describe("With skipSignatureVerification functionality", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these tests run in parallel?

To avoid flaky tests, can we design the tests so they don't share state?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it would be fine just to have something like mWithDynamicSkip or others within the test. Each test should be able to define its own before~ and after~.

@habara-k habara-k requested a review from a team September 19, 2025 08:15
@habara-k habara-k added this pull request to the merge queue Sep 22, 2025
Merged via the queue into master with commit 4234b5a Sep 22, 2025
12 checks passed
@habara-k habara-k deleted the allow-to-skip-signature-verification branch September 22, 2025 05:51
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.

3 participants