Skip to content

perf: verify webhook signatures in chunks - #4324

Merged
marcuswood-oai merged 2 commits into
mainfrom
codex/incremental-webhook-verification
Nov 30, 2026
Merged

marcuswood-oai merged 2 commits into
mainfrom
codex/incremental-webhook-verification

Conversation

@marcuswood-oai

Copy link
Copy Markdown
Contributor

Changes being requested

Feed the webhook header prefix and body chunks into the same HMAC. Validate byte payloads with an incremental UTF-8 decoder. The signature format is unchanged and there is no new payload size limit. For malformed input, Unicode error offsets can be relative to the chunk.

Additional context & links

All 238 webhook tests passed, including sync and async cases with split UTF-8 characters, truncated input, and large text and byte payloads. Ruff and ty passed for the changed files. With a synthetic 4 MB ASCII byte payload, peak extra traced memory during verification dropped from 12 MB to 132 KB.

@marcuswood-oai
marcuswood-oai requested a review from a team as a code owner November 24, 2026 00:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T20:33:57.499829Z 567b9fc New commits
🔒 Security Review ✅ Completed 2026-11-30T20:34:53.344167Z 567b9fc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@markstuart-oai markstuart-oai 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.

The chunked HMAC signs the same bytes and keeps strict UTF-8 validation. The new tests cover split characters and truncated input.

The memory test could run in a fresh process so an existing tracemalloc session cannot skew its result.

Static review only. Hosted checks were still running.

@marcuswood-oai
marcuswood-oai added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 0d74230 Nov 30, 2026
26 checks passed
@marcuswood-oai
marcuswood-oai deleted the codex/incremental-webhook-verification branch November 30, 2026 20:43
@openai-sdks openai-sdks Bot mentioned this pull request Nov 30, 2026
shubhhh19 pushed a commit to shubhhh19/openai-python that referenced this pull request Nov 30, 2026
Automated Release PR
---


##
[3.61.0](openai/openai-python@v3.60.0...v3.61.0)
(2026-11-30)


### Features

* **api:** deprecate Evals and saved prompt references
([openai#4351](openai#4351))
([d46cf5b](openai@d46cf5b))


### Bug Fixes

* honor module base URL changes for WebSocket connections
([openai#4319](openai#4319))
([3146a6d](openai@3146a6d))
* recheck browser cancellation after approval callbacks
([openai#4322](openai#4322))
([0633d4f](openai@0633d4f))


### Performance Improvements

* verify webhook signatures in chunks
([openai#4324](openai#4324))
([0d74230](openai@0d74230))


### Chores

* **deps-dev:** bump pydantic from 1.10.26 to 2.14.3
([openai#4314](openai#4314))
([1da66c4](openai@1da66c4))
* **deps:** bump actions/create-github-app-token from 3.3.0 to 3.4.0
([openai#4345](openai#4345))
([e9d2ce6](openai@e9d2ce6))
* **deps:** bump astral-sh/setup-uv from 10.3.3 to 10.4.0
([openai#4347](openai#4347))
([06d1f4d](openai@06d1f4d))
* **deps:** bump openai/codex-action from 1.13 to 1.14
([openai#4346](openai#4346))
([0c1b4e7](openai@0c1b4e7))
* **deps:** bump the codeql group with 2 updates
([openai#4344](openai#4344))
([2d9aab6](openai@2d9aab6))
* **deps:** bump websockets from 15.0.1 to 16.1.1
([openai#4313](openai#4313))
([194a6c8](openai@194a6c8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
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