Skip to content

feat(vault): VaultApi hub sync sub-client (ADR-052 D-4)#301

Closed
physercoe wants to merge 1 commit into
mainfrom
feat/vault-client-api-dart
Closed

feat(vault): VaultApi hub sync sub-client (ADR-052 D-4)#301
physercoe wants to merge 1 commit into
mainfrom
feat/vault-client-api-dart

Conversation

@physercoe

Copy link
Copy Markdown
Owner

The Dart HTTP client for the zero-knowledge vault endpoints (hub store in #299). Thin transport over the blind blob store — everything is opaque, client-encrypted base64 (sealed by VaultCrypto in #300); the hub never sees plaintext.

VaultApi (wired into the HubClient facade as client.vault)

  • pullVault / pushVault — pull the sealed bundle; push with optimistic concurrency (base_version; HubApiError 409 on stale → pull, re-seal, retry). pullVault returns null on 404 so a fresh client knows to create.
  • getRecovery / setRecovery / deleteRecovery — the recovery envelope.
  • listDevices / putDevice / deleteDevice — per-device enrollment + wrapped keys.

Convention

Mirrors the existing sub-client pattern (AttentionApi etc.). Like its siblings it's a thin pass-through with no live-server unit test (none of the hub sub-clients have one — they're validated by flutter analyze + device testing). Flutter SDK isn't available locally, so CI is the gate.

Relationship to the other vault PRs

Follow-ups (not here)

  • Bundle assembly from the existing DataPortService connections+keys shape; retire the cleartext backup.
  • Enrollment + recovery orchestration (device trust step; first-setup recovery-code prompt) + Vault UI surface.
  • Desktop (Rust) crypto + sync.

🤖 Generated with Claude Code

Dart client for the zero-knowledge vault endpoints (hub store shipped in #299).
Thin transport over the blind blob store — everything is opaque client-encrypted
base64 (sealed by services/vault/vault_crypto.dart), the hub never sees plaintext.

VaultApi (wired into the HubClient facade as `client.vault`):
- pullVault / pushVault — pull the sealed bundle; push with optimistic concurrency
  (base_version; HubApiError 409 on stale -> pull, re-seal, retry). pullVault
  returns null on 404 so a fresh client knows to create.
- getRecovery / setRecovery / deleteRecovery — the recovery envelope.
- listDevices / putDevice / deleteDevice — per-device enrollment + wrapped keys.

Mirrors the existing sub-client pattern (AttentionApi etc.); like its siblings it's
a thin pass-through validated by flutter analyze + device testing (no live-server
unit harness exists for sub-clients). Flutter SDK isn't available locally, so CI is
the gate.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@physercoe

Copy link
Copy Markdown
Owner Author

Landed directly on main (2df34c5) per the switch to working on main.

@physercoe physercoe closed this Jul 5, 2026
@physercoe
physercoe deleted the feat/vault-client-api-dart branch July 5, 2026 09:46
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