Repository navigation
feat(id): fail-closed provisioning gate for hosted enablement (#3403) - #12985
Merged
Merged
Conversation
Add src/provisioning.ts to pkgs/id/hosted-worker: a pure validator that grants a production signup/migration enablement plan only when the deployment configuration is validated against deployed-account evidence (the #2285 canary results and R2 API read-backs): - jurisdiction must be explicitly configured and supported — the design's policy constant is not a silent default; - enablement requires the jurisdiction-restricted Durable Object namespace — no unrestricted fallback; - evidence must prove restricted DO support and runtime/types support on the actual account ("unavailable US" refuses with jurisdiction_unavailable; anything unproven refuses as unverified); - the bucket's ACTUAL jurisdiction, read back from the R2 API, must match the configured jurisdiction — a binding's declared jurisdiction field is checked only for consistency and is never accepted as verification (the #2285 Half 1 lesson: a plain binding reached the EU bucket, and wrangler's --jurisdiction flag was silently ignored). 17 configuration tests cover every acceptance failure mode. The validator consumes evidence only; it probes no account and authorizes no deployment by itself.
|
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 20 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 Summary: ✅ CompletedThis 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 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.
What
The #3403 provisioning gate:
pkgs/id/hosted-worker/src/provisioning.ts— a pure, fail-closed validator that is now the only route to a hosted production signup/migration enablement plan. It validates a deployment configuration against deployed-account evidence (the #2285 canary results + Cloudflare API read-backs), per the #2283 design's provisioning-gate step and the 2026-11-22 decision record on #3403.Refusals (explicit
FailCloseddiagnostics, one per acceptance failure mode):missing_jurisdiction/unsupported_jurisdiction— the jurisdiction must be explicitly configured and supported; the design's policy constant is not a silent default.unrestricted_fallback_forbidden— enablement exists only on the jurisdiction-restricted DO namespace.jurisdiction_unverified/jurisdiction_unavailable— evidence must prove restricted DO support on the actual account; the acceptance-required unavailable US case refuses asjurisdiction_unavailable.unsupported_runtime_types/runtime_types_unverified— deployed runtime + generated types must be proven to support the restriction.bucket_missing/bucket_unverified/bucket_jurisdiction_mismatch— the bucket's actual jurisdiction, read back from the R2 API, must match. A binding's declaredjurisdictionfield is checked only for consistency and is never accepted as verification — the id: PoC: verify DO jurisdiction mechanics and confirm vendor residency guarantees #2285 Half 1 lesson (a plain binding reached the EU bucket; wrangler's--jurisdictionflag was silently ignored).On success it returns the exact plan: jurisdiction, DO binding, and the one verified bucket.
Evidence
test/provisioning.test.ts: 17 passed / 0 failed — both happy paths (us, eu) and every refusal above, including the id: PoC: verify DO jurisdiction mechanics and confirm vendor residency guarantees #2285 mixed-R2 scenario and "declared field agrees but no API read-back" still refusing.tsc --noEmit: run on the branch (results in the PR thread / issue note).Scope
The validator consumes evidence only — it probes no account, provisions nothing, and authorizes no deployment by itself. Wiring it into an actual provisioning/deployment surface (and the API provisioning that produces the evidence) is the named next slice on #3403; this PR deliberately does not close the issue.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.