From 643f5a2c3b8b7bc79c2cb2bdea9311efba6ca9c7 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Sun, 28 Jun 2026 11:47:54 +0200 Subject: [PATCH] renamed for crate --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 14 +++++++------- .../Cargo.toml | 4 ++-- .../{proton-drive-sdk => proton-drive-rs}/LICENSE | 0 .../examples/live_login.rs | 4 ++-- .../src/cache.rs | 0 .../src/client.rs | 0 .../src/crypto.rs | 0 .../src/dtos.rs | 0 .../src/events.rs | 0 .../src/lib.rs | 2 +- .../src/node.rs | 0 .../src/photos.rs | 0 .../tests/common/mod.rs | 2 +- .../tests/live_drive_ops.rs | 10 +++++----- .../tests/live_events.rs | 10 +++++----- .../tests/live_transfer_ops.rs | 6 +++--- .../tests/live_upload_download.rs | 4 ++-- 19 files changed, 30 insertions(+), 30 deletions(-) rename crates/{proton-drive-sdk => proton-drive-rs}/Cargo.toml (91%) rename crates/{proton-drive-sdk => proton-drive-rs}/LICENSE (100%) rename crates/{proton-drive-sdk => proton-drive-rs}/examples/live_login.rs (97%) rename crates/{proton-drive-sdk => proton-drive-rs}/src/cache.rs (100%) rename crates/{proton-drive-sdk => proton-drive-rs}/src/client.rs (100%) rename crates/{proton-drive-sdk => proton-drive-rs}/src/crypto.rs (100%) rename crates/{proton-drive-sdk => proton-drive-rs}/src/dtos.rs (100%) rename crates/{proton-drive-sdk => proton-drive-rs}/src/events.rs (100%) rename crates/{proton-drive-sdk => proton-drive-rs}/src/lib.rs (97%) rename crates/{proton-drive-sdk => proton-drive-rs}/src/node.rs (100%) rename crates/{proton-drive-sdk => proton-drive-rs}/src/photos.rs (100%) rename crates/{proton-drive-sdk => proton-drive-rs}/tests/common/mod.rs (99%) rename crates/{proton-drive-sdk => proton-drive-rs}/tests/live_drive_ops.rs (96%) rename crates/{proton-drive-sdk => proton-drive-rs}/tests/live_events.rs (96%) rename crates/{proton-drive-sdk => proton-drive-rs}/tests/live_transfer_ops.rs (97%) rename crates/{proton-drive-sdk => proton-drive-rs}/tests/live_upload_download.rs (95%) diff --git a/Cargo.lock b/Cargo.lock index 3b24053..74952ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1873,7 +1873,7 @@ dependencies = [ ] [[package]] -name = "proton-drive-sdk" +name = "proton-drive-rs" version = "0.1.0" dependencies = [ "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 33c2f61..46ef891 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = ["crates/proton-sdk", "crates/proton-drive-sdk"] +members = ["crates/proton-sdk", "crates/proton-drive-rs"] [workspace.package] version = "0.1.0" diff --git a/README.md b/README.md index a3b9b7a..8d4afa0 100644 --- a/README.md +++ b/README.md @@ -44,14 +44,14 @@ All crypto paths have offline round-trip tests, and the read/write surface (upload/download round-trips, AEAD + streaming + thumbnails, enumeration, folder/node ops, move, and the event feed) is covered by a **live integration test suite** validated against a real Proton account — see -`crates/proton-drive-sdk/tests/live_*.rs`. +`crates/proton-drive-rs/tests/live_*.rs`. ## Workspace | Crate | Purpose | | --- | --- | | `crates/proton-sdk` | Core account/session/crypto (`Proton.Sdk` analogue) | -| `crates/proton-drive-sdk` | High-level Drive client (`Proton.Drive.Sdk` analogue) | +| `crates/proton-drive-rs` | High-level Drive client (`Proton.Drive.Sdk` analogue) | OpenPGP is provided by the [`pgp`](https://crates.io/crates/pgp) crate (rPGP 0.16). @@ -76,7 +76,7 @@ SRP login (with 2FA), then read the my-files root: ```rust,no_run use proton_sdk::config::ProtonClientConfiguration; use proton_sdk::session::ProtonApiSession; -use proton_drive_sdk::ProtonDriveClient; +use proton_drive_rs::ProtonDriveClient; async fn run() -> proton_sdk::error::Result<()> { let config = ProtonClientConfiguration::new("external-drive-myapp@0.1.0-alpha"); @@ -99,12 +99,12 @@ async fn run() -> proton_sdk::error::Result<()> { Already have tokens? Use `ProtonApiSession::resume(config, ResumeParameters {..})` instead of `begin`. -A live smoke test lives in `crates/proton-drive-sdk/examples/live_login.rs` +A live smoke test lives in `crates/proton-drive-rs/examples/live_login.rs` (reads `username` / `password` from a repo-root `.env`, TOTP from `PROTON_TOTP_SECRET`): ```bash -PROTON_TOTP_SECRET=... cargo run -p proton-drive-sdk --example live_login +PROTON_TOTP_SECRET=... cargo run -p proton-drive-rs --example live_login ``` ## Build & test @@ -114,14 +114,14 @@ cargo build # 0 warnings / 0 errors cargo test # offline crypto + derivation round-trip tests ``` -The `crates/proton-drive-sdk/tests/live_*.rs` suite runs the read/write surface +The `crates/proton-drive-rs/tests/live_*.rs` suite runs the read/write surface against a real account. These tests are `#[ignore]`d by default (they need credentials) and each cleans up after itself. With `.env` (`username` / `password`) and `PROTON_TOTP_SECRET` set: ```bash # all live tests, single-threaded (shared test account) -PROTON_TOTP_SECRET=... cargo test -p proton-drive-sdk --test 'live_*' \ +PROTON_TOTP_SECRET=... cargo test -p proton-drive-rs --test 'live_*' \ -- --ignored --nocapture --test-threads=1 ``` diff --git a/crates/proton-drive-sdk/Cargo.toml b/crates/proton-drive-rs/Cargo.toml similarity index 91% rename from crates/proton-drive-sdk/Cargo.toml rename to crates/proton-drive-rs/Cargo.toml index b92abb4..4c896f0 100644 --- a/crates/proton-drive-sdk/Cargo.toml +++ b/crates/proton-drive-rs/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "proton-drive-sdk" +name = "proton-drive-rs" description = "High-level Proton Drive client for Rust" version.workspace = true edition.workspace = true @@ -11,7 +11,7 @@ keywords.workspace = true categories.workspace = true rust-version.workspace = true readme = "../../README.md" -documentation = "https://docs.rs/proton-drive-sdk" +documentation = "https://docs.rs/proton-drive-rs" [dependencies] proton-sdk = { path = "../proton-sdk", version = "0.1.0" } diff --git a/crates/proton-drive-sdk/LICENSE b/crates/proton-drive-rs/LICENSE similarity index 100% rename from crates/proton-drive-sdk/LICENSE rename to crates/proton-drive-rs/LICENSE diff --git a/crates/proton-drive-sdk/examples/live_login.rs b/crates/proton-drive-rs/examples/live_login.rs similarity index 97% rename from crates/proton-drive-sdk/examples/live_login.rs rename to crates/proton-drive-rs/examples/live_login.rs index 6da2630..c03d2a0 100644 --- a/crates/proton-drive-sdk/examples/live_login.rs +++ b/crates/proton-drive-rs/examples/live_login.rs @@ -3,7 +3,7 @@ //! Reads credentials from `.env` (repo root): `username=`, `password=`. //! The TOTP secret comes from the `PROTON_TOTP_SECRET` env var (base32). //! -//! Run: `PROTON_TOTP_SECRET=... cargo run -p proton-drive-sdk --example live_login` +//! Run: `PROTON_TOTP_SECRET=... cargo run -p proton-drive-rs --example live_login` //! //! Flow: SRP `begin` → `apply_second_factor_code` (computed TOTP) → construct //! `ProtonDriveClient` with the data password → `get_my_files_folder` → @@ -12,7 +12,7 @@ use std::time::{SystemTime, UNIX_EPOCH}; use hmac::{Hmac, KeyInit, Mac}; -use proton_drive_sdk::ProtonDriveClient; +use proton_drive_rs::ProtonDriveClient; use proton_sdk::config::ProtonClientConfiguration; use proton_sdk::session::ProtonApiSession; use sha1::Sha1; diff --git a/crates/proton-drive-sdk/src/cache.rs b/crates/proton-drive-rs/src/cache.rs similarity index 100% rename from crates/proton-drive-sdk/src/cache.rs rename to crates/proton-drive-rs/src/cache.rs diff --git a/crates/proton-drive-sdk/src/client.rs b/crates/proton-drive-rs/src/client.rs similarity index 100% rename from crates/proton-drive-sdk/src/client.rs rename to crates/proton-drive-rs/src/client.rs diff --git a/crates/proton-drive-sdk/src/crypto.rs b/crates/proton-drive-rs/src/crypto.rs similarity index 100% rename from crates/proton-drive-sdk/src/crypto.rs rename to crates/proton-drive-rs/src/crypto.rs diff --git a/crates/proton-drive-sdk/src/dtos.rs b/crates/proton-drive-rs/src/dtos.rs similarity index 100% rename from crates/proton-drive-sdk/src/dtos.rs rename to crates/proton-drive-rs/src/dtos.rs diff --git a/crates/proton-drive-sdk/src/events.rs b/crates/proton-drive-rs/src/events.rs similarity index 100% rename from crates/proton-drive-sdk/src/events.rs rename to crates/proton-drive-rs/src/events.rs diff --git a/crates/proton-drive-sdk/src/lib.rs b/crates/proton-drive-rs/src/lib.rs similarity index 97% rename from crates/proton-drive-sdk/src/lib.rs rename to crates/proton-drive-rs/src/lib.rs index 09a9c42..fd95b9c 100644 --- a/crates/proton-drive-sdk/src/lib.rs +++ b/crates/proton-drive-rs/src/lib.rs @@ -8,7 +8,7 @@ //! # async fn run() -> proton_sdk::error::Result<()> { //! use proton_sdk::config::ProtonClientConfiguration; //! use proton_sdk::session::{PasswordMode, ProtonApiSession, ResumeParameters}; -//! use proton_drive_sdk::ProtonDriveClient; +//! use proton_drive_rs::ProtonDriveClient; //! //! let config = ProtonClientConfiguration::new("external-drive-myapp@0.1.0-alpha"); //! let session = ProtonApiSession::resume(config, ResumeParameters { diff --git a/crates/proton-drive-sdk/src/node.rs b/crates/proton-drive-rs/src/node.rs similarity index 100% rename from crates/proton-drive-sdk/src/node.rs rename to crates/proton-drive-rs/src/node.rs diff --git a/crates/proton-drive-sdk/src/photos.rs b/crates/proton-drive-rs/src/photos.rs similarity index 100% rename from crates/proton-drive-sdk/src/photos.rs rename to crates/proton-drive-rs/src/photos.rs diff --git a/crates/proton-drive-sdk/tests/common/mod.rs b/crates/proton-drive-rs/tests/common/mod.rs similarity index 99% rename from crates/proton-drive-sdk/tests/common/mod.rs rename to crates/proton-drive-rs/tests/common/mod.rs index 3ef05ee..16f37e4 100644 --- a/crates/proton-drive-sdk/tests/common/mod.rs +++ b/crates/proton-drive-rs/tests/common/mod.rs @@ -14,7 +14,7 @@ use std::time::{SystemTime, UNIX_EPOCH}; use hmac::{Hmac, KeyInit, Mac}; -use proton_drive_sdk::ProtonDriveClient; +use proton_drive_rs::ProtonDriveClient; use proton_sdk::config::ProtonClientConfiguration; use proton_sdk::session::{PasswordMode, ProtonApiSession, ResumeParameters}; use serde::{Deserialize, Serialize}; diff --git a/crates/proton-drive-sdk/tests/live_drive_ops.rs b/crates/proton-drive-rs/tests/live_drive_ops.rs similarity index 96% rename from crates/proton-drive-sdk/tests/live_drive_ops.rs rename to crates/proton-drive-rs/tests/live_drive_ops.rs index 29b5197..ecb8569 100644 --- a/crates/proton-drive-sdk/tests/live_drive_ops.rs +++ b/crates/proton-drive-rs/tests/live_drive_ops.rs @@ -2,19 +2,19 @@ //! verification against a real Proton account. //! //! Skipped by default. Run against the test account with: -//! cargo test -p proton-drive-sdk --test live_drive_ops -- --ignored --nocapture +//! cargo test -p proton-drive-rs --test live_drive_ops -- --ignored --nocapture //! //! Each test cleans up after itself (trash + delete-from-trash) so the account //! stays reusable across runs. mod common; -use proton_drive_sdk::proton_sdk::crypto::VerificationStatus; -use proton_drive_sdk::{Node, NodeKind}; +use proton_drive_rs::proton_sdk::crypto::VerificationStatus; +use proton_drive_rs::{Node, NodeKind}; use proton_sdk::ids::NodeUid; /// Trash then permanently delete the given nodes; best-effort, logs on failure. -async fn cleanup(client: &proton_drive_sdk::ProtonDriveClient, uids: &[NodeUid]) { +async fn cleanup(client: &proton_drive_rs::ProtonDriveClient, uids: &[NodeUid]) { if let Err(e) = client.trash_nodes(uids).await { eprintln!("[cleanup] trash failed: {e}"); return; @@ -25,7 +25,7 @@ async fn cleanup(client: &proton_drive_sdk::ProtonDriveClient, uids: &[NodeUid]) } /// Fetch a node that must exist, panicking with context otherwise. -async fn get(client: &proton_drive_sdk::ProtonDriveClient, uid: &NodeUid, what: &str) -> Node { +async fn get(client: &proton_drive_rs::ProtonDriveClient, uid: &NodeUid, what: &str) -> Node { client .get_node(uid) .await diff --git a/crates/proton-drive-sdk/tests/live_events.rs b/crates/proton-drive-rs/tests/live_events.rs similarity index 96% rename from crates/proton-drive-sdk/tests/live_events.rs rename to crates/proton-drive-rs/tests/live_events.rs index d4e085b..b12d25e 100644 --- a/crates/proton-drive-sdk/tests/live_events.rs +++ b/crates/proton-drive-rs/tests/live_events.rs @@ -2,7 +2,7 @@ //! `enumerate_events`) against a real Proton account. //! //! Skipped by default. Run against the test account with: -//! cargo test -p proton-drive-sdk --test live_events -- --ignored --nocapture --test-threads=1 +//! cargo test -p proton-drive-rs --test live_events -- --ignored --nocapture --test-threads=1 //! //! Each test cleans up after itself (trash + delete-from-trash) so the account //! stays reusable across runs. @@ -16,11 +16,11 @@ mod common; use std::time::Duration; -use proton_drive_sdk::{DriveEvent, DriveEventScopeId}; +use proton_drive_rs::{DriveEvent, DriveEventScopeId}; use proton_sdk::ids::{DriveEventId, NodeUid}; /// Trash then permanently delete the given nodes; best-effort, logs on failure. -async fn cleanup(client: &proton_drive_sdk::ProtonDriveClient, uids: &[NodeUid]) { +async fn cleanup(client: &proton_drive_rs::ProtonDriveClient, uids: &[NodeUid]) { if let Err(e) = client.trash_nodes(uids).await { eprintln!("[cleanup] trash failed: {e}"); return; @@ -40,7 +40,7 @@ const POLL_DELAY: Duration = Duration::from_secs(2); /// cumulative (everything after the cursor), so we can re-poll the same cursor /// without losing earlier events. Returns `None` if nothing matched in time. async fn poll_for( - client: &proton_drive_sdk::ProtonDriveClient, + client: &proton_drive_rs::ProtonDriveClient, scope: &DriveEventScopeId, cursor: &DriveEventId, mut predicate: impl FnMut(&DriveEvent) -> bool, @@ -300,7 +300,7 @@ async fn permanent_delete_surfaces_node_deleted() { /// Seed the feed and return the cursor to enumerate from next. async fn seed( - client: &proton_drive_sdk::ProtonDriveClient, + client: &proton_drive_rs::ProtonDriveClient, scope: &DriveEventScopeId, ) -> DriveEventId { let seeded = client diff --git a/crates/proton-drive-sdk/tests/live_transfer_ops.rs b/crates/proton-drive-rs/tests/live_transfer_ops.rs similarity index 97% rename from crates/proton-drive-sdk/tests/live_transfer_ops.rs rename to crates/proton-drive-rs/tests/live_transfer_ops.rs index ea5f9f8..c795a2d 100644 --- a/crates/proton-drive-sdk/tests/live_transfer_ops.rs +++ b/crates/proton-drive-rs/tests/live_transfer_ops.rs @@ -3,7 +3,7 @@ //! Proton account. //! //! Skipped by default. Run against the test account with: -//! cargo test -p proton-drive-sdk --test live_transfer_ops -- --ignored --nocapture --test-threads=1 +//! cargo test -p proton-drive-rs --test live_transfer_ops -- --ignored --nocapture --test-threads=1 //! //! Each test cleans up after itself (trash + delete-from-trash) so the account //! stays reusable across runs. @@ -12,11 +12,11 @@ mod common; use std::io::Cursor; -use proton_drive_sdk::{NodeKind, Thumbnail, ThumbnailType}; +use proton_drive_rs::{NodeKind, Thumbnail, ThumbnailType}; use proton_sdk::ids::NodeUid; /// Trash then permanently delete the given nodes; best-effort, logs on failure. -async fn cleanup(client: &proton_drive_sdk::ProtonDriveClient, uids: &[NodeUid]) { +async fn cleanup(client: &proton_drive_rs::ProtonDriveClient, uids: &[NodeUid]) { if let Err(e) = client.trash_nodes(uids).await { eprintln!("[cleanup] trash failed: {e}"); return; diff --git a/crates/proton-drive-sdk/tests/live_upload_download.rs b/crates/proton-drive-rs/tests/live_upload_download.rs similarity index 95% rename from crates/proton-drive-sdk/tests/live_upload_download.rs rename to crates/proton-drive-rs/tests/live_upload_download.rs index dcef073..e8df090 100644 --- a/crates/proton-drive-sdk/tests/live_upload_download.rs +++ b/crates/proton-drive-rs/tests/live_upload_download.rs @@ -1,7 +1,7 @@ //! Live integration: upload → download → byte-equality round-trips. //! //! Skipped by default. Run against the test account with: -//! PROTON_TOTP_SECRET=... cargo test -p proton-drive-sdk --test live_upload_download -- --ignored --nocapture +//! PROTON_TOTP_SECRET=... cargo test -p proton-drive-rs --test live_upload_download -- --ignored --nocapture //! //! Each test cleans up after itself (trash + delete-from-trash) so the account //! stays reusable across runs. @@ -11,7 +11,7 @@ mod common; use proton_sdk::ids::NodeUid; /// Trash then permanently delete the given nodes; best-effort, logs on failure. -async fn cleanup(client: &proton_drive_sdk::ProtonDriveClient, uids: &[NodeUid]) { +async fn cleanup(client: &proton_drive_rs::ProtonDriveClient, uids: &[NodeUid]) { if let Err(e) = client.trash_nodes(uids).await { eprintln!("[cleanup] trash failed: {e}"); return;