Skip to content

fix(server-sdk): report a missing sha256 claim in WebhookReceiver - #743

Open
ANDROIDHASSAN wants to merge 1 commit into
livekit:mainfrom
ANDROIDHASSAN:fix/webhook-missing-sha256
Open

ANDROIDHASSAN wants to merge 1 commit into
livekit:mainfrom
ANDROIDHASSAN:fix/webhook-missing-sha256

Conversation

@ANDROIDHASSAN

Copy link
Copy Markdown

WebhookReceiver.receive compares claims.sha256 with the body hash directly, so a token that has no sha256 claim at all fails with "sha256 checksum of body does not match". That points at the body, when the problem is the token (for example one signed by a different service, or by an AccessToken that never set sha256).

It now checks for the claim first and throws "sha256 was not found in the token", the message the Python server SDK uses (livekit/python-sdks#860). A token with a claim that does not match the body still gets "sha256 checksum of body does not match".

Tests in WebhookReceiver.test.ts:

  • reports a token without a sha256 claim as such: fails on main (received "sha256 checksum of body does not match"), passes now.
  • rejects a body that does not match the token hash: the mismatch message is unchanged; passes on both.

vitest run src passes in the node, edge-runtime and happy-dom environments (45 tests); eslint, prettier --check and tsc --noEmit pass. Changeset included (patch).

A token without a sha256 claim was reported as "sha256 checksum of body
does not match", which points at the body rather than the token. Check
for the claim first, with the message the Python server SDK uses.
@changeset-bot

changeset-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 36226ad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
livekit-server-sdk Patch
agent-dispatch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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