Repository navigation
[KS] API: privileged helper, admin prompt, XPC (#138) - #441
Merged
sethwebster merged 2 commits intoOct 13, 2026
Merged
Conversation
- @legendapp/spark/privileged-helper: availability, status, register, unregister, open Login Items, requestAdminAuthorization and sendPrivilegedHelperMessage, with typed PrivilegedHelperError reasons - SMAppService launch daemons; requiresApproval is a state, not an error - admin prompt via Authorization Services; the rights travel to the helper, which checks them itself without UI - XPC both ways checked by code signature (team + app identifier on the helper's listener, team on the app's connection); the app sends nothing until the helper's verification reply passes its requirement - helper side (helper/SparkPrivilegedHelperService.m) for app helpers - unsigned/ad-hoc builds report unsigned and stop before ServiceManagement - macos.privilegedHelpers opts helpers in; spark build writes their LaunchDaemons plists, nothing otherwise - driver mode simulates registration, approval, the prompt and the connection: simulatePrivilegedHelper / testPrivilegedHelper - Windows typed unsupported (#440); threat model in docs/privileged-helper.md
…goldens (#138) Processes and IPC > Privileged helper shows availability and status, registers and unregisters, opens Login Items, requests and releases admin rights and sends whoami. Driver flows cover availability, approval states, the prompt and the connection via the simulation; the real path is a manual flow on a team-signed build with the Kitchen Sink helper. Goldens for light/dark x en/ar; infra-shell-catalog goldens re-approved for the area count.
sethwebster
force-pushed
the
seth/ks-138-privileged-helper
branch
from
October 13, 2026 03:10
dcc5535 to
1218aea
Compare
This was referenced Oct 13, 2026
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.
Refs #138
Adds
@legendapp/spark/privileged-helper(macOS): a launch daemon the app ships, registered through SMAppService with its Login Items approval states; the system admin prompt (Authorization Services), whose rights travel to the helper, which checks them itself; and JSON over XPC with each side checking the other's code signature. Unsigned/ad-hoc builds reportunsignedand stop before ServiceManagement.macos.privilegedHelpersopts helpers in;spark buildwrites their LaunchDaemons plists, nothing otherwise. Windows is typed unsupported (#440). Guide and threat model:docs/privileged-helper.md.Security details:
spark build/spark packagesign it so, andspark packagechecks it). The app sends nothing until the helper's verification reply passes; interrupted connections are marked stale synchronously and verified again.AdminAuthorization.expiresAtreports whensystem.privilege.admin's timeout lapses them (300 s); lapsed rights rejectauthorizationExpired(app-side, and helper-side before the handler) instead of a silentauthorized: false. The helper checks with flags 0 (no interaction, no extending).Kitchen Sink: Processes and IPC > Privileged helper, PROC checks, driver flows, a manual real-path flow (team-signed build with
examples/kitchen-sink/helpers/privileged-helper), goldens.Verification (run in this session, after rebasing onto the current base)
bun run typecheck: passesbun run test: 1974 passed, 2 failed (accepted: node-runtime asdf shim; motion-native frames check)tests/privileged-helper-native.test.ts: real XPC round trips against an anonymous listener in the test process (test binary signed ad hoc with the hardened runtime): both signature checks, the hardened-runtime/get-task-allow check (a non-hardened build of the binary fails it), a lapsed authorization rejected before the handler, helper errors, timeout, abort; the simulation; a build without the driver; the Kitchen Sink helper compiling.tests/packaging.test.ts: plists only on opt-in, helpers signed with their labels.bun run e2e:lint: 0 problemsks-lock native: alle2e/flows/processes-ipcmacOS flows pass (Windows skipped, manual awaiting sign-off),accessibility/audit-processes-ipc(4) andinfra/catalog-driver(4) pass; the catalog still reads 26 of 38 areas, so its goldens did not change after the rebasesecurity/entitlements.yaml(SEC-ENT-01) passes on a release build of this branch; it has noContents/Libraryprivileged-helper-real.yaml, needs Seth on a Developer ID build): the root-side authorization check with a granted right, the real admin prompt, SMAppService registration/approval, rights lapsing after 300 s, and the Developer ID client requirement. Automated runs never reach a granted right.Screens