Repository navigation
Give third-party plugins their own entry settings and auth service - #12260
chessing234 wants to merge 2 commits into
Conversation
Automated AI review
Outcome: Both parts of #10969 are addressed for the plugin's own facade, but the new authentication-service fallback also makes lock and polkit services reachable from the host Verified (pinned head
Authentication services become reachable from
|
| Probe (headless model, verbatim base/head functions) | Base | Head |
|---|---|---|
Unshadowed plugin root resolves shell to ShellRoot |
yes | yes |
shell.pluginServiceFor("omarchy.lock","omarchy.lock") returns the lock service |
no | yes |
Same, from a panel loaded through an Instantiator/Loader |
no | yes |
Control: plugin root declares property var shell |
not reached | not reached |
With an active lock clone, shell.pluginServiceFor(cloneId, cloneId) returns the clone the same way. The polkit service is exposed the same way. Two other new paths lead to the same object from ShellRoot: shell.panelLoaders[id].item.service and a cached facade in shell._pluginShellApis.
Impact: The lock service exposes enteredPassword/pendingPassword, and its finishUnlock() sets sessionLock.locked = false without checking authentication (shell/plugins/lock/Service.qml). The project documents this boundary in shell.qml ("without adding a traversable property or QObject parent back to the host shell"), docs/omarchy-shell.md, manual/32-shell-plugins.md and agents/skills/shell-dev.md ("Do not expose authentication services through new third-party-facing properties"). Plugins already run unsandboxed with user file and process access, so this is not a remote or cross-user issue. It removes the in-process credential protection that the base commit still has.
Suggested change: Keep the AuthServiceStore lookup out of any function or property reachable from ShellRoot. Moving it into the facade closure alone does not close the gap, because _pluginShellApis and panelLoaders also hang off ShellRoot. One option is to keep auth-capable UI inside the service object, as omarchy.lock already does. Another is to give the overlay a narrow, non-credential API instead of the service. Add a runtime negative test showing that shell.pluginServiceFor(authId, authId) stays null. The current text-pattern assertion pins the exact new fallback line.
entrySettings shares nested objects with host config after a refresh
pluginEntrySettings() copies only top-level keys. The initial value passes through createObject and arrives detached. The refresh in syncPluginApis() is a plain JS assignment, so nested arrays and objects become the host's live shellConfig objects.
s = shell.entrySettings // after any config refresh
s.favorites.push(x) // mutates shell.shellConfig in place
shell.updateEntryInline(id, s) // → false, nothing written (config already "equal")
Impact: A nested read-modify-write, like the pattern behind #10907, is silently not saved after the first refresh. For a replacement bar the entry is the bar option, so entrySettings.layout is the host's live shellConfig.bar.layout. The docs say third-party configuration snapshots are detached.
Suggested change: Return a JSON deep copy with id removed, the same pattern publicBarConfig() and publicIdleConfigFor() already use.
Note: Widgets rendered by a third-party replacement bar get their facade from pluginShellForBarEntry(), which never sets entrySettings, so it stays {} there. Their settings property still carries the entry, so this matters only if entrySettings is meant to be available to bar widgets too. If so, set it there. If not, document the exception.
Review information
Test scope: Source review of the pinned head, merge-base and current quattro, plus Quickshell v0.3.1 and qtdeclarative source for QML context resolution. Isolated headless Quickshell 0.3.1 runs used a model built from verbatim base/head functions and the real AuthServiceStore.js/PluginShellApi.qml, with a stub lock service. It was not the full shell. No desktop session was run, the polkit password-field path was not exercised, and the repository test script was not executed.
AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted follow-up questions, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
Resolve own lock/polkit instances only inside the facade closure and the host panel Loader. Deep-copy entrySettings so nested config is detached.
|
addressed the review: auth services no longer come back through pluginServiceFor on ShellRoot, and entrySettings is a deep copy now. |
70c62cb to
72eb616
Compare
Automated AI review
Outcome: This follow-up checks head
Verified (isolated headless model built from verbatim head functions, stub services):
Authentication services are still reachable from
|
Probe from a plugin without its own shell property |
Scenario | Base | Head |
|---|---|---|---|
shell.pluginServiceFor("omarchy.lock", "omarchy.lock") |
stock | null | null |
shell.pluginShellFor({ id: "omarchy.lock" }).serviceFor("omarchy.lock") |
stock | null | lock service |
shell.createScopedPluginShell({ id: "omarchy.lock" }, "k", true, false).serviceFor("omarchy.lock") |
stock | null | lock service |
shell.pluginShellForId("user.lockclone").serviceFor("user.lockclone") |
lock clone | null | clone service |
shell._pluginShellApis["user.lockclone"].serviceFor("user.lockclone") |
lock clone | null | clone service |
shell.panelLoaders["user.lockclone"].item.service |
lock clone | null | clone service |
shell.pluginShellFor({ id: "omarchy.polkit" }).serviceFor("omarchy.polkit") returns the polkit service in the same way. The two stock-install rows that return the service at head also returned it at 70c62cb, so 72eb616 did not introduce them. They are now the main remaining path, and they need no clone.
Impact: Unchanged from the earlier review. The lock service exposes enteredPassword/pendingPassword. Its finishUnlock() sets sessionLock.locked = false without checking authentication (shell/plugins/lock/Service.qml, from source; the call was not run). manual/32-shell-plugins.md describes authentication state as protected "by keeping those services outside the reachable host object graph", and agents/skills/shell-dev.md says "Do not expose authentication services through new third-party-facing properties."
Suggested change: Keep anything that can return an authentication service off every object reachable from ShellRoot:
- the facade factories (
pluginShellFor,createScopedPluginShell,pluginShellForId); - the
_pluginShellApiscache; - panel items reachable as
panelLoaders[id].item.
Handing the overlay the raw service always exposes it through panelLoaders. The earlier options still apply: keep auth-capable UI inside the service object, as omarchy.lock does, or give the overlay a narrow proxy without credential fields or unlock actions. Refusing the fallback only for ids whose installed manifest is first-party would close the stock path and leave the clone paths open. A runtime negative test from a plugin without its own shell property could assert that both shell.pluginServiceFor(authId, authId) and shell.pluginShellFor({ id: authId }).serviceFor(authId) stay null. The new assertion only checks that the text of the pluginServiceFor body does not mention AuthServiceStore.
Semantic conflict with open #12996
#12996 adds reinjectLoadedPanelShellApis(), called from every syncPluginApis(), which sets item.service = shell.serviceFor(id). The two PRs merge without a textual conflict, and both PRs' tests pass on the combination. serviceFor never returns authentication services, though. In the model, a lock clone overlay's service goes from the clone service to null after the first sync, both on head plus #12996 and on quattro plus both PRs.
Impact: This applies only if both PRs land. A lock clone overlay that reads service, the pattern from #10969, would lose it on the first plugin sync after loading. An overlay that calls shell.serviceFor(ownId) on its own facade keeps working.
Suggested change: Whichever PR lands second could have the reinjection leave service untouched, or make both injection sites resolve service the same way (subject to the authentication suggested change above).
entrySettings notes
Optional test improvement: The three new entrySettings assertions are text matches. Three mutants of pluginEntrySettings each still pass the whole test script: one returns ({}), one returns the live entry (which brings back the earlier nested-sharing bug), and one keeps id. A config-backed check could read a scoped facade's entrySettings, assert that it equals the entry without id, mutate a nested value and confirm that host config is unchanged. That would cover the lookup, the deep copy and the id removal.
Documentation: docs/omarchy-shell.md and agents/skills/shell-dev.md list what the third-party facade provides but do not mention entrySettings. A sentence on it (a JSON snapshot of the plugin's own entry, id removed, refreshed on config change) would make it discoverable. The earlier note still applies: widgets hosted by a replacement bar get their facade from pluginShellForBarEntry(), which never sets entrySettings. Their settings property still carries the entry, so this matters only if entrySettings is meant for bar widgets too. If it is, it could be set there. If not, the exception could be documented.
Review information
Test scope: Source review of head 72eb616, previously reviewed 70c62cb, the base, current quattro and open #12996. Isolated headless Quickshell 0.3.1 runs used a model built from each source's verbatim host functions, including merges onto quattro and with #12996. The model used the real plugin registry, AuthServiceStore.js, PluginShellApi.qml and lock/polkit manifests, with stub service and overlay objects. It was not the full shell. No desktop session was run, finishUnlock() was not called, and the real polkit agent was not exercised. The PR's test script passed in a sandbox, where its compositor-dependent section was skipped.
AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
|
Two notes from going through this again:
|
|
Omabot looked at this pull request at Part of the reason is that the pull request does two separate things: it lets third-party plugins read their own entry, and it lets lock and polkit clones reach their own authentication service. A change that fixes one thing and adds another should be two pull requests. @jandrusk's suggestion to split it would also settle this: the Because the classification is unsettled, nothing here was run on a worker and the open finding about authentication services being reachable from |
Summary
entrySettingsonPluginShellApi(and refresh it with shell config) so third-party non-bar plugins can read their ownshell.jsonentry fields instead of silently seeing{}.AuthServiceStoreinpluginServiceFor, and use that path when injectingserviceinto panel/overlay loaders so lock/polkit clones are not stuck withservice === null.Closes #10969.
Test plan
bash test/shell.d/plugin-auth-boundary-test.shshell.entrySettingsserviceand can call into it