Commit 567af31
committed
MH: account bootstrap + wire ProtonDriveClient into pdtui TUI
Closes the final integration gap so pdtui can talk to a live Proton
Drive volume after login.
Task 1 — apps/pdtui/src/account.rs (new): PdtuiAccount implements
ProtonDriveAccount. PdtuiAccount::bootstrap performs the full key-unlock
chain: GET /core/v4/users unlocks user keys directly with the mailbox
password; GET /core/v4/addresses decrypts each address-key Token with the
user key to recover the address-key passphrase, then unlocks the address
PrivateKey, cached by email. Token signature verification against the
SignedKeyList is deferred for MVP (decrypt only). Address DTOs added to
proton-drive-api.
Task 2 — app.rs: try_build_client stub replaced. After login
(check_auth_result) or on startup resume (build_client_from_keyring), the
app assembles RpgpCrypto, two MemoryCaches, PdtuiAccount::bootstrap and
ProtonDriveClient::new, wrapping the HTTP layer in SessionAwareHttpClient
so 401-refresh works.
Task 3 — remote listing: refresh_remote lists my_files_root then
iter_folder_children, populating PaneEntry.node_uid and remote_cwd_uid;
focus/refresh re-lists; F2/F3 receive real NodeUids.
dearmor_pgp added to convert the ASCII-armored address Token to binary
before decrypt_session_key (decrypt_session_key parses raw binary and
does not de-armor) — required for the live API.
Tests: account key-unlock unit tests use a PathMock HTTP client + real
RpgpCrypto with generated test keys; the live bootstrap e2e is
#[ignore]-gated.
Co-Authored-By: jjohare <github@thedreamlab.uk>1 parent 6793772 commit 567af31
6 files changed
Lines changed: 914 additions & 31 deletions
File tree
- rust
- apps/pdtui
- src
- crates/proton-drive-api/src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
0 commit comments