feat(serve): thread api.enforceProjectMembership to the dispatcher (ADR-0024 D9)#2329
Merged
Conversation
…DR-0024 D9) serve.ts built the dispatcher with `scoping` but never threaded `enforceProjectMembership`, so per-project membership (the `sys_environment_member` 403 gate) was always forced ON whenever project-scoping was on. Read it from the app's `api` config and pass it through, so a host can opt OUT — env-native auth IS the membership (ADR-0024 D9) — via `api.enforceProjectMembership: false`. Undefined keeps the existing default (= `enableProjectScoping`): backward-compatible. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
Threads
api.enforceProjectMembershipfrom the served app's config through tocreateDispatcherPlugin(it was sourcingenableProjectScoping/projectResolutionbut silently dropping membership).Why:
enforceProjectMembershipdefaults toscoping.enableProjectScoping— so thesys_environment_member403 gate was forced ON for any project-scoped host with no way to opt out. ADR-0024 D9 makes env-native auth the membership (a valid env session = a member; cross-env is already protected by per-env sessions), so a host needs to disable the redundant cloud-mirror gate. This adds that seam.Backward-compatible:
apiConfig.enforceProjectMembershipisundefinedfor every app that doesn't set it → the dispatcher keeps its existing default (= enableProjectScoping). Only an app that explicitly setsapi.enforceProjectMembership: falsechanges behavior.Consumed by cloud
objectos-stack(forthcoming PR) to retire thesys_environment_memberaccess gate.🤖 Generated with Claude Code