0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/crates/engine/tests/auth.rs
Wing 8c8535b7c1
Plugins and templates: consent bound to capabilities, engine-held decisions, hardened runtime (#1139)
* Plugins and templates: consent bound to capabilities, engine-held decisions, hardened runtime

- Consent binds a capability digest (programs, MCP servers, tools, network hosts, services, module replacement); it re-asks only when that grows. UI targets never ask.
- "You" is this device's key; code-running powers are never auto-granted; keys are revoked on sign-out and rotation, listed and revocable in Settings, and new keys are announced.
- Decisions and signing need a one-time review the consent window holds; agents get a scoped IPC token; agent-created chats can't exceed their creator's access; peers can't allow; relayed calls carry the edge-verified device.
- Runtime: text-only Luau, one command policy (env allow-list, hardened git/gh), plugin network blocks private ranges unless declared, safe path joins, verified snapshots, hardened built-in Git service.
- App: ui.change can't override modules, Settings sealed, decision controls protected, plugins get ids and resolve data through grants, consent sheet hardened, dev switches debug-only.
- Templates: unapproved templates run as previews with Keep/Revert, a host-owned way back on every platform, safe mode, no builtin-theme spoofing, increasing versions.
- Edge: step-up for key registration and account deletion, key list/revoke, reserved names, invitation/image/admin limits, relay device stamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Signing keys register on the first sign-in, revocations act at once, setup and layout fixes

- A sign-in registers this device's key with its fresh ticket, also on a local-mode engine; new keys are noticed at start; a revoked own key rotates at once (peers are told), drops code-running grants and shows a notice.
- Calls during unfinished account setup answer setup_incomplete; plugins and templates load once an organization is chosen.
- The host strip's wrapper fills the window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Engine: only plugin and template calls answer setup_incomplete during onboarding; everything else waits as before

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-03 11:33:36 -07:00

1048 lines
39 KiB