From 8f45267616649960a88d1c412a5af6bb26524415 Mon Sep 17 00:00:00 2001 From: saying Date: Sun, 4 Aug 2024 17:23:25 +0800 Subject: [PATCH] chore(sea-orm): update to 1.0 --- .github/workflows/fmt.yml | 8 +- Cargo.lock | 73 +++++++++------ Cargo.toml | 2 +- crates/decrypt-cookies/src/browser/cookies.rs | 4 +- crates/decrypt-cookies/src/browser/info.rs | 12 +-- .../src/chromium/crypto/linux.rs | 2 +- .../src/chromium/crypto/macos.rs | 2 +- .../src/chromium/crypto/win.rs | 2 +- .../items/cookie/cookie_entities/cookies.rs | 53 ++++++----- .../items/cookie/cookie_entities/meta.rs | 15 ++-- .../items/cookie/cookie_entities/mod.rs | 2 +- .../items/cookie/cookie_entities/prelude.rs | 2 +- .../src/chromium/items/cookie/mod.rs | 68 +++++++------- .../insecure_credentials.rs | 11 +-- .../passwd/login_data_entities/logins.rs | 59 ++++++------- .../logins_edge_extended.rs | 10 +-- .../items/passwd/login_data_entities/meta.rs | 10 +-- .../items/passwd/login_data_entities/mod.rs | 2 +- .../login_data_entities/password_notes.rs | 12 +-- .../passwd/login_data_entities/prelude.rs | 2 +- .../items/passwd/login_data_entities/stats.rs | 8 +- .../sync_entities_metadata.rs | 4 +- .../sync_model_metadata.rs | 4 +- .../src/chromium/items/passwd/mod.rs | 88 +++++++++---------- .../src/chromium/local_state.rs | 4 +- crates/decrypt-cookies/src/chromium/mod.rs | 10 +-- .../items/cookie/entities/moz_cookies.rs | 28 +++--- .../src/firefox/items/cookie/mod.rs | 56 ++++++------ crates/decrypt-cookies/src/firefox/mod.rs | 4 +- crates/decrypt-cookies/src/safari/mod.rs | 2 +- .../src/safari/utils/binary_cookies.rs | 52 +++++------ .../tests/chromium_passwd_work.rs | 20 ++++- rustfmt.toml | 4 +- 33 files changed, 329 insertions(+), 306 deletions(-) diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index dae828d..1945099 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -22,10 +22,4 @@ jobs: COMMIT_MSG: | fmt: with nightly rustfmt run: | - cargo +nightly fmt --all - git config user.email "actions@github" - git config user.name "Github Actions" - git remote set-url origin https://x-access-token:"${GITHUB_TOKEN}"@github.com/"${GITHUB_REPOSITORY}".git - git add crates/ - # shellcheck disable=SC2015 - git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:"${GITHUB_REF}") + cargo +nightly fmt --check --all diff --git a/Cargo.lock b/Cargo.lock index 0daf701..6cb1e73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -674,7 +674,7 @@ dependencies = [ "serde", "serde_json", "sha1", - "strum 0.26.3", + "strum", "strum_macros", "tokio", "tracing", @@ -691,17 +691,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "digest" version = "0.10.7" @@ -749,6 +738,18 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "educe" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4bd92664bf78c4d3dba9b7cdafce6fa15b13ed3ed16175218196942e99168a8" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "either" version = "1.13.0" @@ -773,6 +774,26 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "enumflags2" version = "0.7.10" @@ -2301,9 +2322,9 @@ dependencies = [ [[package]] name = "sea-orm" -version = "0.12.15" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8814e37dc25de54398ee62228323657520b7f29713b8e238649385dbe473ee0" +checksum = "f9d4ec1cdd8bdd3553d3c946079f58efa33fedc477f32603652652abcef96fe6" dependencies = [ "async-stream", "async-trait", @@ -2315,7 +2336,7 @@ dependencies = [ "sea-query-binder", "serde", "sqlx", - "strum 0.25.0", + "strum", "thiserror", "tracing", "url", @@ -2323,9 +2344,9 @@ dependencies = [ [[package]] name = "sea-orm-macros" -version = "0.12.15" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e115c6b078e013aa963cc2d38c196c2c40b05f03d0ac872fe06b6e0d5265603" +checksum = "f363ead48b625a6f8f905322a820464f728fa4fe4f1c222bed5234ccf8fb8555" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -2337,20 +2358,20 @@ dependencies = [ [[package]] name = "sea-query" -version = "0.30.7" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4166a1e072292d46dc91f31617c2a1cdaf55a8be4b5c9f4bf2ba248e3ac4999b" +checksum = "7e5073b2cfed767511a57d18115f3b3d8bcb5690bf8c89518caec6cb22c0cd74" dependencies = [ - "derivative", + "educe", "inherent", "ordered-float", ] [[package]] name = "sea-query-binder" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36bbb68df92e820e4d5aeb17b4acd5cc8b5d18b2c36a4dd6f4626aabfa7ab1b9" +checksum = "754965d4aee6145bec25d0898e5c931e6c22859789ce62fd85a42a15ed5a8ce3" dependencies = [ "sea-query", "sqlx", @@ -2666,12 +2687,6 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" - [[package]] name = "strum" version = "0.26.3" @@ -2837,7 +2852,7 @@ dependencies = [ "clap", "decrypt-cookies", "miette", - "strum 0.26.3", + "strum", "tokio", "tracing", "tracing-subscriber", diff --git a/Cargo.toml b/Cargo.toml index 6e40142..4783c66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ panic = "abort" tokio = { version = "^1", features = ["macros"] } # futures = { version = "^0.3", default-features = false } -sea-orm = { version = "^0.12", default-features = false, features = ["sqlx-sqlite", "runtime-tokio-rustls", "macros"] } +sea-orm = { version = "^1", default-features = false, features = ["sqlx-sqlite", "runtime-tokio-rustls", "macros"] } dirs = { version = "^5" } diff --git a/crates/decrypt-cookies/src/browser/cookies.rs b/crates/decrypt-cookies/src/browser/cookies.rs index 4f2cc85..62c9de5 100644 --- a/crates/decrypt-cookies/src/browser/cookies.rs +++ b/crates/decrypt-cookies/src/browser/cookies.rs @@ -7,10 +7,10 @@ use serde::{Deserialize, Serialize}; #[derive(Debug)] #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct LeetCodeCookies { - pub csrf: String, + pub csrf: String, pub session: String, #[serde(skip)] - pub expiry: bool, + pub expiry: bool, } impl LeetCodeCookies { diff --git a/crates/decrypt-cookies/src/browser/info.rs b/crates/decrypt-cookies/src/browser/info.rs index d186fa6..ff31070 100644 --- a/crates/decrypt-cookies/src/browser/info.rs +++ b/crates/decrypt-cookies/src/browser/info.rs @@ -345,7 +345,7 @@ pub mod linux { #[derive(Default)] #[derive(PartialEq, Eq)] pub struct LinuxChromiumBase { - pub base: PathBuf, + pub base: PathBuf, pub browser: Browser, } @@ -394,7 +394,7 @@ pub mod linux { #[derive(Default)] #[derive(PartialEq, Eq)] pub struct LinuxFFBase { - base: PathBuf, + base: PathBuf, browser: Browser, } @@ -442,7 +442,7 @@ pub mod macos { #[derive(Default)] #[derive(PartialEq, Eq)] pub struct MacChromiumBase { - pub base: PathBuf, + pub base: PathBuf, pub browser: Browser, } @@ -496,7 +496,7 @@ pub mod macos { #[derive(PartialEq, Eq)] pub struct MacFFBase { pub base: PathBuf, - browser: Browser, + browser: Browser, } impl TempPath for MacFFBase { @@ -544,7 +544,7 @@ pub mod win { #[derive(Default)] #[derive(PartialEq, Eq)] pub struct WinChromiumBase { - base: PathBuf, + base: PathBuf, browser: Browser, } @@ -630,7 +630,7 @@ pub mod win { #[derive(Default)] #[derive(PartialEq, Eq)] pub struct WinFFBase { - base: PathBuf, + base: PathBuf, browser: Browser, } diff --git a/crates/decrypt-cookies/src/chromium/crypto/linux.rs b/crates/decrypt-cookies/src/chromium/crypto/linux.rs index 4b9934a..b1ad185 100644 --- a/crates/decrypt-cookies/src/chromium/crypto/linux.rs +++ b/crates/decrypt-cookies/src/chromium/crypto/linux.rs @@ -23,7 +23,7 @@ type Aes128CbcDec = cbc::Decryptor; #[derive(PartialEq, Eq)] pub struct Decrypter { pass_v11: &'static [u8], - browser: Browser, + browser: Browser, } impl Decrypter { diff --git a/crates/decrypt-cookies/src/chromium/crypto/macos.rs b/crates/decrypt-cookies/src/chromium/crypto/macos.rs index 5b8ff9b..31006ef 100644 --- a/crates/decrypt-cookies/src/chromium/crypto/macos.rs +++ b/crates/decrypt-cookies/src/chromium/crypto/macos.rs @@ -14,7 +14,7 @@ type Aes128CbcDec = cbc::Decryptor; #[derive(Default)] #[derive(PartialEq, Eq)] pub struct Decrypter { - browser: Browser, + browser: Browser, pass_v10: Vec, } diff --git a/crates/decrypt-cookies/src/chromium/crypto/win.rs b/crates/decrypt-cookies/src/chromium/crypto/win.rs index 06e3cea..ccc0e38 100644 --- a/crates/decrypt-cookies/src/chromium/crypto/win.rs +++ b/crates/decrypt-cookies/src/chromium/crypto/win.rs @@ -16,7 +16,7 @@ use crate::{chromium::local_state::LocalState, Browser}; #[derive(Default)] #[derive(PartialEq, Eq)] pub struct Decrypter { - pass: Vec, + pass: Vec, browser: Browser, } diff --git a/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/cookies.rs b/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/cookies.rs index db7b0e6..5c1ed92 100644 --- a/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/cookies.rs +++ b/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/cookies.rs @@ -1,34 +1,39 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; -#[derive(Clone)] -#[derive(Debug)] -#[derive(DeriveEntityModel)] -#[derive(PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "cookies")] pub struct Model { - pub creation_utc: i64, - pub host_key: String, + pub creation_utc: i64, + #[sea_orm(column_type = "Text")] + pub host_key: String, + #[sea_orm(column_type = "Text")] pub top_frame_site_key: String, - pub name: String, - pub value: String, + #[sea_orm(column_type = "Text")] + pub name: String, + #[sea_orm(column_type = "Text")] + pub value: String, #[sea_orm(primary_key, auto_increment = false)] - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))")] - pub encrypted_value: Vec, - pub path: String, - pub expires_utc: i64, - pub is_secure: i32, - pub is_httponly: i32, - pub last_access_utc: i64, - pub has_expires: i32, - pub is_persistent: i32, - pub priority: i32, - pub samesite: i32, - pub source_scheme: i32, - pub source_port: i32, - pub last_update_utc: i64, - // pub is_same_party: i32, + #[sea_orm(column_type = "Blob")] + pub encrypted_value: Vec, + #[sea_orm(column_type = "Text")] + pub path: String, + pub expires_utc: i64, + pub is_secure: i32, + pub is_httponly: i32, + pub last_access_utc: i64, + pub has_expires: i32, + pub is_persistent: i32, + pub priority: i32, + pub samesite: i32, + pub source_scheme: i32, + pub source_port: i32, + pub last_update_utc: i64, + // pub source_type: i32, + // pub has_cross_site_ancestor: i32, + // pub is_edgelegacycookie: i32, + // pub browser_provenance: i32, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/meta.rs b/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/meta.rs index 9d7fe3c..6a93f3a 100644 --- a/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/meta.rs +++ b/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/meta.rs @@ -1,21 +1,18 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; -#[derive(Clone)] -#[derive(Debug)] -#[derive(PartialEq, Eq, PartialOrd, Ord)] -#[derive(DeriveEntityModel)] +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "meta")] pub struct Model { #[sea_orm( primary_key, auto_increment = false, - column_type = "Binary(BlobSize::Blob(None))" + column_type = "custom(\"LONGVARCHAR\")" )] - pub key: Vec, - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)] - pub value: Option>, + pub key: String, + #[sea_orm(column_type = "custom(\"LONGVARCHAR\")", nullable)] + pub value: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/mod.rs b/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/mod.rs index edac5f0..3e2c577 100644 --- a/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/mod.rs +++ b/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/mod.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 pub mod prelude; diff --git a/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/prelude.rs b/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/prelude.rs index 1e3f90d..8a3b810 100644 --- a/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/prelude.rs +++ b/crates/decrypt-cookies/src/chromium/items/cookie/cookie_entities/prelude.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 #![allow(unused_imports)] pub use super::{cookies::Entity as CookiesDB, meta::Entity as MetaDB}; diff --git a/crates/decrypt-cookies/src/chromium/items/cookie/mod.rs b/crates/decrypt-cookies/src/chromium/items/cookie/mod.rs index 1e19775..888e10e 100644 --- a/crates/decrypt-cookies/src/chromium/items/cookie/mod.rs +++ b/crates/decrypt-cookies/src/chromium/items/cookie/mod.rs @@ -11,25 +11,25 @@ pub mod cookie_entities; #[derive(Debug)] #[derive(PartialEq, Eq)] pub struct ChromiumCookie { - pub creation_utc: Option>, - pub host_key: String, + pub creation_utc: Option>, + pub host_key: String, pub top_frame_site_key: String, - pub name: String, - pub value: String, - pub decrypted_value: Option, - pub path: String, + pub name: String, + pub value: String, + pub decrypted_value: Option, + pub path: String, /// - pub expires_utc: Option>, - pub is_secure: bool, - pub is_httponly: bool, - pub last_access_utc: Option>, - pub has_expires: bool, - pub is_persistent: bool, - pub priority: i32, - pub samesite: SameSite, - pub source_scheme: i32, - pub source_port: i32, - pub last_update_utc: Option>, + pub expires_utc: Option>, + pub is_secure: bool, + pub is_httponly: bool, + pub last_access_utc: Option>, + pub has_expires: bool, + pub is_persistent: bool, + pub priority: i32, + pub samesite: SameSite, + pub source_scheme: i32, + pub source_port: i32, + pub last_update_utc: Option>, } #[cfg(feature = "reqwest")] impl TryFrom for reqwest::header::HeaderValue { @@ -93,34 +93,34 @@ impl From for ChromiumCookie { fn from(value: cookies::Model) -> Self { #[allow(clippy::wildcard_in_or_patterns)] Self { - creation_utc: value + creation_utc: value .creation_utc .micros_to_chromium_utc(), - host_key: value.host_key, + host_key: value.host_key, top_frame_site_key: value.top_frame_site_key, - name: value.name, - value: value.value, - decrypted_value: None, - path: value.path, - expires_utc: value + name: value.name, + value: value.value, + decrypted_value: None, + path: value.path, + expires_utc: value .expires_utc .micros_to_chromium_utc(), - is_secure: value.is_secure != 0, - is_httponly: value.is_httponly != 0, - last_access_utc: value + is_secure: value.is_secure != 0, + is_httponly: value.is_httponly != 0, + last_access_utc: value .last_access_utc .micros_to_chromium_utc(), - has_expires: value.has_expires != 0, - is_persistent: value.is_persistent != 0, - priority: value.priority, - samesite: match value.samesite { + has_expires: value.has_expires != 0, + is_persistent: value.is_persistent != 0, + priority: value.priority, + samesite: match value.samesite { 1 => SameSite::Lax, 2 => SameSite::Strict, 0 | _ => SameSite::None, }, - source_scheme: value.source_scheme, - source_port: value.source_port, - last_update_utc: value + source_scheme: value.source_scheme, + source_port: value.source_port, + last_update_utc: value .last_update_utc .micros_to_chromium_utc(), } diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/insecure_credentials.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/insecure_credentials.rs index c7cf5ed..229acd8 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/insecure_credentials.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/insecure_credentials.rs @@ -1,15 +1,16 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "insecure_credentials")] pub struct Model { + // #[sea_orm(primary_key)] + pub parent_id: Option, #[sea_orm(primary_key)] - pub parent_id: i32, - pub insecurity_type: i32, - pub create_time: i64, - pub is_muted: i32, + pub insecurity_type: i32, + pub create_time: i64, + pub is_muted: i32, pub trigger_notification_from_backend: i32, } diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/logins.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/logins.rs index 02280b5..123c901 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/logins.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/logins.rs @@ -1,45 +1,44 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; -// NOTE: the comment field Yandex browser not have #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "logins")] pub struct Model { - pub origin_url: String, - pub action_url: Option, - pub username_element: Option, - pub username_value: Option, - pub password_element: Option, - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)] - pub password_value: Option>, - pub submit_element: Option, - pub signon_realm: String, - pub date_created: i64, - pub blacklisted_by_user: i32, - pub scheme: i32, - pub password_type: Option, - pub times_used: Option, - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)] - pub form_data: Option>, - pub display_name: Option, - pub icon_url: Option, - pub federation_url: Option, - pub skip_zero_click: Option, + pub origin_url: String, + pub action_url: Option, + pub username_element: Option, + pub username_value: Option, + pub password_element: Option, + #[sea_orm(column_type = "Blob", nullable)] + pub password_value: Option>, + pub submit_element: Option, + pub signon_realm: String, + pub date_created: i64, + pub blacklisted_by_user: i32, + pub scheme: i32, + pub password_type: Option, + pub times_used: Option, + #[sea_orm(column_type = "Blob", nullable)] + pub form_data: Option>, + pub display_name: Option, + pub icon_url: Option, + pub federation_url: Option, + pub skip_zero_click: Option, pub generation_upload_status: Option, - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)] - pub possible_username_pairs: Option>, + #[sea_orm(column_type = "Blob", nullable)] + pub possible_username_pairs: Option>, #[sea_orm(primary_key, auto_increment = true)] - pub id: i32, - pub date_last_used: i64, - // #[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)] + pub id: i32, + pub date_last_used: i64, + // #[sea_orm(column_type = "Blob", nullable)] // pub moving_blocked_for: Option>, - pub date_password_modified: i64, + pub date_password_modified: i64, // pub sender_email: Option, // pub sender_name: Option, - // pub date_received: Option, + // pub date_received: Option, // pub sharing_notification_displayed: i32, - // #[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)] + // #[sea_orm(column_type = "Blob", nullable)] // pub keychain_identifier: Option>, // pub sender_profile_image_url: Option, } diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/logins_edge_extended.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/logins_edge_extended.rs index 25b9ed2..9229c9a 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/logins_edge_extended.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/logins_edge_extended.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; @@ -6,11 +6,11 @@ use sea_orm::entity::prelude::*; #[sea_orm(table_name = "logins_edge_extended")] pub struct Model { #[sea_orm(primary_key, auto_increment = true)] - pub id: i32, - pub source: String, + pub id: i32, + pub source: String, pub strength_alert_status: i32, - pub password_nickname: String, - pub password_category: i32, + pub password_nickname: String, + pub password_category: i32, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/meta.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/meta.rs index 2201d75..6a93f3a 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/meta.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/meta.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; @@ -8,11 +8,11 @@ pub struct Model { #[sea_orm( primary_key, auto_increment = false, - column_type = "Binary(BlobSize::Blob(None))" + column_type = "custom(\"LONGVARCHAR\")" )] - pub key: Vec, - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)] - pub value: Option>, + pub key: String, + #[sea_orm(column_type = "custom(\"LONGVARCHAR\")", nullable)] + pub value: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/mod.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/mod.rs index 0ae9f04..cff77e2 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/mod.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/mod.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 pub mod prelude; diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/password_notes.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/password_notes.rs index f285766..9c4bf97 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/password_notes.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/password_notes.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; @@ -6,11 +6,11 @@ use sea_orm::entity::prelude::*; #[sea_orm(table_name = "password_notes")] pub struct Model { #[sea_orm(primary_key, auto_increment = true)] - pub id: i32, - pub parent_id: i32, - pub key: String, - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)] - pub value: Option>, + pub id: i32, + pub parent_id: i32, + pub key: String, + #[sea_orm(column_type = "Blob", nullable)] + pub value: Option>, pub date_created: i64, pub confidential: Option, } diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/prelude.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/prelude.rs index 9be654b..c4a27e0 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/prelude.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/prelude.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 #![allow(unused_imports)] pub use super::{ diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/stats.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/stats.rs index f17c890..371ea50 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/stats.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/stats.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; @@ -6,10 +6,10 @@ use sea_orm::entity::prelude::*; #[sea_orm(table_name = "stats")] pub struct Model { #[sea_orm(primary_key)] - pub origin_domain: String, - pub username_value: Option, + pub origin_domain: String, + pub username_value: Option, pub dismissal_count: Option, - pub update_time: i64, + pub update_time: i64, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/sync_entities_metadata.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/sync_entities_metadata.rs index 6ad4007..3de6c59 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/sync_entities_metadata.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/sync_entities_metadata.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; @@ -7,7 +7,7 @@ use sea_orm::entity::prelude::*; pub struct Model { #[sea_orm(primary_key, auto_increment = true)] pub storage_key: i32, - pub metadata: String, + pub metadata: String, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/sync_model_metadata.rs b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/sync_model_metadata.rs index 9c76d9c..2dadf43 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/sync_model_metadata.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/login_data_entities/sync_model_metadata.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15 +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0 use sea_orm::entity::prelude::*; @@ -6,7 +6,7 @@ use sea_orm::entity::prelude::*; #[sea_orm(table_name = "sync_model_metadata")] pub struct Model { #[sea_orm(primary_key, auto_increment = true)] - pub id: i32, + pub id: i32, pub model_metadata: String, } diff --git a/crates/decrypt-cookies/src/chromium/items/passwd/mod.rs b/crates/decrypt-cookies/src/chromium/items/passwd/mod.rs index 627aac3..771bb29 100644 --- a/crates/decrypt-cookies/src/chromium/items/passwd/mod.rs +++ b/crates/decrypt-cookies/src/chromium/items/passwd/mod.rs @@ -10,30 +10,30 @@ pub mod login_data_entities; #[derive(Debug)] #[derive(PartialEq, Eq)] pub struct LoginData { - pub origin_url: String, - pub action_url: Option, - pub username_element: Option, - pub username_value: Option, - pub password_element: Option, - pub password_value: Option, - pub submit_element: String, - pub signon_realm: String, - pub date_created: Option>, - pub blacklisted_by_user: i32, - pub scheme: i32, - pub password_type: i32, - pub times_used: i64, - pub form_data: Option>, - pub display_name: String, - pub icon_url: String, - pub federation_url: String, - pub skip_zero_click: i32, + pub origin_url: String, + pub action_url: Option, + pub username_element: Option, + pub username_value: Option, + pub password_element: Option, + pub password_value: Option, + pub submit_element: String, + pub signon_realm: String, + pub date_created: Option>, + pub blacklisted_by_user: i32, + pub scheme: i32, + pub password_type: i32, + pub times_used: i64, + pub form_data: Option>, + pub display_name: String, + pub icon_url: String, + pub federation_url: String, + pub skip_zero_click: i32, pub generation_upload_status: i32, - pub possible_username_pairs: Option>, - pub id: i32, - pub date_last_used: Option>, + pub possible_username_pairs: Option>, + pub id: i32, + pub date_last_used: Option>, // pub moving_blocked_for: Option>, - pub date_password_modified: Option>, + pub date_password_modified: Option>, // pub sender_email: String, // pub sender_name: String, // NOTE: I'm not sure what it do @@ -55,42 +55,42 @@ impl From for LoginData { // reduce user burden fn from(v: logins::Model) -> Self { Self { - origin_url: v.origin_url, - action_url: v.action_url, - username_element: v.username_element, - username_value: v.username_value, - password_element: v.password_element, - password_value: None, - submit_element: v + origin_url: v.origin_url, + action_url: v.action_url, + username_element: v.username_element, + username_value: v.username_value, + password_element: v.password_element, + password_value: None, + submit_element: v .submit_element .unwrap_or_default(), - signon_realm: v.signon_realm, - date_created: v + signon_realm: v.signon_realm, + date_created: v .date_created .micros_to_chromium_utc(), - blacklisted_by_user: v.blacklisted_by_user, - scheme: v.scheme, - password_type: v.password_type.unwrap_or_default(), - times_used: v.times_used.unwrap_or_default(), - form_data: v.form_data, - display_name: v.display_name.unwrap_or_default(), - icon_url: v.icon_url.unwrap_or_default(), - federation_url: v + blacklisted_by_user: v.blacklisted_by_user, + scheme: v.scheme, + password_type: v.password_type.unwrap_or_default(), + times_used: v.times_used.unwrap_or_default(), + form_data: v.form_data, + display_name: v.display_name.unwrap_or_default(), + icon_url: v.icon_url.unwrap_or_default(), + federation_url: v .federation_url .unwrap_or_default(), - skip_zero_click: v + skip_zero_click: v .skip_zero_click .unwrap_or_default(), generation_upload_status: v .generation_upload_status .unwrap_or_default(), - possible_username_pairs: v.possible_username_pairs, - id: v.id, - date_last_used: v + possible_username_pairs: v.possible_username_pairs, + id: v.id, + date_last_used: v .date_last_used .micros_to_chromium_utc(), // moving_blocked_for: v.moving_blocked_for, - date_password_modified: v + date_password_modified: v .date_password_modified .micros_to_chromium_utc(), // sender_email: v.sender_email.unwrap_or_default(), diff --git a/crates/decrypt-cookies/src/chromium/local_state.rs b/crates/decrypt-cookies/src/chromium/local_state.rs index c8719a2..87216ba 100644 --- a/crates/decrypt-cookies/src/chromium/local_state.rs +++ b/crates/decrypt-cookies/src/chromium/local_state.rs @@ -35,7 +35,7 @@ pub struct OsCrypt { pub struct YandexLocalState { #[serde(default)] pub audit_enabled: bool, - pub os_crypt: YandexOsCrypt, + pub os_crypt: YandexOsCrypt, } #[derive(Clone)] @@ -56,6 +56,6 @@ pub struct YandexOsCrypt { #[derive(PartialEq, Eq, PartialOrd, Ord)] #[derive(Deserialize, Serialize)] pub struct CheckerState { - pub counter: i32, + pub counter: i32, pub encrypted_data: String, } diff --git a/crates/decrypt-cookies/src/chromium/mod.rs b/crates/decrypt-cookies/src/chromium/mod.rs index 2dd0f0a..b7ae716 100644 --- a/crates/decrypt-cookies/src/chromium/mod.rs +++ b/crates/decrypt-cookies/src/chromium/mod.rs @@ -55,10 +55,10 @@ cfg_if::cfg_if!( #[derive(Debug)] #[derive(Default)] pub struct ChromiumGetter { - browser: Browser, - cookies_query: CookiesQuery, + browser: Browser, + cookies_query: CookiesQuery, login_data_query: LoginDataQuery, - crypto: Decrypter, + crypto: Decrypter, #[cfg(target_os = "linux")] pub info: LinuxChromiumBase, @@ -72,8 +72,8 @@ pub struct ChromiumGetter { #[derive(Default)] #[derive(PartialEq, Eq)] pub struct ChromiumBuilder { - browser: Browser, - cookies_path: Option, + browser: Browser, + cookies_path: Option, /// in windows, it store passwd local_state_path: Option, diff --git a/crates/decrypt-cookies/src/firefox/items/cookie/entities/moz_cookies.rs b/crates/decrypt-cookies/src/firefox/items/cookie/entities/moz_cookies.rs index 575bec0..906e0bf 100644 --- a/crates/decrypt-cookies/src/firefox/items/cookie/entities/moz_cookies.rs +++ b/crates/decrypt-cookies/src/firefox/items/cookie/entities/moz_cookies.rs @@ -9,30 +9,30 @@ use sea_orm::entity::prelude::*; #[sea_orm(table_name = "moz_cookies")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] - pub id: i32, + pub id: i32, #[sea_orm(column_name = "originAttributes")] - pub origin_attributes: String, - pub name: Option, - pub value: Option, - pub host: Option, - pub path: Option, - pub expiry: Option, + pub origin_attributes: String, + pub name: Option, + pub value: Option, + pub host: Option, + pub path: Option, + pub expiry: Option, #[sea_orm(column_name = "lastAccessed")] - pub last_accessed: Option, + pub last_accessed: Option, #[sea_orm(column_name = "creationTime")] - pub creation_time: Option, + pub creation_time: Option, #[sea_orm(column_name = "isSecure")] - pub is_secure: Option, + pub is_secure: Option, #[sea_orm(column_name = "isHttpOnly")] - pub is_http_only: Option, + pub is_http_only: Option, #[sea_orm(column_name = "inBrowserElement")] pub in_browser_element: Option, #[sea_orm(column_name = "sameSite")] - pub same_site: Option, + pub same_site: Option, #[sea_orm(column_name = "rawSameSite")] - pub raw_same_site: Option, + pub raw_same_site: Option, #[sea_orm(column_name = "schemeMap")] - pub scheme_map: Option, + pub scheme_map: Option, } #[derive(Copy, Clone)] diff --git a/crates/decrypt-cookies/src/firefox/items/cookie/mod.rs b/crates/decrypt-cookies/src/firefox/items/cookie/mod.rs index b8c087e..5e9937b 100644 --- a/crates/decrypt-cookies/src/firefox/items/cookie/mod.rs +++ b/crates/decrypt-cookies/src/firefox/items/cookie/mod.rs @@ -11,22 +11,22 @@ pub mod entities; #[derive(Debug)] #[derive(PartialEq, Eq)] pub struct MozCookies { - pub id: i32, - pub origin_attributes: String, - pub name: String, - pub value: String, - pub host: String, - pub path: String, + pub id: i32, + pub origin_attributes: String, + pub name: String, + pub value: String, + pub host: String, + pub path: String, /// - pub expiry: Option>, - pub last_accessed: Option>, - pub creation_time: Option>, - pub is_secure: bool, - pub is_http_only: bool, + pub expiry: Option>, + pub last_accessed: Option>, + pub creation_time: Option>, + pub is_secure: bool, + pub is_http_only: bool, pub in_browser_element: i32, - pub same_site: SameSite, - pub raw_same_site: i32, - pub scheme_map: i32, + pub same_site: SameSite, + pub raw_same_site: i32, + pub scheme_map: i32, } #[cfg(feature = "reqwest")] impl TryFrom for reqwest::header::HeaderValue { @@ -82,42 +82,42 @@ impl From for MozCookies { fn from(value: moz_cookies::Model) -> Self { #[allow(clippy::wildcard_in_or_patterns)] Self { - id: value.id, - origin_attributes: value.origin_attributes, - name: value.name.unwrap_or_default(), - value: value.value.unwrap_or_default(), - host: value.host.unwrap_or_default(), - path: value.path.unwrap_or_default(), - expiry: value + id: value.id, + origin_attributes: value.origin_attributes, + name: value.name.unwrap_or_default(), + value: value.value.unwrap_or_default(), + host: value.host.unwrap_or_default(), + path: value.path.unwrap_or_default(), + expiry: value .expiry .unwrap_or_default() .secs_to_moz_utc(), - last_accessed: value + last_accessed: value .last_accessed .unwrap_or_default() .micros_to_moz_utc(), - creation_time: value + creation_time: value .creation_time .unwrap_or_default() .micros_to_moz_utc(), - is_secure: value + is_secure: value .is_secure .is_some_and(|v| v != 0), - is_http_only: value + is_http_only: value .is_http_only .is_some_and(|v| v != 0), in_browser_element: value .in_browser_element .unwrap_or_default(), - same_site: match value.same_site.unwrap_or_default() { + same_site: match value.same_site.unwrap_or_default() { 1 => SameSite::Lax, 2 => SameSite::Strict, 0 | _ => SameSite::None, }, - raw_same_site: value + raw_same_site: value .raw_same_site .unwrap_or_default(), - scheme_map: value + scheme_map: value .scheme_map .unwrap_or_default(), } diff --git a/crates/decrypt-cookies/src/firefox/mod.rs b/crates/decrypt-cookies/src/firefox/mod.rs index a44be41..30683d5 100644 --- a/crates/decrypt-cookies/src/firefox/mod.rs +++ b/crates/decrypt-cookies/src/firefox/mod.rs @@ -29,7 +29,7 @@ cfg_if::cfg_if!( #[derive(Debug)] #[derive(Default)] pub struct FirefoxGetter { - browser: Browser, + browser: Browser, cookies_query: CookiesQuery, #[cfg(target_os = "linux")] @@ -44,7 +44,7 @@ pub struct FirefoxGetter { #[derive(Debug)] #[derive(Default)] pub struct FirefoxBuilder { - browser: Browser, + browser: Browser, cookies_path: Option, } diff --git a/crates/decrypt-cookies/src/safari/mod.rs b/crates/decrypt-cookies/src/safari/mod.rs index dab24a1..2cf8ff3 100644 --- a/crates/decrypt-cookies/src/safari/mod.rs +++ b/crates/decrypt-cookies/src/safari/mod.rs @@ -15,7 +15,7 @@ use crate::{Browser, LeetCodeCookies}; #[derive(PartialEq, Eq)] pub struct SafariGetter { pub cookie_getter: CookiesGetter, - browser: Browser, + browser: Browser, } #[derive(Clone)] diff --git a/crates/decrypt-cookies/src/safari/utils/binary_cookies.rs b/crates/decrypt-cookies/src/safari/utils/binary_cookies.rs index e88b8da..0c2371c 100644 --- a/crates/decrypt-cookies/src/safari/utils/binary_cookies.rs +++ b/crates/decrypt-cookies/src/safari/utils/binary_cookies.rs @@ -33,11 +33,11 @@ impl I64ToSafariTime for i64 { #[derive(Default)] #[derive(PartialEq, Eq)] pub struct BinaryCookies { - signature: Vec, - num_pages: u32, // be + signature: Vec, + num_pages: u32, // be pages_offset: Vec, // be - pub pages: Vec, - checksum: Vec, // 8 byte + pub pages: Vec, + checksum: Vec, // 8 byte } impl BinaryCookies { @@ -73,11 +73,11 @@ impl BinaryCookies { #[derive(Default)] #[derive(PartialEq, Eq)] pub struct Page { - pages_start: Vec, - num_cookies: u32, // le + pages_start: Vec, + num_cookies: u32, // le cookies_offsets: Vec, // le, N * `self.num_cookies` - page_end: Vec, // Must be equal to []byte{0x00_00_00_00} - pub cookies: Vec, + page_end: Vec, // Must be equal to []byte{0x00_00_00_00} + pub cookies: Vec, } impl Page { @@ -297,25 +297,25 @@ impl BinaryCookies { #[derive(PartialEq, Eq)] pub struct SafariCookie { // cookie_size: u32, // LE_uint32 Cookie size. Number of bytes associated to the cookie - pub version: Vec, // byte Unknown field possibly related to the cookie flags - cookie_flags: u32, /* LE_uint32 0x0:None , 0x1:Secure , 0x4:HttpOnly , 0x5:Secure+HttpOnly */ - pub same_site: SameSite, - pub is_secure: bool, - pub is_httponly: bool, - pub has_port: [u8; 4], // size: 4 byte 0 or 1 - pub domain_offset: u32, // LE_uint32 Cookie domain offset - name_offset: u32, // LE_uint32 Cookie name offset - path_offset: u32, // LE_uint32 Cookie path offset - value_offset: u32, // LE_uint32 Cookie value offset - comment_offset: u32, // LE_uint32 Cookie comment offset + pub version: Vec, // byte Unknown field possibly related to the cookie flags + cookie_flags: u32, /* LE_uint32 0x0:None , 0x1:Secure , 0x4:HttpOnly , 0x5:Secure+HttpOnly */ + pub same_site: SameSite, + pub is_secure: bool, + pub is_httponly: bool, + pub has_port: [u8; 4], // size: 4 byte 0 or 1 + pub domain_offset: u32, // LE_uint32 Cookie domain offset + name_offset: u32, // LE_uint32 Cookie name offset + path_offset: u32, // LE_uint32 Cookie path offset + value_offset: u32, // LE_uint32 Cookie value offset + comment_offset: u32, // LE_uint32 Cookie comment offset // end_header: Vec, /* 4 byte Marks the end of a header. Must be equal to []byte{0x00000000} */ - pub expires: Option>, /* float64 Cookie expiration time in Mac epoch time. Add 978307200 to turn into Unix */ - pub creation: Option>, /* float64 Cookie creation time in Mac epoch time. Add 978307200 to turn into Unix */ - pub comment: String, /* N LE_uint32 Cookie comment string. N = `self.domain_offset` - `self.comment_offset` */ - pub domain: String, /* N LE_uint32 Cookie domain string. N = `self.name_offset` - `self.domain_offset` */ - pub name: String, /* N LE_uint32 Cookie name string. N = `self.path_offset` - `self.name_offset` */ - pub path: String, /* N LE_uint32 Cookie path string. N = `self.value_offset` - `self.path_offset` */ - pub value: String, /* N LE_uint32 Cookie value string. N = `self.cookie_size` - `self.value_offset` */ + pub expires: Option>, /* float64 Cookie expiration time in Mac epoch time. Add 978307200 to turn into Unix */ + pub creation: Option>, /* float64 Cookie creation time in Mac epoch time. Add 978307200 to turn into Unix */ + pub comment: String, /* N LE_uint32 Cookie comment string. N = `self.domain_offset` - `self.comment_offset` */ + pub domain: String, /* N LE_uint32 Cookie domain string. N = `self.name_offset` - `self.domain_offset` */ + pub name: String, /* N LE_uint32 Cookie name string. N = `self.path_offset` - `self.name_offset` */ + pub path: String, /* N LE_uint32 Cookie path string. N = `self.value_offset` - `self.path_offset` */ + pub value: String, /* N LE_uint32 Cookie value string. N = `self.cookie_size` - `self.value_offset` */ } #[cfg(feature = "reqwest")] impl TryFrom for reqwest::header::HeaderValue { diff --git a/crates/decrypt-cookies/tests/chromium_passwd_work.rs b/crates/decrypt-cookies/tests/chromium_passwd_work.rs index 09826d5..7b137d0 100644 --- a/crates/decrypt-cookies/tests/chromium_passwd_work.rs +++ b/crates/decrypt-cookies/tests/chromium_passwd_work.rs @@ -4,10 +4,16 @@ use strum::IntoEnumIterator; #[ignore = "need realy environment"] #[tokio::test] async fn passwd() { - let edge_getter = ChromiumBuilder::new(Browser::Yandex) + let edge_getter = match ChromiumBuilder::new(Browser::Yandex) .build() .await - .unwrap(); + { + Ok(it) => it, + Err(e) => { + eprintln!("{e}"); + return; + }, + }; let res = edge_getter .get_logins_all() .await @@ -32,10 +38,16 @@ async fn passwd() { async fn passwd_browsers() { for browser in Browser::iter().skip_while(|v| !v.is_chromium_base()) { dbg!(browser); - let getter = ChromiumBuilder::new(browser) + let getter = match ChromiumBuilder::new(browser) .build() .await - .unwrap(); + { + Ok(it) => it, + Err(e) => { + eprintln!("{e}"); + continue; + }, + }; let res = match getter.get_logins_all().await { Ok(v) => v, Err(e) => { diff --git a/rustfmt.toml b/rustfmt.toml index cc75313..61bc42c 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -13,7 +13,7 @@ comment_width = 80 condense_wildcard_suffixes = true control_brace_style = "ClosingNextLine" empty_item_single_line = true -enum_discrim_align_threshold = 30 +# enum_discrim_align_threshold = 30 error_on_line_overflow = false error_on_unformatted = false fn_params_layout = "Tall" @@ -58,7 +58,7 @@ single_line_let_else_max_width = 50 space_after_colon = true space_before_colon = false spaces_around_ranges = false -struct_field_align_threshold = 30 +# struct_field_align_threshold = 30 struct_lit_single_line = true # param struct in single line struct_lit_width = 35 struct_variant_width = 18