Validate session snapshots and wipe keys on logout (closes #10)
check / check (push) Successful in 41s

Client.fromJSON checks every snapshot field and each key's decoded length
and throws an error naming the bad field. toJSON reads the token through a
new ApiClient.getAuthToken and throws when there is none. logout zeroes the
key buffers in place; collectionsSince re-checks for logout after its
request so it never decrypts with zeroed keys. The CLI now reports a
corrupt session file separately from a missing one.

Model: opus-5-5
This commit was merged in pull request #79.
This commit is contained in:
2026-09-23 02:08:02 +02:00
parent 3871d6228e
commit b7d6ab99f4
7 changed files with 319 additions and 33 deletions
+4
View File
@@ -139,6 +139,10 @@ export class ApiClient {
this.token = undefined;
}
getAuthToken(): string | undefined {
return this.token;
}
// The policy this client was configured with, so that a caller wrapping a
// whole operation in its own `withRetry` — the download layer — runs under
// the same settings rather than under the library defaults.