Skip to content

Commit 567af31

Browse files
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/Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/apps/pdtui/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ tracing.workspace = true
3939
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
4040
tracing-appender = "0.2"
4141
thiserror.workspace = true
42+
futures.workspace = true
4243
proton-drive = { path = "../../crates/proton-drive" }
4344
proton-drive-api = { path = "../../crates/proton-drive-api" }
45+
proton-drive-cache = { path = "../../crates/proton-drive-cache" }
4446
proton-drive-crypto = { path = "../../crates/proton-drive-crypto" }

0 commit comments

Comments
 (0)