Add option to disable unauthed PUT requests - #1506
Conversation
🦋 Changeset detectedLatest commit: cebcd6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Needs attention — 1 issue in 1 file
The new unauthorizedResponse constant silently changes the in-band PUT signature-failure body from { code: "sig_verification_failed" } to { message: "Unauthorized" }. Any caller (Inngest backend, third-party integration) that pattern-matches on code will break. Everything else — parseAsBoolean handling, cloud-mode guard, as const safety — is correct.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<assessment>
The new `unauthorizedResponse` constant silently changes the in-band PUT signature-failure body from `{ code: "sig_verification_failed" }` to `{ message: "Unauthorized" }`. Any caller (Inngest backend, third-party integration) that pattern-matches on `code` will break. Everything else — `parseAsBoolean` handling, cloud-mode guard, `as const` safety — is correct.
</assessment>
<file name="packages/inngest/src/components/InngestCommHandler.ts">
<issue location="packages/inngest/src/components/InngestCommHandler.ts:2059">
The in-band PUT signature failure previously returned `{ code: "sig_verification_failed" }` but now returns `{ message: "Unauthorized" }` via the shared constant. Any caller that distinguishes this error by `code` will silently break.
</issue>
</file>
Tag @mendral-app with feedback or questions. View session
There was a problem hiding this comment.
LGTM
Previous comment about the in-band { code: "sig_verification_failed" } shape was addressed — the PR author confirmed the shape change is intentional (accepted). No new issues found. CI failures are pre-existing: middleware-validation: Test is a known Jest/ESM incompatibility (insight); Test examples (framework-nextjs-app-router) failed due to a transient npm ECONNRESET network error, not this PR.
Tag @mendral-app with feedback or questions. View session
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## inngest@4.5.0 ### Minor Changes - [#1522](#1522) [`ebeb4516`](ebeb451) Thanks [@Linell](https://github.com/Linell)! - Bump minimum `@opentelemetry/auto-instrumentations-node` to `0.75.0` to address [GHSA-q7rr-3cgh-j5r3](GHSA-q7rr-3cgh-j5r3) in the transitive `@opentelemetry/sdk-node` / `@opentelemetry/exporter-prometheus` packages. Note that upstream `auto-instrumentations-node@0.72.0` dropped bundled Fastify, instrumentation, so if you relied on it for tracing your Fastify routes, add `@opentelemetry/instrumentation-fastify` directly. ### Patch Changes - [#1540](#1540) [`10dad398`](10dad39) Thanks [@amh4r](https://github.com/amh4r)! - Fix attempt count not resetting during checkpointing - [#1544](#1544) [`f1ee6f34`](f1ee6f3) Thanks [@jacobheric](https://github.com/jacobheric)! - Allow `useRealtime` to accept direct client subscription tokens from `getClientSubscriptionToken()` when `channel` and `topics` are provided as hook options, and avoid reconnecting solely because an inline token factory or token object gets a new render identity. - [#1506](#1506) [`342a7369`](342a736) Thanks [@amh4r](https://github.com/amh4r)! - Add option to disable unauthed PUT requests - [#1518](#1518) [`fd71a95b`](fd71a95) Thanks [@Linell](https://github.com/Linell)! - Fix RetryAfterError not respected Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
Add an opt-out for unauthed
PUTrequests. This is via an env var orserveoption.Note that unauthed
PUTrequests are not a critical security issue. They merely tell the SDK to sync itself, but the SDK does not return sensitive info to the caller. Instead, the SDK sends an outgoing request to the Inngest API.Checklist
Note
Adds an opt-out for unauthenticated PUT (sync) requests via a new
enableUnauthedSyncserve option andINNGEST_ENABLE_UNAUTHED_SYNCenv var. When disabled in cloud mode, every PUT must carry a valid signature. Also refactors all 401 responses to share a singleunauthorizedResponseconstant and addsmethodto all signature-failure log entries.Written by Mendral for commit ffabd56.