Lock my vault, switch to local, or log out
A person locks the vault so nothing can sign, stops syncing while keeping identities, or logs out and clears the phone.

As an identity holder, I want to lock my vault, stop syncing, or log out of it, so that I decide when this phone holds my keys and when it can use them.

Situation

My identities are in the vault on this phone. I am lending the phone for a moment, or I no longer want it linked to my remote vault, or I am giving it away. I am on Me, in "Vault".

What I do

    To lock: tap "Lock vault". To come back, tap "Unlock vault".

    To stop syncing but keep my identities: tap "Switch to local".

    To leave and clear the phone: tap "Log out and clear this device", read the alert, tap "Log out".

What I should see

    "Lock vault" is the last row of Vault, in local and in remote mode.

    After locking, the screen shows only "Locked", "Unlock vault" and "Reopen using the key kept in this device’s Keychain." The identity list and connection rows are hidden.

    While locked, Me shows "No identity yet", and I cannot comment or use agents as anyone.

    "Unlock vault" brings back "Local" or "Remote" and every identity, with no password.

    In remote mode, "Remote vault" offers "Switch to local" and, in red, "Log out and clear this device".

    "Switch to local" acts at once. Storage shows "Local" and "Vault stored on this device", my identities are still listed, and the connect form returns.

    "Log out and clear this device" first shows an alert titled "Log out and clear this device?" with "Your identities remain in your remote vault and on your other devices." and the buttons "Cancel" and "Log out".

    After "Log out", Storage shows "Local", the list says "No identities yet" and "Create an identity, import a key, or connect your remote vault."

When something goes wrong

    If the vault cannot be opened, Storage shows a red message that starts "Failed to open the vault:" with a "Retry" button, and nothing else. I tap "Retry". Nothing on the phone is overwritten.

    If I logged out too soon, I connect my vault again and the identities return.

Not included

    Locking is not a passcode. Anyone holding the unlocked phone can tap "Unlock vault". There is no automatic lock and no Face ID. See Current limits and known gaps.

    Leaving does not tell the vault server. This phone's approval stays valid there until I remove the device in the web vault. See Vault server.

    Log out does not sync first. An identity added moments before, and not yet synced, would be cleared with the rest.

    Switch to local and log out have no automated interface test.

Trace

Story US-VAULT-03, status Shipped. These links are kept in step with the traceability matrix and with the "User stories" section of every page listed here.

Design

Page

Part it plays

Vault

Lock, unlock, Switch to local, Log out and the alert

Me

Me shows no identities while locked or after logging out

Vault status panel

The Storage panel: Locked, Local, Remote, failure with Retry

Vault connect panel

The connect form that returns after leaving

Identity rows

The identity list hidden while locked

dialog

The Log out and clear this device? alert

button

Tinted reversible rows and the red destructive row

Confirmations and alerts

The log out confirmation and its reassurance

Buttons and actions

Reversible and irreversible actions look different

Loading, failure and empty states

Failure with Retry and the empty identities state

States for every screen

Opening, failure, locked, local and connected states of Vault

Honest state: loading, failure and empty

Say where the keys are, first

Platform colour roles in use

System red for Log out

Representative strings

The exact lock and log out wording

Implementation

Page

Part it plays

Vault: remote vault device role

Orientation and the no-master-password limit

Vault: the store and on-device format

lock, unlock, disconnect(clear) and failing closed on load

Vault: screens and tasks

VaultScreen sections, vaultCommand and vaultAskLogout

Vault: connect ceremony

cancel: locking and leaving end a pending connection

Identity: key storage

The signing key map that lock empties and unlock refills

Crypto: vault envelope and state codec

Sealing the state under the Keychain key

Vault server

Leaving makes no server call; the credential remains

Root declarations: Me, Profile, Crypto and Vault

vaultChanged and vaultBusy

Discuss: root contract wiring

Signed-in state that turns off while no identity is available

Grants and capabilities

The Keychain and file grants behind the vault

Current limits and known gaps

No master password

Contract UI tests

The UI test that locks and reopens

Mock vault

The scripted drive that switches to local and logs out

Real vault compatibility suite

Log out against the real server and what happens to the credential

Code

File

What

vault.contract L73-77

Locked state with Unlock vault

vault.contract L143-162

Switch to local, Log out and clear this device, Lock vault and the log out dialog

vault.contract L66-72

Opening and failure with Retry

app.contract L256-258

vaultChanged, vaultEdited and vaultBusy

app.contract L709-711

vaultCommand

app.contract L731-732

vaultAskLogout

app.contract L898-918

view wiring for the vault route

src/vault/sources.ts L20-42

vaultCommand: local, logout, lock, unlock

src/vault/store.ts L438-473

disconnect, lock, unlock

src/vault/store.ts L119-152

load: fail closed, nothing written on failure

Tests

File

What it checks

vault.test.contract

vault: local empty state, lock and reopen

src/vault/__tests__/vault.test.ts

lock hides signers, unlock restores, switch to local keeps keys, logout clears

src/vault/__tests__/vault.test.ts

wrong Keychain key fails closed without overwriting ciphertext

.tests/real-vault/real-vault.test.ts

logout clears only this phone; server data and the credential behave as documented

tools/mock-vault/drive.mjs

scripted drive of the built app: Switch to local, then Log out with its confirmation (run by hand)

Delivery

Delivered by #1470.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Comments