Compare commits

..
Author SHA1 Message Date
nvrl 0488ccd5f6 Merge pull request #114 from narrrl/refactor/sdk-login
refactor(core): sign in through proton_sdk::login
2026-11-20 17:53:42 +01:00
nvrl 62d16e03cf refactor(core): sign in through proton_sdk::login
The sign-in sequence moved from proton_auth_rs::session into proton-sdk
0.12.2. Same stored session, same messages; pdfs-core keeps only the
keyring feature of proton-auth-rs.
2026-11-20 17:37:54 +01:00
nvrl c92f78b5c8 Merge pull request #113 from narrrl/refactor/shared-sign-in
refactor(core): sign in through proton_auth_rs::session
2026-11-20 15:52:58 +01:00
nvrl b034e1d4e3 Merge pull request #112 from narrrl/fix/po-catalogs
fix(i18n): bring every catalog up to date with the sources
2026-11-20 15:52:49 +01:00
nvrl 43b76d4791 fix(i18n): bring every catalog up to date with the sources
The Drive galleries, hidden albums and move-recovery strings had been
added without regenerating po/, so 11 were untranslated and 17 fell back
to unrelated fuzzy matches ("Hidden albums" showed as "No albums").
Regenerated with po/update.sh and translated in all eight languages.
2026-11-20 15:37:46 +01:00
14 changed files with 5263 additions and 4124 deletions

No files matched your search

