Repository navigation
feat(id): hosted data-plane scaffold — binding-backed per-user Durable Object (#5199) - #5286
Merged
Merged
Conversation
…e Object (#5199) New isolated package pkgs/id/hosted-worker (slice 3 of #2852, child of #3811): a Worker front door that resolves an already-authenticated binding context to a per-user Durable Object named by the stable binding_id (hosted_binding.rs, #3808), routed only through the jurisdiction-restricted namespace (userStub takes ID and stub from the same restricted namespace; no unrestricted fallback — an unavailable restriction fails closed). UserDO bootstraps a versioned SQLite schema idempotently before serving, binds immutably to (binding_id, jurisdiction) on first routed request, and guards every route before side effects (unrouted, identity mismatch, runtime jurisdiction mismatch all fail closed). Minimal kv surface proves lazy creation and cross-binding isolation. Local workerd does not implement jurisdiction restrictions (namespace.jurisdiction() throws), so locally the app worker fails closed 503 jurisdiction_unavailable by design; UserDO behaviour is exercised through a documented test-only harness. No deployment, production binding, or billable resource — the real-account canary stays gated on #2285/#3403. Also reconciles the stale google:<sub>/userObjectId(sub) example in the jurisdiction design doc with the binding_id contract. Tests: node --test test/routing.test.ts 4/4; node smoke/smoke.mjs 15/15 (two wrangler dev passes); tsc --noEmit clean.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 4, 2026
This was referenced Nov 4, 2026
This was referenced Nov 8, 2026
This was referenced Nov 20, 2026
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.
Implements #5199 (slice 3 of #2852, child of #3811) — first local-only hosted data-plane vertical slice, queue task 8897.
What
New isolated package
pkgs/id/hosted-worker:src/worker.ts): resolves an already-authenticated binding context (X-Binding-Id/X-Jurisdictionfrom the authenticated internal caller; ceremony stays inpkgs/id/src/hosted_binding.rs), strips client-supplied internal headers, forwards to the per-user DO. No Iroh QUIC in the Worker.src/routing.ts): the only module touching the rawUSERSnamespace. Object named by the stablebinding_id(32 lowercase hex, minted in id: implement hosted account + ID binding ceremony (from #2046/#2852 slice 1) #3808) — never email, never a provider subject. ID and stub both come from the sameenv.USERS.jurisdiction(j)restricted namespace; no unrestricted fallback — unavailable restriction fails closed.src/user-do.ts): versioned SQLite schema bootstrapped idempotently inblockConcurrencyWhilebefore serving; first routed request binds the object immutably to (binding_id, jurisdiction); a common guard runs before any read/write (unrouted → 403, identity mismatch → 409, runtime-reported jurisdiction mismatch → 409). Minimal/v1/state+/v1/kv/<key>surface proving lazy creation and isolation. R2/metering/caps are later id: implement hosted Worker API + per-user DO provisioning and metering (from #2046/#2852 slice 3) #3811 steps, out of scope.google:<sub>/userObjectId(sub)sketch indoc/2026-11-01_jurisdiction_aware_user_store_design.mdnow states the binding_id contract per id: design: hosted provisioning + SSO→ID binding spec — account/binding records, challenge ceremony, delayed rebind, metering, export (from #2045) #2258/id: implement hosted Worker API + per-user DO provisioning and metering (from #2046/#2852 slice 3) #3811.Verified locally (laptop, workerd)
node --test test/routing.test.ts— 4/4 pass (validation, restricted selection, fail-closed).node smoke/smoke.mjs— 15/15 pass across twowrangler devpasses.tsc --noEmit— clean.Honest limits
Local workerd does not implement jurisdiction restrictions (
namespace.jurisdiction()throws), so the app worker fails closed503 jurisdiction_unavailablefor valid requests locally — by design (see README). DO behaviour is exercised via the documented test-only harness (wrangler.test.toml). No deployment, production binding/config, or billable resource is created; the real-account canary and residency proof stay gated on #2285 / #3403.Refs #5199 · queue task 8897 · lane code-p
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.