diff --git a/Cargo.lock b/Cargo.lock index 9ab08c2..a80dc48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,7 +44,7 @@ dependencies = [ "tokio", "tracing", "url", - "zbus", + "zbus 5.19.0", ] [[package]] @@ -909,7 +909,7 @@ dependencies = [ "pastey", "serde", "tokio", - "zbus", + "zbus 5.19.0", ] [[package]] @@ -1051,7 +1051,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "zbus", + "zbus 6.5.0", ] [[package]] @@ -1064,7 +1064,7 @@ dependencies = [ "tempfile", "tokio", "tracing", - "zbus", + "zbus 6.5.0", ] [[package]] @@ -1091,7 +1091,7 @@ dependencies = [ "ashpd", "tokio", "tracing", - "zbus", + "zbus 6.5.0", ] [[package]] @@ -2292,11 +2292,39 @@ dependencies = [ "uuid", "windows-sys 0.61.2", "winnow", - "zbus_macros", + "zbus_macros 5.19.0", "zbus_names", "zvariant", ] +[[package]] +name = "zbus" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a7f9f5dd97fa527c1202ba1cb35d48e07f77d4de8542317c854f7aef22b0668" +dependencies = [ + "async-trait", + "bitflags", + "endi", + "futures-core", + "hex", + "libc", + "ordered-stream", + "rustix", + "serde", + "serde_repr", + "socket2", + "tokio", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow", + "zbus_macros 6.6.0", + "zbus_utils", + "zcheapstr", + "zruntime", +] + [[package]] name = "zbus_macros" version = "5.19.0" @@ -2312,6 +2340,18 @@ dependencies = [ "zvariant_utils", ] +[[package]] +name = "zbus_macros" +version = "6.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6101224e3a5ff01f23f19510837e30aae926060869781b79f7b230203420c26" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", + "zbus_utils", +] + [[package]] name = "zbus_names" version = "4.3.5" @@ -2323,11 +2363,24 @@ dependencies = [ "zvariant", ] +[[package]] +name = "zbus_utils" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b180774785a9d3ae6695dbf0d0baac91eb4facef62f7be0007d3e3965d86fc6" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 3.0.10", + "winnow", +] + [[package]] name = "zcheapstr" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "939f186d9ecebe044315a5cb6d6f78568bbc21152adc954d5a0c2f58bdbc9920" +checksum = "2da34e7164b75d803c3197b86e6cf61b874106fbd472c5082575a8bc5fbd0907" dependencies = [ "serde", ] @@ -2412,6 +2465,16 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" +[[package]] +name = "zruntime" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac67096b97c00742108c4674db6bb6178adb78c4b66a506b0e4a7a9593aa5d9e" +dependencies = [ + "futures-core", + "futures-io", +] + [[package]] name = "zvariant" version = "5.15.1" diff --git a/crates/menew-clipboard/Cargo.toml b/crates/menew-clipboard/Cargo.toml index 00277c6..72edd2d 100644 --- a/crates/menew-clipboard/Cargo.toml +++ b/crates/menew-clipboard/Cargo.toml @@ -12,7 +12,7 @@ tracing = "0.1" serde = { version = "1.0", features = ["derive"] } [target.'cfg(target_os = "linux")'.dependencies] -zbus = { version = "5", default-features = false, features = ["tokio"] } +zbus = { version = "6", default-features = false, features = ["tokio", "proxy", "service"] } futures-util = "0.3" [dev-dependencies] diff --git a/crates/menew-clipboard/src/lib.rs b/crates/menew-clipboard/src/lib.rs index 5d8b6ca..e8718d8 100644 --- a/crates/menew-clipboard/src/lib.rs +++ b/crates/menew-clipboard/src/lib.rs @@ -358,7 +358,7 @@ mod linux_listener { pub async fn start_gnome_dbus_listener(service: Arc) -> Result> { let dbus_obj = MenewDbusClipboard { service }; - let conn = zbus::connection::Builder::session()?.name("org.menew.ClipboardService")?.serve_at("/org/menew/Clipboard", dbus_obj)?.build().await?; + let conn = zbus::connection::Builder::session().name("org.menew.ClipboardService").serve_at("/org/menew/Clipboard", dbus_obj).build().await?; info!("D-Bus service 'org.menew.ClipboardService' registered successfully on session bus"); Ok(conn) diff --git a/crates/menew-clipboard/src/secrets.rs b/crates/menew-clipboard/src/secrets.rs index a4dc7b7..8ccf717 100644 --- a/crates/menew-clipboard/src/secrets.rs +++ b/crates/menew-clipboard/src/secrets.rs @@ -12,8 +12,8 @@ use menew_core::notes::{Auth, Authenticator, Vault, VaultError}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::future::Future; -use zbus::zvariant::{Dict, OwnedObjectPath, OwnedValue, Type, Value}; -use zbus::{Connection, Proxy}; +use zbus::zvariant::Type; +use zbus::{Connection, Dict, OwnedObjectPath, OwnedVariant, Proxy, Variant}; const SS: &str = "org.freedesktop.secrets"; const SS_PATH: &str = "/org/freedesktop/secrets"; @@ -59,7 +59,7 @@ async fn run_prompt(conn: &Connection, prompt: &OwnedObjectPath) -> Result Result, VaultError> { let service = Proxy::new(&conn, SS, SS_PATH, SS_SERVICE) .await .map_err(|e| VaultError::Unavailable(e.to_string()))?; - let opened: Result<(OwnedValue, OwnedObjectPath), _> = service.call("OpenSession", &("plain", Value::from(""))).await; + let opened: Result<(OwnedVariant, OwnedObjectPath), _> = service.call("OpenSession", &("plain", Variant::from(""))).await; let (_, session) = opened.map_err(|e| VaultError::Unavailable(e.to_string()))?; Ok(Ss { conn, service, session }) } @@ -151,9 +151,9 @@ impl Vault for SecretServiceVault { return Ok(()); } let attrs: HashMap = HashMap::from([("application".to_string(), APPLICATION.to_string()), ("note".to_string(), id.to_string())]); - let mut props: HashMap<&str, Value> = HashMap::new(); - props.insert("org.freedesktop.Secret.Item.Label", Value::from(label)); - props.insert("org.freedesktop.Secret.Item.Attributes", Value::from(Dict::from(attrs))); + let mut props: HashMap<&str, Variant> = HashMap::new(); + props.insert("org.freedesktop.Secret.Item.Label", Variant::from(label)); + props.insert("org.freedesktop.Secret.Item.Attributes", Variant::from(Dict::from(attrs))); let proxy = Proxy::new(&ss.conn, SS, coll.as_str(), SS_COLLECTION).await.map_err(failed)?; let (_item, prompt): (OwnedObjectPath, OwnedObjectPath) = proxy.call("CreateItem", &(props, ss.secret(text), true)).await.map_err(failed)?; @@ -217,9 +217,9 @@ impl Authenticator for PolkitAuthenticator { Ok(p) => p, Err(e) => return cannot_ask(&format!("no polkit: {e}")), }; - let mut subject: HashMap<&str, Value> = HashMap::new(); - subject.insert("pid", Value::from(std::process::id())); - subject.insert("start-time", Value::from(start_time())); + let mut subject: HashMap<&str, Variant> = HashMap::new(); + subject.insert("pid", Variant::from(std::process::id())); + subject.insert("start-time", Variant::from(start_time())); let details: HashMap<&str, &str> = HashMap::new(); // flags: 1 = AllowUserInteraction let reply: Result<(bool, bool, HashMap), _> = diff --git a/crates/menew-desktop/Cargo.toml b/crates/menew-desktop/Cargo.toml index 5ebde3f..8ce1fd0 100644 --- a/crates/menew-desktop/Cargo.toml +++ b/crates/menew-desktop/Cargo.toml @@ -10,5 +10,5 @@ tracing = "0.1" [target.'cfg(target_os = "linux")'.dependencies] ashpd = { version = "0.10", default-features = false, features = ["tokio", "tracing"] } -zbus = { version = "5", default-features = false, features = ["tokio"] } +zbus = { version = "6", default-features = false, features = ["tokio", "proxy", "service"] } tokio = { version = "1.0", features = ["full"] } diff --git a/crates/menew/Cargo.toml b/crates/menew/Cargo.toml index 9cf7a5a..5a6e88f 100644 --- a/crates/menew/Cargo.toml +++ b/crates/menew/Cargo.toml @@ -19,7 +19,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } [target.'cfg(target_os = "linux")'.dependencies] libadwaita = { version = "0.7", package = "libadwaita", features = ["v1_2"] } gtk4 = { version = "0.9", package = "gtk4" } -zbus = { version = "5", default-features = false, features = ["tokio"] } +zbus = { version = "6", default-features = false, features = ["tokio", "proxy", "service"] } ashpd = { version = "0.10", default-features = false, features = ["tokio", "tracing"] } [package.metadata.deb]