Fail closed at the tenant request boundary - #1658
Draft
yyyyaaa wants to merge 1 commit into
Draft
Conversation
This was referenced Aug 5, 2026
yyyyaaa
force-pushed
the
research/graphile-density-stack-05-request-admission
branch
from
August 5, 2026 02:57
d04cda8 to
ec24b46
Compare
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
Part 5 of 6 in the draft tenant-density stack: #1654 → #1655 → #1656 → #1657 → #1658 (this PR) → #1659. It integrates the lower-level runtime, cache, plugin, and exact-build contracts at the HTTP/WebSocket request boundary.
This layer makes the secure dedicated-instance design enforceable in the server. It does not treat an exact fingerprint as a sandbox, does not trust RLS to route schemas, and does not let routing labels select a cached tenant instance.
What changes
BYPASSRLS,CREATEROLE,CREATEDB, replication, unsafe inherited/SET ROLEpaths, schema/object ownership, unapproved object privileges,SECURITY DEFINER, owner-rights views, foreign/materialized views, and unsafe stored-expression dependencies.Validation
Why this remains a draft
The audit found a genuine production blocker: route, RLS, auth, feature, CORS, public-key, and WebAuthn data are still read through separate statements without one immutable revision. Exact identities prevent arbitrary cross-tenant pool aliasing, but a handover/revocation can leave one in-flight HTTP request on an old snapshot, and an accepted WebSocket can retain stale authorization. Production needs an atomic
TenantSecurityContractV1, generation retirement/socket revalidation, an authoritative per-APIauthRequiredcontract, and proof against disposable copies of the real production schemas.