Repository navigation
Conversation
The hosted shell's front page can sign in to the account service (GitHub or Sign in with Apple, OAuth code + PKCE, the code returned in the fragment) and list the account's PCs merged with the PCs this device is paired with. - src/lib/account/store.ts: one non-extractable P-256 account key per client in its own IndexedDB database, ovis-account; ovis-relay and the service worker are untouched. - src/lib/account/service.ts: directory calls with refresh and sign-out; a page offers sign-in only when it names an account service in <meta name="ovis-account-service">, so no build shows dead buttons. - src/lib/account/myPcs.ts: directory rows are never trusted for keys; only a paired PC opens. - lastSeen moves to src/lib/lastSeen.ts, shared by Devices and My PCs.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
…-in, no service text in errors From the adversarial review of the first account PR: - Refreshes run one at a time between tabs (Web Locks) and store their answer only over the session they started from, so a rotated refresh token is never used twice and a refresh in flight cannot bring a session back after sign-out. - Sign-out refreshes an expired access token first, so the service really ends the sign-in's tokens; a revocation the service did not confirm throws. - Errors keep the service's error code only, never its message, which could echo a token. - A paired PC with no name is never named from the directory. - Waiting sign-ins are kept by state and taken in one transaction: a forged return cancels nothing, and two tabs can sign in at once. - The sign-in's return leaves the address bar at boot, before the shell's chunk loads.
Review findings and how they were resolved (613a935)Reviews at fcc5939: omo reviewer CLEAR; Codex (gpt-6.1-terra, xhigh, adversarial) found five MEDIUM and two LOW issues, each reproduced against the in-repo fake account service. All seven are fixed in 613a935, each with a test:
Not reproduced by the reviewer: a forged or replayed return producing a session, a directory-only row becoming openable, or a directory key being used. Validation at 613a935: |
…aw it The sign-in is a centred card with one short title and line, GitHub and Apple as two alike buttons in the theme's strongest ink (black in light, white in dark, as Sign in with Apple asks), the QR route behind a link and one line on what the account sees. My PCs says each state in a word after a dot; the digit comparison is centred with one line under the numbers.
…nt-client # Conflicts: # src/lib/i18n/relay.ja.ts # src/lib/i18n/relay.ko.ts # src/lib/i18n/relay.zh.ts
New commits
Validation at the new head: |
Deploying ovis with
|
| Latest commit: |
38fb9e4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3f0c7722.ovis.pages.dev |
| Branch Preview URL: | https://feat-account-client.ovis.pages.dev |
…nd name the service in the hosted shell from its build
|
Landed as part of #2867 (the whole account stack was merged there in one squash). |
Stacked on #2843 (account records on the PC), itself on #2840 and #2834.
What
The client side of signing in to link devices (docs/account.md), first part: the account key, the sign-in and the account's PCs on the hosted shell's front page.
src/lib/account/store.ts): one ECDSA P-256 key per client, made by WebCrypto as non-extractable, in its own IndexedDB databaseovis-account(with the sign-in and a sign-in in progress).ovis-relayv2, whichpublic/sw.jsshares, is not touched; a test checks that the worker opens onlyovis-relayat the shell's version and neverovis-account.src/lib/account/signin.ts,service.ts): GitHub or Sign in with Apple through the account service, OAuth authorization code with PKCE (S256). The web return ishttps://app.ovis.sh/with#code=…&state=…in the fragment, so the code never reaches the host's request logs, and it leaves the address bar before anything else runs. A return this client did not start, one opened twice, or one older than ten minutes is refused. Access tokens refresh before they run out (refresh tokens rotate); a refused refresh signs the client out and leaves every PC pairing as it was. No token is logged.src/lib/account/myPcs.ts,src/components/AccountPcs.tsx): the account's directory, which the client does not trust, merged with the PCs this device is paired with. States in words under each name: paired, this device is not approved on it yet, offline (last seen), needs an update. Only a paired PC is a link; the directory's label never renames a PC this device already knows, and no key ever comes from the directory.<meta name="ovis-account-service">(https, or http on loopback). The shell build does not add it yet, so app.ovis.sh is unchanged by this PR; the same meta lets a self-hosted install point at its own service.lastSeenmoves from DevicesPanel tosrc/lib/lastSeen.tsso both lists say it the same way (its four strings move from the devices dictionary part to the base).Not in this PR (next PRs of the same work): joining through a PC with remote approval and number matching, moving existing QR pairings into the account, the account's device list with remove and sign-out, native sign-in on iOS, Android and the desktop app, docs and the privacy page.
Depends on
The sign-in endpoints, the fragment return for
https://app.ovis.sh/and the hosted shell'sconnect-srcforhttps://account.ovis.shcome from the contract below this PR (docs/account.md "Signing in"); the tests sign in through the in-repo fake's own/v1/signinand/v1/token.Design
DESIGN.md "Relay shell" gains the account part. GitHub and Apple are two equal neutral buttons (App Review 4.8 asks for Sign in with Apple wherever another provider is offered). PC states are words, not badges, as the shell's list already rules. Precedent: Tailscale's machine list (every machine of the account with its state in words) and Signal's linked devices (trust stays on devices already linked, not on the sign-in).
Validation
bun run check fastat fcc5939: ok (workflow syntax, generated types, themes, typecheck, build, unit 10995 pass / 0 fail).bun test src/lib/account src/components/RelayShell.test.tsx src/lib/relay src/lib/i18n.test.ts: pass.bun run build:shell) behind HTTPS with the meta pointing at the in-repo fake behind a small CORS wrapper: Continue with GitHub → the fake's sign-in → back on/with a clean address → My PCs lists the account's three PCs (all "not approved yet" for a fresh device). Screenshots at 390 and 1280 px, dark and light, signed out and signed in.