feat(devices): revoke device access + show device OS - #15
Merged
Conversation
Add the ability to revoke a paired device, and surface each device's OS in the Devices list (matching the design mockup). - protocol: optional bounded `os` on the device-code request. - daemon: detect a friendly OS descriptor (macOS 15.4 / Ubuntu 24.04 / Windows …) at pairing, via a pure `formatOs` (unit-tested) + a best-effort `detectOs`. - relay: `os` column (migration 0004, additive/nullable) carried through the registry + pairing; a scoped `revoke(userId, deviceId)` and a session-authed, uuid-validated `DELETE /me/devices/:id` (RLS-scoped to the owner, audit-logged). - web: Devices page rebuilt to the mockup (dot · name/id · OS · status · Revoke) with an inline, verification-gated revoke confirm; relay-api gains `os` + `revokeDevice` (distinguishes 404 from transient failures). Reviewed (security/TS/clean-code — zero blocking) and verified end-to-end in the browser. Gates pass; relay integration tests (revoke + os + RLS scoping) run in CI.
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.
Adds the two Devices-page asks, and brings the page to the mockup design.
1. Revoke device access
revoke(userId, deviceId)(RLS + explicituser_idfilter, defense-in-depth) and a session-authed, uuid-validatedDELETE /me/devices/:id(404 for not-found/cross-user, audit-logged).2. Device OS
oson the device-code request.detectOs()reports a friendly descriptor (macOS 15.4 / Ubuntu 24.04 / Windows) at pairing, via a pure unit-testedformatOs.oscolumn (migration 0004, additive/nullable) threaded through the registry + pairing; returned byGET /me/devices.Verification
Reviewed by the security, TypeScript, and clean-code agents (zero blocking; all important findings applied — web-side uuid validation, revoke error distinction, audit log, os-info one-export split). Verified end-to-end in the browser (real pairing → OS shown, revoke-confirm works). Gates green: typecheck, lint, format, protocol/daemon/web unit tests; relay integration tests (revoke + os + RLS scoping) run in CI.