fix(rest): unwrap getMetaItem envelope so nav capability gate fires (ADR-0057 D10)#2166
Merged
Merged
Conversation
…es (ADR-0057 D10)
GET /meta/app/:name returns an envelope { type, name, item: <app>, ... }, but filterAppForUser was applied to the envelope (whose .navigation is undefined) → it returned untouched, silently bypassing BOTH the requiredPermissions gate and the D10 requiresService gate. So Organizations/Invitations still showed in the Setup app even single-tenant. filterAppForUser + resolveRegisteredServices now unwrap the envelope (the list path already passed the raw app). Verified live (os dev): single-tenant hides Organizations/Invitations, multi-tenant shows them; +regression unit test.
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): 5 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.
Follow-up fix to ADR-0057 D10 (#2150).
The bug (you reported it)
Even on latest single-tenant code,
Organizationsstill showed in the Setup app sidebar.Root cause
GET /meta/app/:namereturns a metadata envelope{ type, name, item: <app>, ... }, butfilterAppForUserwas handed the envelope — whose.navigationisundefined— so it returned it untouched. That silently bypassed both the pre-existingrequiredPermissionsgate and the new D10requiresServicegate on this path. (The list path/meta/appalready passed the raw app, so it worked there — which is why the unit test passed but the live console didn't.)Fix
filterAppForUserandresolveRegisteredServicesnow unwrap theisMetaEnvelopeshape (filter the inner app, re-wrap). One unwrap point; the call site is simplified back.Verification (live
os dev, fresh build)nav_organizationsnav_invitationsnav_business_unitsConfirmed on both the by-name and list endpoints. Plus a regression unit test (envelope → inner app gated).
🤖 Generated with Claude Code