fix(github): remove raw webhook payload logging#500
Open
privatenumber wants to merge 1 commit into
Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Context
The GitHub adapter logged a preview of incoming webhook request bodies while handling webhooks.
Raw webhook payloads can contain repository metadata, user-authored issue or pull request text, URLs, installation details, and other provider-controlled content. Even at debug level, SDK logging should avoid copying raw provider payloads into application logs by default.
Problem
Debug logging should provide useful operational context without changing the privacy boundary of webhook data.
The previous log emitted a raw body preview before signature verification. That meant an application with debug logging enabled could record payload content from both valid GitHub webhook events and invalid requests that were later rejected.
This is unnecessary for normal webhook troubleshooting. Derived request metadata is enough to understand routing and parsing failures without retaining payload text.
Changes
The GitHub adapter no longer logs raw webhook bodies or body previews.
Webhook logs now use bounded request-shape metadata:
bodyBytescontentTypeeventTypesignaturePresentjsonParseStatusfor invalid JSONThe change preserves signature verification, ping handling, JSON parsing, and event routing behavior.
Regression tests cover invalid signature, invalid JSON, and valid webhook paths with token-shaped and customer-slug sentinel strings in the payload. The tests assert those sentinels, the full raw body, the old raw-body log message, and
bodyPreviewdo not appear in logger calls.A patch changeset is included for
@chat-adapter/github.Verification
pnpm turbo build --filter @chat-adapter/githubpnpm --filter @chat-adapter/github testpnpm --filter @chat-adapter/github typecheckpnpm checkgit diff --check