Skip to content

Commit

Permalink
Merge pull request dbus2#1039 from zeenix/drop-cookies
Browse files Browse the repository at this point in the history
💥 zb: Drop support for `DBUS_COOKIE_SHA1` auth mechanism
  • Loading branch information
zeenix authored Oct 4, 2024
2 parents 2c4f8e3 + c49244e commit b8da34d
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 631 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ jobs:
dbus-run-session --config-file /tmp/dbus-session.conf -- \
cargo --locked test --profile "$PROFILE" --verbose --features uuid,url,time,chrono,option-as-array,vsock,bus-impl \
-- --skip fdpass_systemd
# check cookie-sha1 auth against dbus-daemon
sed -i s/EXTERNAL/DBUS_COOKIE_SHA1/g /tmp/dbus-session.conf
dbus-run-session --config-file /tmp/dbus-session.conf -- cargo --locked test --profile "$PROFILE" --verbose -- basic_connection
# Test tokio support.
dbus-run-session --config-file /tmp/dbus-session.conf -- \
cargo --locked test --profile "$PROFILE" --verbose --tests -p zbus --no-default-features \
Expand Down
72 changes: 0 additions & 72 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion zbus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ async-broadcast = "0.7.0"
hex = "0.4.3"
ordered-stream = "0.2"
rand = "0.8.5"
sha1 = { version = "0.10.6", features = ["std"] }
event-listener = "5.3.0"
static_assertions = "1.1.0"
async-trait = "0.1.80"
Expand Down
80 changes: 0 additions & 80 deletions zbus/src/abstractions/file.rs

This file was deleted.

1 change: 0 additions & 1 deletion zbus/src/abstractions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub use executor::*;
mod async_drop;
pub(crate) mod async_lock;
pub use async_drop::*;
pub(crate) mod file;

// Not macOS-specific itself but only used on macOS.
#[cfg(target_os = "macos")]
Expand Down
29 changes: 1 addition & 28 deletions zbus/src/blocking/connection/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use tokio::net::UnixStream;
#[cfg(all(windows, not(feature = "tokio")))]
use uds_windows::UnixStream;

use zvariant::{ObjectPath, Str};
use zvariant::ObjectPath;

#[cfg(feature = "p2p")]
use crate::Guid;
Expand Down Expand Up @@ -94,33 +94,6 @@ impl<'a> Builder<'a> {
Self(self.0.auth_mechanism(auth_mechanism))
}

/// The cookie context to use during authentication.
///
/// This is only used when the `cookie` authentication mechanism is enabled and only valid for
/// server connections.
///
/// If not specified, the default cookie context of `org_freedesktop_general` will be used.
///
/// # Errors
///
/// If the given string is not a valid cookie context.
pub fn cookie_context<C>(self, context: C) -> Result<Self>
where
C: Into<Str<'a>>,
{
self.0.cookie_context(context).map(Self)
}

/// The ID of the cookie to use during authentication.
///
/// This is only used when the `cookie` authentication mechanism is enabled and only valid for
/// server connections.
///
/// If not specified, the first cookie found in the cookie context file will be used.
pub fn cookie_id(self, id: usize) -> Self {
Self(self.0.cookie_id(id))
}

/// The to-be-created connection will be a peer-to-peer connection.
///
/// This method is only available when the `p2p` feature is enabled.
Expand Down
39 changes: 1 addition & 38 deletions zbus/src/connection/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use uds_windows::UnixStream;
#[cfg(all(feature = "vsock", not(feature = "tokio")))]
use vsock::VsockStream;

use zvariant::{ObjectPath, Str};
use zvariant::ObjectPath;

use crate::{
address::{Address, ToAddresses},
Expand Down Expand Up @@ -71,8 +71,6 @@ pub struct Builder<'a> {
auth_mechanisms: Option<VecDeque<AuthMechanism>>,
#[cfg(feature = "bus-impl")]
unique_name: Option<crate::names::UniqueName<'a>>,
cookie_context: Option<super::handshake::CookieContext<'a>>,
cookie_id: Option<usize>,
}

assert_impl_all!(Builder<'_>: Send, Sync, Unpin);
Expand Down Expand Up @@ -197,37 +195,6 @@ impl<'a> Builder<'a> {
self
}

/// The cookie context to use during authentication.
///
/// This is only used when the `cookie` authentication mechanism is enabled and only valid for
/// server connections.
///
/// If not specified, the default cookie context of `org_freedesktop_general` will be used.
///
/// # Errors
///
/// If the given string is not a valid cookie context.
pub fn cookie_context<C>(mut self, context: C) -> Result<Self>
where
C: Into<Str<'a>>,
{
self.cookie_context = Some(context.into().try_into()?);

Ok(self)
}

/// The ID of the cookie to use during authentication.
///
/// This is only used when the `cookie` authentication mechanism is enabled and only valid for
/// server connections.
///
/// If not specified, the first cookie found in the cookie context file will be used.
pub fn cookie_id(mut self, id: usize) -> Self {
self.cookie_id = Some(id);

self
}

/// The to-be-created connection will be a peer-to-peer connection.
///
/// This method is only available when the `p2p` feature is enabled.
Expand Down Expand Up @@ -436,8 +403,6 @@ impl<'a> Builder<'a> {
#[cfg(windows)]
client_sid,
self.auth_mechanisms,
self.cookie_id,
self.cookie_context.unwrap_or_default(),
unique_name,
)
.await?
Expand Down Expand Up @@ -506,8 +471,6 @@ impl<'a> Builder<'a> {
auth_mechanisms: None,
#[cfg(feature = "bus-impl")]
unique_name: None,
cookie_id: None,
cookie_context: None,
}
}

Expand Down
Loading

0 comments on commit b8da34d

Please sign in to comment.