fix(app): enforce allowManageExtensions and allowControlSettings - #3113
fix(app): enforce allowManageExtensions and allowControlSettings#3113benjaminshafii wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Validation: real app, isolated Linux sandbox, matched A/BAll nine branches of this series were merged into one integration branch (
Step 4 fails identically on clean Validated frames: A real regression this caught, in this seriesBooting the real app initially failed with:
Static verification on the merged resultHonest gaps
|
Correction to my validation note aboveIn the "Honest gaps" section I wrote that local macOS That diagnosis was wrong. I tested it properly afterwards and disproved it:
So dev Electron currently opens no window on this macOS host regardless of profile, keychain, or worktree. It is pre-existing, unrelated to this series, and I have not root-caused it. The same commits do open a window in a clean Linux sandbox, which is where the validation above was run — so the core-flow evidence in this comment stands unchanged. The shared-profile collision is nonetheless real (two worktrees genuinely cannot both hold the lock, and the loser lingers with an open CDP port and no log line). That is fixed separately in #3124, which adds Flagging it because the original wording would have sent a reviewer chasing the wrong cause. |
…desktop-policies # Conflicts: # apps/app/src/react-app/domains/settings/pages/mcp-view.tsx
|
Merged |
Problem
Two desktop policies are presented to organization administrators in the Cloud dashboard and are completely unenforced by the desktop app. An admin can toggle them and nothing happens.
Verified:
allowManageExtensionsandallowControlSettingsare declared inpackages/types/src/den/desktop-policies.ts(bothdefaultValue: true, both withuserNoticecopy already written) and had zero reads anywhere inapps/app/src. OnlyallowBuiltInExtensionswas enforced.This is a trust and compliance defect: we tell administrators they have a control they do not have. It came up directly in an enterprise review, where the ask was "we don't want to expose everything to them" — and we said the policy existed.
Change
Enforce both, reusing the existing
allowBuiltInExtensionsidiom (useDesktopRestriction, explanatory banner, per-carddisabledReason) and each policy's ownuserNoticestring rather than new copy.Gated: Add Custom App · From GitHub · quick-connect install · local extension config slots · MCP Remove/Enable/Disable · skill Uninstall · plugin Add/Remove · plugin package input · sidebar Settings item · command-palette Settings/Extensions/Appearance/Updates · typed
/settings/*routes.Deliberately left open — this is the important half:
An over-broad implementation here would trap a user in an unusable app with settings locked, which is worse than the bug being fixed. Blocked routes render a notice with escape paths instead of dead-ending.
Both policies default to
trueDefault behavior is unchanged. An organization with no policy data sees zero difference — covered by test.
Verification
New
apps/app/tests/desktop-policy-gates.test.tsproves, per policy: absent policy leaves the affordance enabled;falsedisables it and surfaces theuserNotice; and the non-blockable routes stay reachable.Note for the reviewer
Trivially conflicts with #3111 in
mcp-view.tsx— two adjacent additions, both wanted. Verified resolved and green in an integration branch merging all of this work together.