Generated
+4 -6
View File
@@ -3934,8 +3934,6 @@ dependencies = [
"dbus-secret-service",
"dbus-secret-service-keyring-store",
"keyring-core",
"proton-sdk",
"serde_json",
"thiserror 2.0.21",
"tracing",
"windows-native-keyring-store",
@@ -3954,9 +3952,9 @@ dependencies = [
[[package]]
name = "proton-drive-rs"
version = "0.12.1"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d05ad4be849ce2104759631063dd06867fbe6b6f0e5c37a172a84b5a90203fa7"
checksum = "bdeb7ee7495bc34198c78d7ec569f6371ad01a88f188b5eee418b013b082626a"
dependencies = [
"async-trait",
"base64 0.23.1",
@@ -4061,9 +4059,9 @@ dependencies = [
[[package]]
name = "proton-sdk"
version = "0.12.1"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80c381e9066c0bca3c32597df2e902eecaa4c6e05e202e70ec9d0ac2eec78bfe"
checksum = "3189873dcdf0bc0a3d0fa5619cea80594085252d1d66a57459ec6adfd1f35ac1"
dependencies = [
"aes-gcm 0.11.1",
"async-trait",
+2 -2
View File
@@ -15,8 +15,8 @@ keywords = ["proton", "drive", "fuse", "sync", "linux"]
categories = ["filesystem", "command-line-utilities"]
[workspace.dependencies]
proton-sdk = { version = "0.12.1" }
proton-drive-rs = { version = "0.12.1" }
proton-sdk = { version = "0.12.2" }
proton-drive-rs = { version = "0.12.2" }
proton-gallery-app-rs = "0.1.0"
proton-gallery-rs = "0.1.1"
chrono = { version = "0.4", default-features = false, features = ["std"] }
+1 -1
View File
@@ -25,7 +25,7 @@ shell-words.workspace = true
sha2.workspace = true
rusqlite.workspace = true
keyring-core.workspace = true
proton-auth-rs = { workspace = true, features = ["keyring", "session"] }
proton-auth-rs = { workspace = true, features = ["keyring"] }
proton-base-rs.workspace = true
dbus-secret-service-keyring-store.workspace = true
dbus-secret-service.workspace = true
+14 -16
View File
@@ -28,7 +28,6 @@ use std::time::Duration;
use base64::Engine as _;
use base64::engine::general_purpose::STANDARD as BASE64;
use keyring_core::Entry;
use proton_auth_rs::session::{self, SignInError, Step};
use proton_auth_rs::{KeyringStore, SecretStore};
use proton_drive_rs::{KeySalt, ProtonDriveClient};
use proton_sdk::account::KeyPassphrases;
@@ -37,6 +36,7 @@ use proton_sdk::cache::EncryptedCacheRepository;
use proton_sdk::config::ProtonClientConfiguration;
use proton_sdk::error::ProtonError;
use proton_sdk::http::Tokens;
use proton_sdk::login::{self, LoginError, Step};
use proton_sdk::session::{PasswordMode, ProtonApiSession, ResumeParameters};
use proton_sdk::telemetry::TracingTelemetry;
use serde::{Deserialize, Serialize};
@@ -280,12 +280,12 @@ pub async fn login_verified(
get_totp: impl Fn() -> Result<String>,
get_mailbox: impl Fn(u32) -> Result<Mailbox>,
) -> Result<()> {
// The sequence is `proton_auth_rs::session`, shared with the other Proton
// The sequence is `proton_sdk::login`, shared with the other Proton
// apps. It reads the key salts before unlocking, while this access token
// still has the `locked` scope: after its first refresh it never will
// again, and without them no later resume can unlock the key chain. See
// `StoredSession::key_salts`.
let mut step = session::begin(client_config(), username, password, verification)
let mut step = login::begin(client_config(), username, password, verification)
.await
.map_err(sign_in_error)?;
let (unlocked, remember) = loop {
@@ -305,9 +305,7 @@ pub async fn login_verified(
let mailbox = get_mailbox(attempt)?;
match pending.mailbox_password(&mailbox.password).await {
Ok(unlocked) => break (unlocked, mailbox.remember),
Err(SignInError::WrongMailboxPassword)
if attempt + 1 < MAILBOX_ATTEMPTS =>
{
Err(LoginError::WrongMailboxPassword) if attempt + 1 < MAILBOX_ATTEMPTS => {
attempt += 1;
}
Err(e) => return Err(sign_in_error(e)),
@@ -317,16 +315,16 @@ pub async fn login_verified(
};
};
let tokens = unlocked.tokens().await;
let tokens = unlocked.resume_parameters().await;
register_refresh_handler(&unlocked.session, tokens.refresh_token.clone());
let stored = StoredSession {
session_id: tokens.session_id,
session_id: tokens.session_id.as_str().to_owned(),
username: tokens.username,
user_id: tokens.user_id,
user_id: tokens.user_id.as_str().to_owned(),
access_token: tokens.access_token,
refresh_token: tokens.refresh_token,
scopes: tokens.scopes,
password_mode: session::password_mode_to_wire(tokens.password_mode),
password_mode: tokens.password_mode.to_wire() as u8,
mailbox_password: String::new(),
key_salts: unlocked.key_salts,
key_passphrases: None,
@@ -412,15 +410,15 @@ fn decode_secret(secret: &[u8]) -> Option<KeyPassphrases> {
/// names a solvable method is a [`Error::HumanVerificationRequired`]: one that
/// offers only `email`/`sms` stays a plain API error, because sending the UI to
/// open a page it cannot complete reads as a hang rather than a refusal.
fn sign_in_error(e: SignInError) -> Error {
fn sign_in_error(e: LoginError) -> Error {
match e {
SignInError::HumanVerification(hv) => Error::HumanVerificationRequired(hv),
SignInError::SecurityKeyOnly => Error::SecurityKeyOnly,
SignInError::Blocked(api) | SignInError::Rejected(api) | SignInError::WrongCode(api) => {
LoginError::HumanVerification(hv) => Error::HumanVerificationRequired(hv),
LoginError::SecurityKeyOnly => Error::SecurityKeyOnly,
LoginError::Blocked(api) | LoginError::Rejected(api) | LoginError::WrongCode(api) => {
Error::Proton(ProtonError::Api(api))
}
SignInError::WrongMailboxPassword => Error::WrongMailboxPassword,
SignInError::Proton(e) => e.into(),
LoginError::WrongMailboxPassword => Error::WrongMailboxPassword,
LoginError::Proton(e) => e.into(),
other => Error::Other(other.to_string()),
}
}
+2 -2
View File
@@ -13,8 +13,8 @@ scratch (user data in `staging/` and `recovery/` is never touched by this).
### Changed
- Signing in runs through `proton_auth_rs::session`, the sequence Proton Gallery and
Proton Stream use too. The stored session, the lock/unlock choice for two-password
- Signing in runs through `proton_sdk::login` (proton-sdk 0.12.2), the sequence Proton
Gallery and Proton Stream use too. The stored session, the lock/unlock choice for two-password
accounts, the three mailbox-password tries and the messages stay as they were.
- An account whose only second factor is a security key now gets a clear message at
sign-in instead of a code prompt that could only fail.
+582 -455
View File
File diff suppressed because it is too large. Load diff
+587 -460
View File
File diff suppressed because it is too large. Load diff
+582 -455
View File
File diff suppressed because it is too large. Load diff
+582 -455
View File
File diff suppressed because it is too large. Load diff
+582 -455
View File
File diff suppressed because it is too large. Load diff
+583 -455
View File
File diff suppressed because it is too large. Load diff
+577 -451
View File
File diff suppressed because it is too large. Load diff
+583 -456
View File
File diff suppressed because it is too large. Load diff
+582 -455
View File
File diff suppressed because it is too large. Load diff