Skip to content

fix: prevent plugin detail modal crash on object-shaped RBAC required_roles - #115

Merged
guimou merged 1 commit into
mainfrom
dev
Aug 10, 2026
Merged

guimou merged 1 commit into
mainfrom
dev

Conversation

@guimou

@guimou guimou commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a crash (React error #31objects are not valid as a React child) when opening the detail modal for a plugin whose plugin.yaml declares required_roles as full policy-rule objects ({description, apiGroups, resources, verbs}) instead of the canonical descriptive strings. This plugin's own manifest was the only one deviating from the string convention, so it was the only one that crashed.

Changes

  • Defensive renderPluginDetailModal coerces each required-role entry to a display string via a new formatRequiredRole() helper (uses description, else summarizes apiGroups/resources: verbs), so no third-party manifest can crash the admin catalog.
  • Types — widened RBAC requiredRoles (frontend + BFF) to accept string | rule-object.
  • Manifest — converted this plugin's plugin.yaml required_roles to the canonical string form used by the charter schema and other plugins (display-only metadata; chart RBAC unaffected).
  • Tests — added a regression test for the rule-object shape.

Verification

  • Frontend: 236 tests pass, typecheck + lint clean
  • BFF: 181 tests pass, typecheck + lint clean

No version bump (0.1.4 was prepared but not tagged/released).

Opening the plugin detail modal for a plugin whose plugin.yaml declares
`required_roles` as policy-rule objects ({description, apiGroups, resources,
verbs}) instead of strings crashed the modal with React error #31 (objects
are not valid as a React child).

- Coerce each required-role entry to a display string via formatRequiredRole()
  (uses description, else summarizes apiGroups/resources: verbs).
- Widen the RBAC types (frontend + BFF) to accept string | rule-object.
- Convert this plugin's own plugin.yaml required_roles to the canonical
  string form used by the charter schema and other plugins.
- Add a regression test for the rule-object shape.

---
Signed-off-by: Guillaume Moutier <guimou@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@guimou
guimou merged commit 87c0dcf into main Aug 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant