Thanks to visit codestin.com
Credit goes to github.com

Skip to content

logicin/deadpool-ldap3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deadpool for Ldap Latest Version Unsafe forbidden Rust 1.75+

Deadpool is a dead simple async pool for connections and objects of any type.

This crate implements a deadpool manager for ldap3 and provides a wrapper that ensures correct use of the connection inside a separate thread.

Features

Feature Description Extra dependencies Default
rt_tokio_1 Enable support for tokio crate deadpool/rt_tokio_1 yes
rt_async-std_1 Enable support for async-std crate deadpool/rt_async-std_1 no
serde Enable support for serde crate deadpool/serde, serde/derive no
tracing Enable support for tracing by propagating Spans in the interact() calls. Enable this if you use the tracing crate and you want to get useful traces from within interact() calls. deadpool-sync/tracing, tracing no

Example

use deadpool_ldap::{Config, Runtime};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cfg = Config {
        url: "ldap://127.0.0.1:389".to_string(),
        bind_dn: Some("cn=admin,dc=demo,dc=com".to_string()),
        bind_password: Some("123456".to_string()),
        pool: None,
    };
    let pool = cfg.create_pool(Runtime::Tokio1).unwrap();
    let mut conn = pool.get().await.unwrap();
    conn.simple_bind("admin", "123456").await.unwrap();
    Ok(())
}

License

Licensed under either of

at your option.

About

deadpool impl for ldap3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages