Repository navigation
Conversation
Snapshots of principals other than local now live in auth-states/p/<sha256(subject)[:16]>/, so one principal saving a name another uses creates its own snapshot instead of replacing theirs. Restores require the caller's manifest of the requested kind, saving either kind replaces the caller's other kind and identity seed, and identity seeds are read and written per principal. Flat manifests with a non-local owner move into their owner's directory on first access, payloads first and the manifest last, so an interrupted move resumes. Part of #61
…rd and the CLI
Agents get delete_saved_auth for their own snapshots. Operators get
GET /auth-states and an audited DELETE /auth-states/{owner}/{name},
a Saved logins dashboard page with a confirmed delete and live
refresh over a new auth-states topic, and browserhive saved-logins
list | rm.
Fixes #57
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.
What / why
Fixes #57. Part of #61. Stacked on #64 (
fix/auth-state-names): the base is that branch until #64 merges, then this is rebased ontomain.Saved logins could be saved and restored but never deleted:
AuthStateStore.remove()had no caller. This adds deletion everywhere an operator or agent works.delete_saved_auth {name}. A new, additive tool (D-12;since: 0.3.0), destructive and idempotent. It deletes the caller's own snapshot of that name, either kind, together with its identity seed, and answers{name, deleted: true}.AUTH_STATE_NOT_FOUND:No saved auth snapshot named '<name>'. …, so there is no oracle.details.kindis now optional, because this request names no kind.GET /auth-states(sessions:read) lists every principal's saved logins: name, kind, owner, size, saved_at, source_session_id, andsource_session_slug(nullonce the session's record is gone).DELETE /auth-states/{owner}/{name}(sessions:write) writes anoperator_actionsrow (delete/auth_state/<owner>/<name>, with kind, size and source in the details). A missing login answers 404AUTH_STATE_NOT_FOUND.auth-states, carriesauth_state.changed(published by the store after every save and delete). OpenAPI and the API and WebSocket reference docs are regenerated.RelativeTime) and the source session (a link while it exists, otherwise "· deleted").Delete saved login <name>?,Owner: <owner>. … Sessions already restored from it keep running.A success toast follows, and the page refreshes live over the new topic.browserhive saved-logins list | rm <name> [--owner <subject>]talks to a running server, likechannels. Without--owner,rmdeletes the one principal's login of that name, and stops naming the owners when several use it.saved-logins, and the security guide notes that there is no automatic expiry. Spec 02 §3.11 and §6, spec 03 §4.6.1 and §6.6, spec 04 §12.7.1 and the nav order, spec 08 §7.1 and spec 12 are updated.Changeset: minor.
Screenshots
Taken by driving the built server in headless Chromium, at desktop 1280×800 and phone (Pixel 7), in light and dark. They are in the owner's local scratchpad at
scratchpad/security-fix-release/saved-logins-screens/:desktop-light.png,desktop-dark.png,phone-light.png,phone-dark.png: the list (local logins plus two other principals, deleted source sessions, a login saved 47 days ago);*-confirm.png: the delete confirmation;empty-*.png: nothing saved;zero-results-*.png: a search with no match.Tests
listAllacross principals, including a stray manifest that is not listed;removeSnapshotof another owner (seed included; the other owner's login of the same name stays);removewith a partial file set;auth_state.changedon save and delete.AUTH_STATE_NOT_FOUND; a second delete answers not-found; a bad name answersPATH_NOT_ALLOWED;routes/auth-states.test.ts, plus route-table and auth-matrix cases):test/cli/saved-logins.test.tsand help goldens): list and--json; owner lookup; ambiguous name;--ownerwith an encoded path; not found; missing argument.SavedLoginsPage.test.tsx): rendering, link and "deleted", the empty state (axe-clean), the confirm text and DELETE only after confirming, live refetch onauth_state.changed, and the pure filter, sort and page.saved-logins.e2e.tslists them and deletes one per project through the dialog. Run locally against a fresh seeded daemon: 17 passed, 1 skipped (the known skip).Checks
bun run check,bun run build,bun run package:checkandbun run test:integration(70 pass, 4 skip, 0 fail) all pass.Two pre-existing things noticed (not changed here)
remoteCallwith--cookieis refused for mutating requests (ORIGIN_NOT_ALLOWED, the CSRF check). This hitssaved-logins rm --cookieandchannels test --cookiealike;--tokenworks.Authorizer.can()lets every operator principal through, so an operator API token issued with a scope subset is not actually limited, although spec 03 §3.5 says such tokens may be issued.authorizer.test.tspins this as intended. The scope tests here therefore use agent tokens.