mirror of
https://github.com/narrrl/proton-sdk-rs.git
synced 2026-11-04 00:47:01 +01:00
renamed for crate
This commit is contained in:
1 parent
c98ec2d55d
commit
643f5a2c3b
19 files changed
+30
-30
No files matched your search
@@ -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" }
|
||||
File renamed without changes.
+2
-2
@@ -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;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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 {
|
||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -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};
|
||||
+5
-5
@@ -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
|
||||
+5
-5
@@ -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
|
||||
+3
-3
@@ -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;
|
||||
+2
-2
@@ -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;
|
||||
Reference in new issue
Block a user