Skip to content

Commit 69494d2

Browse files
authored
Merge pull request #33 from Iizuki/distinguished-name
Add a simple DN parser
2 parents dbf4e4f + 8776fdf commit 69494d2

File tree

5 files changed

+653
-103
lines changed

5 files changed

+653
-103
lines changed

Cargo.toml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@ readme = "README.md"
66
repository = "https://github.com/keaz/simple-ldap"
77
keywords = ["ldap", "ldap3", "async", "high-level"]
88
name = "simple-ldap"
9-
version = "7.0.1"
9+
version = "7.1.0"
1010
edition = "2024"
1111

1212

1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

1515
[dependencies]
16+
chumsky = "0.10.1"
1617
deadpool = { version = "0.12.2", optional = true }
17-
derive_more = { version = "2.0.1", features = ["debug"] }
18+
derive_more = { version = "2.0.1", features = ["debug", "display"] }
1819
futures = "0.3.31"
20+
itertools = "0.14.0"
1921
ldap3 = { version = "0.11.5", default-features = false }
2022
serde = { version = "1.0.219", features = ["derive"] }
2123
serde-value = "0.7.0"
24+
serde_with = "3.12.0"
2225
thiserror = "2.0.12"
2326
tracing = "0.1.41"
2427
url = "2.5.4"
@@ -34,9 +37,18 @@ tokio = { version = "1.44.2", features = ["macros", "rt-multi-thread"] }
3437
uuid = { version = "1.16.0", features = ["v4", "serde"] }
3538
serde_with = "3.12.0"
3639
tracing-subscriber = "0.3.19"
40+
serde_json = "1.0.142"
3741

3842
[features]
3943
default = ["tls-native"]
4044
tls-native = ["ldap3/tls-native"]
4145
tls-rustls = ["ldap3/tls-rustls"]
4246
pool = ["dep:deadpool"]
47+
48+
49+
# Lint catlogue: https://rust-lang.github.io/rust-clippy/master/index.html
50+
[lints.clippy]
51+
all = {level = "warn", priority = -1}
52+
53+
# Pedantic lints
54+
uninlined_format_args = "warn"

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ There are plenty more examples in the [documentation](https://docs.rs/simple-lda
2828

2929
```rust,no_run
3030
use simple_ldap::{
31-
LdapClient, LdapConfig,
31+
LdapClient, LdapConfig, SimpleDN,
3232
filter::EqFilter,
3333
ldap3::Scope
3434
};
@@ -41,11 +41,12 @@ use serde_with::OneOrMany;
4141
#[serde_as] // serde_with for multiple values
4242
#[derive(Debug, Deserialize)]
4343
struct User {
44-
uid: String,
45-
cn: String,
46-
sn: String,
44+
pub dn: SimpleDN,
45+
pub uid: String,
46+
pub cn: String,
47+
pub sn: String,
4748
#[serde_as(as = "OneOrMany<_>")]
48-
addresses: Vec<String>,
49+
pub addresses: Vec<String>,
4950
}
5051
5152
@@ -65,7 +66,7 @@ async fn main(){
6566
"ou=people,dc=example,dc=com",
6667
Scope::OneLevel,
6768
&name_filter,
68-
&vec!["cn", "sn", "uid","addresses"],
69+
&vec!["dn", "cn", "sn", "uid","addresses"],
6970
).await.unwrap();
7071
}
7172
```

0 commit comments

Comments
 (0)