Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 71 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/menew-clipboard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion crates/menew-clipboard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ mod linux_listener {
pub async fn start_gnome_dbus_listener(service: Arc<ClipboardService>) -> Result<zbus::Connection, Box<dyn std::error::Error + Send + Sync>> {
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)
Expand Down
20 changes: 10 additions & 10 deletions crates/menew-clipboard/src/secrets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -59,7 +59,7 @@ async fn run_prompt(conn: &Connection, prompt: &OwnedObjectPath) -> Result<bool,
let mut done = proxy.receive_signal("Completed").await.map_err(failed)?;
proxy.call_method("Prompt", &("",)).await.map_err(failed)?;
let msg = done.next().await.ok_or_else(|| failed("prompt closed"))?;
let (dismissed, _): (bool, OwnedValue) = msg.body().deserialize().map_err(failed)?;
let (dismissed, _): (bool, OwnedVariant) = msg.body().deserialize().map_err(failed)?;
Ok(!dismissed)
}

Expand All @@ -83,7 +83,7 @@ async fn open() -> Result<Ss<'static>, 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 })
}
Expand Down Expand Up @@ -151,9 +151,9 @@ impl Vault for SecretServiceVault {
return Ok(());
}
let attrs: HashMap<String, String> = 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)?;
Expand Down Expand Up @@ -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<String, String>), _> =
Expand Down
2 changes: 1 addition & 1 deletion crates/menew-desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion crates/menew/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down