Skip to main content

Crate coqui_access_ldap

Crate coqui_access_ldap 

Source
Expand description

LDAP and Active Directory authentication and directory lookup.

§coqui-access-ldap

Version Rust version License: MPL-2.0 Docs CI

Authenticates against LDAP or Active Directory and uses the same directory for names and groups. Passwords are sent only over TLS, StartTLS or loopback; search filters escape user-supplied values. No connection is made until a request is checked.

§Features

  • Search, then bind — finds the account with a service account, refuses disabled ones, then binds as the account with the supplied password.
  • Groups — from memberOf, from a group search, or nested with Active Directory’s matching rule; an Active Directory account’s primary group (primaryGroupID, normally Domain Users), which memberOf leaves out, is added.
  • Private CA — an optional PEM file as the only trusted roots.

§Installation

cargo add coqui-access-ldap --git https://github.com/Boriken-Dev/coqui-access

Build coqui-access-ldap-plugin for the loadable library.

§Quick start

Provider id coqui_access_ldap, configuration:

url = "ldaps://directory.example.org"
base = "DC=example,DC=org"
bind = "CN=search,DC=example,DC=org"
bind_password = "..."
# user_filter = "(sAMAccountName={name})"
# nested_groups = true

§API overview

ItemPurpose
LdapAccountsThe provider: new(config), Authenticator and Directory.
LdapAccountsConfigThe Guatiao configuration.
searchFilter and result helpers that need no directory.

The live test in tests/live_directory.rs is ignored unless run against a disposable directory; see AGENTS.md.

§Development

cargo test -p coqui-access-ldap --all-features
cargo clippy -p coqui-access-ldap --all-targets --all-features -- -D warnings

§Releasing

This project follows Semantic Versioning and keeps a CHANGELOG.md. Pushing a tag matching v* triggers the release workflow of the repository.

§License

MPL-2.0 — see LICENSE.

Modules§

search
LDAP filter and result helpers, independent of a live directory.

Structs§

LdapAccounts
LDAP accounts as authentication and directory providers, with lookups kept as the configuration’s cache says.
LdapAccountsConfig
LDAP authentication and query settings.

Constants§

DEFAULT_OBJECT_FILTER
The account filter a filter lookup is ANDed with unless the configuration says another: people who are users, which leaves out Active Directory’s computer accounts.

Traits§

LdapAccountsConfigSetters
The typed setters of LdapAccountsConfig, for any builder that holds its settings.