As an identity holder, I want to connect this phone to my vault by approving it in my browser, so that all my identities arrive without typing any recovery words.
Situation
I keep my identities in a Seed vault and can sign in to it in a browser. This phone has none of them yet. I am on the Me tab, online.
What I do
Tap "Vault".
Under "Remote vault", check the address, or type my own vault's address.
Tap "Connect".
In the browser page that opens, sign in to my vault and approve this device.
Return to Seed and wait.
What I should see
The address field starts with "https://hyper.media/vault", above "Keep your identities in sync across devices. Approve this device in your vault’s browser page."
On Vault, "Connect" opens a sheet titled "Connect vault" and opens my vault's page in the browser. See Connect vault.
The sheet says "Approve this device" and "Open your vault in the browser and approve the connection, then return here."
It offers "Open in browser", shows the link as text I can select, and counts down: "Link expires in 14:32".
While Seed is in front, it checks for my approval every two seconds.
After approval the title becomes "Connected" with "Your identities are ready. Returning to your vault…", and the sheet closes by itself after two seconds.
Vault now shows "Remote" and my vault's address, and my identities are listed there and on Me.
Identities that were already on the phone are kept and added to my vault.
If I leave the sheet without cancelling, Vault offers "Continue pending connection" and "Restart connection".
When something goes wrong
A bad address shows "Invalid vault URL" in red under the field. I correct it and tap "Connect".
If the vault cannot be reached, a red line appears, starting "Cannot reach the vault server". The wait continues.
If the connection drops after I approved, I see "Connection interrupted (attempt 2: …). Retrying with your browser approval…". I do not need to approve again.
After 15 minutes the title becomes "Connection stopped" with "connection token expired". I tap "Try again" for a new link.
"Cancel" ends the attempt and returns me to Vault, still "Local", with my identities untouched.
Not included
I cannot sign in to the vault inside the app. Approval always happens in the browser.
One remote vault at a time. A second one is refused with "Switch to local before connecting another vault."
Some error wording is unpolished, as the Connect vault page records.
The automated interface tests stop before approval. A completed approval is proven by unit tests and hand-run drives. See Real vault compatibility suite.
Trace
Story US-VAULT-01, 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 |
|---|---|
The Remote vault section with the address field and Connect | |
The approval sheet: pending, warning, stopped, connected | |
Entry point (Vault row) and where the identities arrive | |
The connect panel: title, countdown, link, warnings | |
The Storage panel that turns from Local to Remote | |
Vault identity rows that appear after connecting | |
The vault address field | |
Cancel in the sheet bar | |
The countdown and connection status wording | |
Waiting, warning without ending the wait, stopped with Try again | |
Every state of Vault and Connect vault | |
The address field and its error line | |
The status panel treatment | |
The connect sheet as a modal over Vault | |
Leaving for the browser and coming back | |
The title is the state; a deadline is shown as a clock | |
The rough, unpolished error wording noted as a gap |
Implementation
Page | Part it plays |
|---|---|
Orientation: the device role and the two copies of the identities | |
Token, connect link, mailbox, finishing, retry and cancel rules | |
VaultConnectScreen, the poll and countdown tasks, vaultConnect and vaultCancel | |
VaultStore.start and poll; publishing identities to the Keychain | |
The mailbox and snapshot requests, timeouts and error classes | |
How local identities merge into the remote vault on connect | |
The encrypted envelope and state the connection adopts | |
Token hashing, payload decryption and bearer derivation | |
The endpoints, the connect mailbox and status handling | |
vaultStatus, vaultStarted, vaultChanged and the seven tasks | |
The vault and vault-connect routes | |
Why connect is split into phases so a real-size vault finishes | |
Keychain, file and network grants the vault needs | |
The fixture server and scripted drive that completes an approval | |
The real server and browser approval suite and drives | |
The UI tests for invalid URL, warning, expiry and cancel |
Code
File | What |
|---|---|
VaultConnectScreen | |
VaultScreen: Remote vault section in local mode | |
vaultCountdown | |
pkg:vault decl: vaultStatus, mutations, vaultPoll, vaultCountdownTick, vaultConnectedReturn | |
vaultEditURL, vaultConnect, vaultAfterStart, vaultResume, vaultOpenBrowser | |
vaultPollTick, vaultClock, vaultRefreshIdentities, vaultCancel | |
view wiring for the vault-connect route | |
vaultRead, vaultStart, vaultCommand | |
VaultStore.start and poll | |
VaultStore.cancel | |
expiry and poll constants, normalizeVaultOriginURL, mintPendingConnection | |
finishConnection | |
The vault envelope format read and written on connect | |
Wrapping and unwrapping the vault data key |
Tests
File | What it checks |
|---|---|
vault: invalid URL stays local | |
vault: pending connection expires and can be cancelled | |
token → encrypted mailbox → adopted remote DEK → identities in Me | |
an Exact-aborted snapshot retries the consumed approval without another browser ceremony; a cached approval expires instead of retrying indefinitely; an authentication refusal after approval stops instead of retrying | |
cancelling an approved connection suppresses a late aborted reply and never retries it; cancelling while the mailbox request is in flight prevents late connection; pending token expires and cancellation does not create a remote credential | |
vault URL boundary rejects credentials, fragments, queries and non-http protocols; URL mismatch is rejected even when mailbox decryption succeeds | |
identities made in the web vault decrypt on the phone and sign with their principals; connect tokens: unknown, expired, cancelled, and one-time; vault URL forms a person types normalize to what the web vault expects | |
the built app connects through a real browser approval (run by hand, not in CI) | |
iOS on real time: approval while in the background, a 503 after approval, recovery without a second approval (run by hand) |
Delivery
Delivered by #1470.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime