Files
ente/rust/src/cli/account.rs
Manav Rathi 48757af5d0 fix(rust): Fix SRP authentication implementation
Fixed issues preventing successful authentication:
- Corrected Argon2 memory limit handling (API sends bytes, not KB)
- Replaced Blake2b with crypto_kdf_derive_from_key for login subkey derivation
- Fixed serde field names to match API expectations (srpUserID, sessionID)
- Added non-interactive mode for CLI testing
- Added support for ENTE_ENDPOINT environment variable

The implementation now matches the web client's key derivation exactly,
enabling successful authentication with both local and production servers.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-22 18:23:16 +05:30

59 lines
1.3 KiB
Rust

use clap::{Args, Subcommand};
#[derive(Args)]
pub struct AccountCommand {
#[command(subcommand)]
pub command: AccountSubcommands,
}
#[derive(Subcommand)]
pub enum AccountSubcommands {
/// List configured accounts
List,
/// Login into existing account
Add {
/// Email address (optional - will prompt if not provided)
#[arg(long)]
email: Option<String>,
/// Password (optional - will prompt if not provided)
#[arg(long)]
password: Option<String>,
/// Specify the app (photos, locker, auth)
#[arg(long, default_value = "photos")]
app: String,
/// Export directory path
#[arg(long)]
export_dir: Option<String>,
},
/// Update an existing account's export directory
Update {
/// Email address of the account
#[arg(long)]
email: String,
/// Export directory path
#[arg(long)]
dir: String,
/// Specify the app (photos, locker, auth)
#[arg(long, default_value = "photos")]
app: String,
},
/// Get token for an account for a specific app
GetToken {
/// Email address of the account
#[arg(long)]
email: String,
/// Specify the app (photos, locker, auth)
#[arg(long, default_value = "photos")]
app: String,
},
}