Skip to content
Merged
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
85 changes: 43 additions & 42 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion crates/defguard_core/src/db/models/biometric_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub struct BiometricAuth<I = NoId> {
}

impl BiometricAuth {
#[must_use]
pub fn new(device_id: Id, pub_key: String) -> Self {
Self {
id: NoId,
Expand Down Expand Up @@ -80,8 +81,8 @@ impl BiometricChallenge {
}
let challenge = gen_alphanumeric(44);
Ok(Self {
challenge,
auth_pub_key,
challenge,
})
}

Expand Down
1 change: 1 addition & 0 deletions crates/defguard_core/src/db/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ pub struct GroupDiff {
}

impl GroupDiff {
#[must_use]
pub fn changed(&self) -> bool {
!self.added.is_empty() || !self.removed.is_empty()
}
Expand Down
1 change: 1 addition & 0 deletions crates/defguard_core/src/db/models/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ impl Settings {
&& self.smtp_sender != Some(String::new())
}

#[must_use]
pub fn ldap_using_username_as_rdn(&self) -> bool {
self.ldap_user_rdn_attr
.as_deref()
Expand Down
3 changes: 3 additions & 0 deletions crates/defguard_core/src/db/models/wireguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,15 @@ impl WireguardNetwork<Id> {
}

/// Checks if all device addresses are contained in at least one of the network addresses
#[must_use]
pub fn contains_all(&self, addresses: &[IpAddr]) -> bool {
addresses
.iter()
.all(|addr| self.address.iter().any(|net| net.contains(*addr)))
}

/// Finds [`IpNetwork`] containing given [`IpAddr`]
#[must_use]
pub fn get_containing_network(&self, addr: IpAddr) -> Option<IpNetwork> {
self.address.iter().find(|net| net.contains(addr)).copied()
}
Expand Down Expand Up @@ -1273,6 +1275,7 @@ impl WireguardNetwork<Id> {
Ok(())
}

#[must_use]
pub fn mfa_enabled(&self) -> bool {
match self.location_mfa_mode {
LocationMfaMode::Internal | LocationMfaMode::External => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ pub async fn run_activity_log_stream_manager(
cancel_token.clone(),
));
}
};
}
} else {
error!(
"Failed to deserialize config for activity log stream {0}",
&activity_log_stream.name
);
continue;
}
}
} else {
Expand All @@ -87,7 +86,7 @@ pub async fn run_activity_log_stream_manager(
// - streaming task terminated early
loop {
tokio::select! {
_ = notification.notified() => {
() = notification.notified() => {
info!(
"Activity log stream manager configuration refresh notification received, reloading streaming tasks."
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub(super) async fn run_http_stream_task(
};
loop {
tokio::select! {
_ = cancel_token.cancelled() => {
() = cancel_token.cancelled() => {
debug!("Activity log stream ({stream_name}) task received cancellation signal.");
break;
},
Expand Down
1 change: 0 additions & 1 deletion crates/defguard_core/src/enterprise/ldap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ impl LDAPConnection {
);
self.sync_user_data(user, pool).await?;
debug!("User {user} data synchronized");
continue;
}
}

Expand Down
Loading