Skip to content

feat(devices): revoke device access + show device OS - #15

Merged
PouyanJay merged 1 commit into
mainfrom
feat/device-revoke-and-os
Jun 30, 2026
Merged

feat(devices): revoke device access + show device OS#15
PouyanJay merged 1 commit into
mainfrom
feat/device-revoke-and-os

Conversation

@PouyanJay

Copy link
Copy Markdown
Owner

Adds the two Devices-page asks, and brings the page to the mockup design.

1. Revoke device access

  • Relay: scoped revoke(userId, deviceId) (RLS + explicit user_id filter, defense-in-depth) and a session-authed, uuid-validated DELETE /me/devices/:id (404 for not-found/cross-user, audit-logged).
  • Web: an inline, verification-gated Revoke → Cancel/Revoke confirm in each row; the form action validates the id and distinguishes 404 from transient failures.

2. Device OS

  • Protocol: optional bounded os on the device-code request.
  • Daemon: detectOs() reports a friendly descriptor (macOS 15.4 / Ubuntu 24.04 / Windows) at pairing, via a pure unit-tested formatOs.
  • Relay: os column (migration 0004, additive/nullable) threaded through the registry + pairing; returned by GET /me/devices.
  • Web: Devices page rebuilt to the mockup — dot · name/id · OS · status · Revoke.

Existing devices show for OS until they re-pair with the updated daemon (OS is reported at pairing).

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.

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.
@PouyanJay
PouyanJay merged commit 8dcb34b into main Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant