Repository navigation
fix: let plugin pages run the actions their plugin may invoke - #2003
Open
ZacharyZcR wants to merge 1 commit into
Open
ZacharyZcR wants to merge 1 commit into
ZacharyZcR wants to merge 1 commit into
Conversation
Since plugin pages draw in frames, the frame policy only let one run its own plugin's actions, so Operations Center could not run anything else or fill optionsFrom pickers. A plugin with operations:invoke can already run the actions in its invokes list from its backend, so its frame may run those too, right after a click and as the person who clicked, which keeps the origin, approval rules and history the same as the old in-shell view.
|
AI review | Looks safe to merge Allows framed plugins to execute actions listed in their manifest's operations:invoke capability, enforcing a user click requirement to prevent automatic execution. The change is safe, well-tested, and aligns with the plugin architecture. Reviewed 966f3b9. AI can be wrong, a maintainer still decides. Comment |
This branch has not been deployed
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.
Fixes Termix-SSH/Plugin-Operations-Center#11.
Problem
Since 26.11.2 Operations Center draws in a frame. The frame policy's only run rule is
POST ^/operations/{id}\.…/run$, so a frame can run only its own plugin's actions. Operations Center can't run any other plugin's action ("Not available to plugin views"), and itsoptionsFrompickers stay empty. Automations' test runs hit the same rule.Why not route runs through Operations Center's backend
ctx.operations.invokeworks, but the run's origin becomesplugin/via. Two things then change for a person clicking Run:builtInapprovals denychange/destructiveruns from a plugin origin unless theviais trusted.uistop matching.History would also say the run came from a plugin, not from the person.
Change
checkCoreRequesttakes the list of actions the plugin may invoke. The shell builds it from the manifest:operations:invokepluscontributes.operations.invokes, read with the SDK's owninvokeAllowed.A
POST /operations/<action>/runfor an action on that list is allowed withuserAction: true. It goes out with the user's session, so the server seesuiand applies RBAC, approvals and history exactly as for the old in-shell view and the CLI.This adds no authority. The same plugin can already run those actions as the current user from its backend, and the click check means a frame can't fire runs on its own.
Unchanged:
operations:invoke, including the hostile-frame fixture, are refused as before.frame-core-rules.jsonis untouched, so the mobile app's copy keeps refusing these runs until it adds the same check.Tests
frame-policy.test.ts: runs on the invokes list (*,docker.*) are allowed withuserAction. Refused: actions not on the list, an empty list,GET, cancel/approve paths, extra segments, encoded dots.vitest run src/ui/tests/plugin-host/frames/: 192 tests pass.tsc -p tsconfig.app.jsonand eslint are clean.