Skip to content

[Feature] iOS Encrypted Vaults 2a/2d: VaultRegistry + UnlockAttemptThrottle #301

Closed

Description

@libravault-xyz

What problem does this solve?

Split out of #201 (2/6 of #190's iOS Encrypted Vaults breakdown) into a narrower piece: the two parts of #201's scope that carry no cryptographic risk of their own and don't need a human to write them by hand.

Depends on #200 (crypto core, merged via #220) only for types, not behavior.

Proposed behaviour

Swift equivalents of Android's VaultRegistry.kt and UnlockAttemptThrottle.kt:

  • VaultRegistry: plaintext JSON list of which vaults exist and their display names (id, name, created-at). Deliberately plaintext — same accepted-residual-leak reasoning as Android's vaults.json, see docs/threat-model.md's "Accepted residual leaks" section. No key material, no vault content, ever touches this type.
  • UnlockAttemptThrottle: exponential backoff after repeated failed PIN attempts, keyed per-vault, persisted across process restart (a plaintext counter + timestamp is fine — it's a rate limiter, not a secret).

Acceptance criteria

  • Vault registry lists vaults (id, display name, created-at) without exposing any vault content or key material
  • Registry survives app restart (backed by a file, not just in-memory state)
  • Failed-PIN throttle backs off correctly (mirror Android's UnlockAttemptThrottleTest.kt cases) and persists across app restart
  • Both are unit-testable without a real device (no Secure Enclave dependency — that's [Feature] iOS Encrypted Vaults 2/6: VaultStore equivalent + leak-closure guarantee #201's other split-out piece)

Module / component

iOS app (Sources/VaultStore/)

Does this touch a sensitive area?

No cryptographic material — plaintext registry + a rate-limit counter, same risk tier as Android's equivalents (neither VaultRegistry.kt nor UnlockAttemptThrottle.kt carries the Android security label). Not labeling security; still lands under Sources/VaultStore/**, which #300 just made a forced-human-merge path regardless of triage outcome.

Activity

  1. added
    enhancement
    status:triage
    on Aug 19, 2026
  2. added
    status:ready-for-dev
    status:in-progress
    and removed
    status:triage
    status:ready-for-dev
    on Aug 19, 2026
  3. added a commit that references this issue on Aug 19, 2026
    60e21a9
  4. added a commit that references this issue on Aug 19, 2026
    02ac244
  5. added a commit that references this issue on Aug 19, 2026
    ed2e83a
  6. added a commit that references this issue on Aug 19, 2026
    016e2d9
  7. libravault-xyz commented on Aug 19, 2026

    @libravault-xyz
    CollaboratorAuthor

    Implemented and merged via #305 (016e2d9). Shipped almost entirely through the automated dev-agent/QA/principal-review pipeline — the one human step needed was rebasing the branch onto current dev twice (first for #300's risk-classification fix, then for the #254 qa-agent.yml OIDC staleness it introduced), since the pipeline's health-check routine deliberately declines to self-heal sensitive-path PRs unattended. QA independently re-verified the code (not just trusted the PR's own claims), including proving the tests non-vacuous by deliberately breaking the backoff math. Principal review found no CONFIRMED blocking issues; one non-blocking note logged (decode-failure swallowing in list()/read(), matches existing iOS convention) for whoever wires a caller up next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementiosstatus:in-progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions