Stores: keep a sealed sign-in through a transient Keystore failure

Only a file that can never open is deleted: bad GCM tag, a permanently
invalidated or missing key, or no envelope. Any other Keystore or I/O
failure keeps the file, leaves the store signed in but unavailable (its
actions say the sign-in could not be read), logs once and retries on the
next access.
This commit is contained in:
The412Banner committed 2026-10-09 14:23:59 -04:00
1 parent c248d3e1c4
commit a034d1f0b6
10 files changed
+153 -25

No files matched your search

+10 -2
View File
@@ -207,8 +207,16 @@ tokens live.
- **No Keystore** (some ROMs): the file stays plain, the log says
`stores: keystore unavailable, credentials stay plain (<exception class>)` once, and the next
start tries again.
- **A file that no longer opens** (key invalidated: data cleared, a backup restored on another
device, tampering): deleted, and the store reads as signed out, so its sign-in card shows.
- **A file that can never open** - it does not authenticate (`AEADBadTagException`: tampered, or
another key after data was cleared or a backup restored on another device), the key is
permanently invalidated or gone from the Keystore, or it is not an envelope: deleted, and the
store reads as signed out, so its sign-in card shows.
- **A failure that may pass** (`KeyStoreException`, `ProviderException`, any other
`InvalidKeyException`, an I/O error, StrongBox busy): the file is kept, the store stays signed in
(no sign-in card) and is marked unavailable (`StoreAccounts.isUnavailable`), a store action shows
`<Store> sign-in could not be read: try again.`, the log says
`stores: credentials unreadable this start (<exception class>)` once, and the next access tries
again.
- **The Linux session:** the app's files directory is bound into every session, so the guest can
see `credentials.json` - as the envelope only; the key never leaves the Keystore. Nothing in the
guest reads the files: `droiddeck-store-launch` asks the app over `<session>/stores/req|resp`
+7 -3
View File
@@ -15,12 +15,16 @@ the timeline, then lessons and backlog. Companion to the README (what the app *d
`StoreAccounts` is the one layer; `CredentialCipher` holds the envelope and the key.
- **Upgrade:** a plain file is sealed at the first start (verified, then replaced); users stay
signed in. Log: `stores: credentials encrypted <store>`.
- **Fallbacks:** no Keystore - stays plain, logged once, retried next start; a file that will not
open - deleted, signed out (sign-in card), never a crash.
- **Fallbacks:** no Keystore - stays plain, logged once, retried next start. A file that can never
open (bad tag, key invalidated or missing, not an envelope) - deleted, signed out (sign-in card).
Any other Keystore or I/O failure - file kept, store stays signed in but unavailable (actions show
`<Store> sign-in could not be read: try again.`), logged once, retried on the next access. Never
a crash.
- **Session:** the guest sees the envelope only; it never read the files (the Epic code comes over
the request channel, written beside the launcher and deleted by it).
- **Tests:** `StoreAccountsCipherTest` (round trip, sealed on disk, migration of all three stores,
tampered file, lost key, garbage, no-Keystore fallback then sealed next start, sign-out). Not yet
tampered file, lost key, key missing, garbage, no-Keystore fallback then sealed next start,
transient Keystore / I/O failures keep the file and a later read succeeds, sign-out). Not yet
on a device.
## 2026-10-08 - `feat/private-logs`: every log in app-private storage, shared as one scrubbed zip