Skip to content

Commit c6ff196

Browse files
committed
Make the client object Clone. I forgot this last time
1 parent 3af584e commit c6ff196

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ edition = "2021"
1414

1515
[dependencies]
1616
deadpool = { version = "0.12.2", optional = true }
17+
derive_more = { version = "2.0.1", features = ["debug"] }
1718
futures = "0.3.31"
1819
ldap3 = { version = "0.11.5", default-features = false }
1920
serde = { version = "1.0.214", features = ["derive"] }

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,28 @@ pub extern crate ldap3;
100100
const LDAP_ENTRY_DN: &str = "entryDN";
101101
const NO_SUCH_RECORD: u32 = 32;
102102

103+
103104
/// Configuration and authentication for LDAP connection
104-
#[derive(Clone)]
105+
#[derive(derive_more::Debug, Clone)]
105106
pub struct LdapConfig {
106107
pub ldap_url: Url,
107108
/// DistinguishedName, aka the "username" to use for the connection.
108109
pub bind_dn: String,
110+
#[debug(skip)] // We don't want to print passwords.
109111
pub bind_password: String,
110112
pub dn_attribute: Option<String>,
111113
/// Low level configuration for the connection.
112114
/// You can probably skip it.
115+
#[debug(skip)] // Debug omitted, because it just doesn't implement it.
113116
pub connection_settings: Option<LdapConnSettings>,
114117
}
115118

119+
116120
///
117121
/// High-level LDAP client wrapper ontop of ldap3 crate. This wrapper provides a high-level interface to perform LDAP operations
118122
/// including authentication, search, update, delete
119123
///
124+
#[derive(Debug, Clone)]
120125
pub struct LdapClient {
121126
/// The internal connection handle.
122127
ldap: Ldap,

0 commit comments

Comments
 (0)