feat(keys,desktop): #142 slice 3 — settings completion + engineering-gotcha bundle #151

Merged
amiryahaya merged 1 commit from feat/settings-completion into main 2026-11-11 07:48:50 +01:00
Owner

#142 slice 3 — settings completion (task 3.4 / D6) plus the engineering-gotcha bundle accumulated across this milestone's real CI runs.

Settings completion

  • Server: GET /api/keys/authorize/pending — the caller's pending, unexpired pairing challenges for the Devices-page banner. Deliberately secret-free (challenge id + device metadata + timestamps): the banner alerts, approval still requires the pairing payload from the new device. Materialize-then-filter per the SQLite conventions. AuthzMatrix row. Tests: initiated challenge listed WITH metadata and WITHOUT secret fields; consumed challenge drops off; cross-user isolation.
  • DevicesList: pending-pairings banner via a new list_pending_pairings Rust command; revoke dialog now carries real consequences copy (signed out immediately, key wrap deleted → loses access to encrypted files, must sign in AND pair again) — KEY-07.

Gotcha bundle

  • split_master_key dead seam FIXED: the frontend invoked split_master_key with no args while the Rust command was split_master_key_command requiring wallet-era hex input — the recovery-setup wizard was 100% broken. New no-arg command reads the loaded master key (PR-B).
  • bcrypt-hkdf KAT regenerated (root cause found, not papered over): the rename commit changed the HKDF domain salt (SSDID- → FailSulit-Bcrypt-KDF-v1) after the KAT was written, and the crate's tests were compile-broken — so the drift was invisible. Verified cryptographically: current code reproduces 2f28ba3a… exactly; the old vector predates the rename; iOS already used the new string (platforms agree, only its test vector was stale). Provenance comment in the test. Tiered KDF is dormant → clean re-publication, not a migration.
  • Desktop lint 12 → 0 warnings (typed OtpInput mocks, unused spies, floor hint moved to src/lib/passphraseFloor.ts for react-refresh, deps-array disable with reason).
  • docs/engineering-gotchas.md — the durable gotchas from this milestone: jsdom form submission, store-spy assertion targets, Once-chain mock rot under CI load, gitleaks path-filter discipline, Forgejo branch-protection/runs-API/squash-stack quirks, SQLite conventions, MTP crash-class errors.

Tests: server 990/0/39 (twice, for stability; coverage gate 87.15%); cargo 31/31; vitest 1300/1skip; typecheck + lint clean (0 warnings).

#142 slice 3 — settings completion (task 3.4 / D6) plus the engineering-gotcha bundle accumulated across this milestone's real CI runs. **Settings completion** - **Server**: `GET /api/keys/authorize/pending` — the caller's pending, unexpired pairing challenges for the Devices-page banner. Deliberately secret-free (challenge id + device metadata + timestamps): the banner alerts, approval still requires the pairing payload from the new device. Materialize-then-filter per the SQLite conventions. AuthzMatrix row. Tests: initiated challenge listed WITH metadata and WITHOUT secret fields; consumed challenge drops off; cross-user isolation. - **DevicesList**: pending-pairings banner via a new `list_pending_pairings` Rust command; revoke dialog now carries real consequences copy (signed out immediately, key wrap deleted → loses access to encrypted files, must sign in AND pair again) — KEY-07. **Gotcha bundle** - **`split_master_key` dead seam FIXED**: the frontend invoked `split_master_key` with no args while the Rust command was `split_master_key_command` requiring wallet-era hex input — the recovery-setup wizard was 100% broken. New no-arg command reads the loaded master key (PR-B). - **bcrypt-hkdf KAT regenerated** (root cause found, not papered over): the rename commit changed the HKDF domain salt (`SSDID-` → `FailSulit-Bcrypt-KDF-v1`) after the KAT was written, and the crate's tests were compile-broken — so the drift was invisible. Verified cryptographically: current code reproduces `2f28ba3a…` exactly; the old vector predates the rename; iOS already used the new string (platforms agree, only its test vector was stale). Provenance comment in the test. Tiered KDF is dormant → clean re-publication, not a migration. - **Desktop lint 12 → 0 warnings** (typed OtpInput mocks, unused spies, floor hint moved to `src/lib/passphraseFloor.ts` for react-refresh, deps-array disable with reason). - **`docs/engineering-gotchas.md`** — the durable gotchas from this milestone: jsdom form submission, store-spy assertion targets, Once-chain mock rot under CI load, gitleaks path-filter discipline, Forgejo branch-protection/runs-API/squash-stack quirks, SQLite conventions, MTP crash-class errors. **Tests**: server 990/0/39 (twice, for stability; coverage gate 87.15%); cargo 31/31; vitest 1300/1skip; typecheck + lint clean (0 warnings).
feat(keys,desktop): #142 slice 3 — settings completion + engineering-gotcha bundle
All checks were successful
Security CI / security-scan (pull_request) Successful in 3m27s
API CI / build-and-test (pull_request) Successful in 5m24s
294ea5f38f
Settings completion (task 3.4 / D6, KEY-07):
- Server: GET /api/keys/authorize/pending lists the caller's pending,
  unexpired pairing challenges for the Devices-page banner. Secret-free
  surface (challenge id + device metadata + timestamps only) - approval
  still requires the pairing payload from the new device. Materialize-
  then-filter per the SQLite conventions. 3 tests (banner lists initiated
  challenge with metadata and NO secret fields; consumed challenge drops
  off; cross-user isolation). AuthzMatrix row added.
- DevicesList: pending-pairings banner ("A device is waiting for
  approval...") driven by a new list_pending_pairings Rust command.
- Revoke dialog: real consequences copy (signed out immediately; key wrap
  deleted so it loses access to encrypted files; must sign in AND pair
  again) - KEY-07.

Gotcha bundle (found + fixed in this series' real runs):
- split_master_key dead seam: the frontend invoked 'split_master_key'
  with no args; the Rust command was 'split_master_key_command' requiring
  wallet-era hex input. Replaced with a no-arg command reading the loaded
  master key (PR-B) - the recovery-setup wizard actually works now.
- bcrypt-hkdf KAT regenerated: the rename commit (c170802) changed the
  HKDF domain salt (SSDID- -> FailSulit-Bcrypt-KDF-v1) AFTER the KAT was
  written and the crate's tests were compile-broken, so the drift was
  invisible. Verified: current code reproduces 2f28ba3a... exactly; the
  old 9ac8238c vector predates the rename. iOS TieredKdfTests carried the
  same stale vector (impl already used the new string - platforms agree).
  Provenance comment added; tiered KDF is dormant so this is a clean
  re-publication, not a migration.
- Desktop lint: 12 warnings -> 0 (typed the OtpInput mock props + store
  selector in Email/TotpSetup tests, unused spies removed, floor hint
  moved to src/lib/passphraseFloor.ts for react-refresh, LinkLogins dep
  disable with reason).
- docs/engineering-gotchas.md: the durable gotchas from this milestone
  (jsdom form submission, store-spy assertion target, Once-chain mocks,
  gitleaks path filter, Forgejo merge/status quirks, SQLite conventions,
  MTP crash-class errors...).

Coverage gate 87.15%; server suite 990/0/39 (x2 for stability); cargo
31/31; vitest 1300/1skip (5 new: 3 server harness + banner + floor via
lib path); typecheck + lint clean (0 warnings).
amiryahaya deleted branch feat/settings-completion 2026-11-11 07:48:50 +01:00
Sign in to join this conversation.
No description provided.