feat(plugins): render contentAccess tables in the install consent dialog - #336
Open
mostafasadeghidev wants to merge 1 commit into
Open
Conversation
The install/upgrade consent dialog rendered requested permissions and networkAllowedHosts but silently omitted the manifest's contentAccess[] per-table allowlist, even though the SDK docs claimed the consent screen showed it. Add a "Content tables" section mirroring the "External hosts" section: - computeContentAccessDiff diffs entries by table into new / existing / dropped rows on upgrade; a mode added to an already-approved table promotes the row to "new" and the row calls out the newly requested modes, so a silent privilege expansion (read -> read+write) cannot hide behind "Already approved". - The @own-created marker renders human-readably as "Tables this plugin creates" instead of a literal slug. - usePluginsWorkspace now threads previousContentAccess from the installed plugin's manifest, the same way it threads previousNetworkAllowedHosts. - Shared allowlist-section styles (renamed from network-specific class names); dropped rows now strike through <code> labels too. - Docs: plugin-system.md consent-screen description, the contentAccess doc comment in the SDK manifest types, and the PLUGIN-001 e2e row. Verified with bun run build, bun run lint, and bun test on the touched suites (permissionReviewSection, pluginsAdmin, architecture gates); remaining suite failures reproduce identically without this diff. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mostafasadeghidev
marked this pull request as ready for review
August 3, 2026 03:54
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 changed
The plugin install/upgrade consent dialog rendered requested permissions and
networkAllowedHostsbut silently omitted the manifest'scontentAccess[]per-table allowlist — even though the SDK docs claimed the consent screen showed it. An operator could approve a plugin without ever seeing which content tables it may read or write. This adds a "Content tables" section mirroring the existing "External hosts" section.computeContentAccessDiff.ts): diffs entries by table into new / existing / dropped rows on upgrade, with the same ordering and badges as the host diff. One deliberate extension: an already-approved table whose upgrade adds modes (e.g.read→read, write) is promoted to "new" and the row calls out the newly requested modes — a silent privilege expansion cannot hide behind an "Already approved" badge.PermissionReviewSection.tsx): each row shows the table slug in code style with its modes ("Read, write"). The@own-createdmarker renders human-readably as "Tables this plugin creates" instead of a literal slug — forward-compatible: marker rows appear only once the marker's parser change lands (separate PR).usePluginsWorkspacethreadspreviousContentAccessfrom the installed plugin's manifest, exactly likepreviousNetworkAllowedHosts..allowlistSection/.allowlistHeader; dropped rows now strike through<code>labels too — which also fixes dropped host rows, which previously had no strikethrough. All tokens, CSS Modules only, no new colors.plugin-system.md, thecontentAccessdoc comment in the SDK manifest types, and the PLUGIN-001 e2e row.Why
contentAccessis a security surface: it is the per-table allowlist the host enforces on everycms.content.*call. Consent that hides it asks the operator to approve access they cannot see.Impact
Operators see exactly which tables a plugin wants, with per-mode diffing on upgrades. No behavior change for plugins; UI only.
Tests
9 new tests in
permissionReviewSection.test.tsx: 5 unit tests for the differ (including the mode-expansion promotion) and 4 render tests (marker row, upgrade badge/callout path). 23/23 pass.Verification
Remaining full-suite failures are pre-existing on this machine — verified by stashing the diff and rerunning: the failure list is byte-identical without these changes.