ldap-acis
Parse, evaluate, generate, and transform LDAP Access Control Instructions (ACIs) in Rust. Supports both 389 Directory Server and OpenLDAP ACI syntaxes, and can convert between the two.
What it does
- Parse ACIs from 389 DS or OpenLDAP text format into a common model
- Evaluate access requests against a set of ACIs, with LRU caching
- Generate ACI text from programmatic definitions
- Transform between 389 DS and OpenLDAP formats
- Full ACI model: target DN patterns, attribute sets, target filters, operation types (read, write, search, compare, add, delete, selfwrite), and bind rules (userdn, groupdn, IP, DNS, time of day, day of week, SSF)
- Uses
acls-rsfor permission composition
Quick start
Parsing
use *;
let aci_text = r#"(targetattr="cn || sn || givenName")
(version 3.0; acl "Allow read"; allow (read, search, compare)
userdn = "ldap:///anyone";)"#;
let acis = .unwrap;
assert_eq!;
Building ACIs programmatically
use *;
let aci = new
.target_attributes
.permission
.bind_rule
.grant
.build;
Converting between formats
use *;
let ds389_text = r#"(version 3.0; acl "test"; allow (read)
userdn = "ldap:///anyone";)"#;
let acis = .unwrap;
let openldap_text = .unwrap;
Features
bloom(default) — Bloom-filter pre-screening during evaluationserde— serialization support
Documentation
Full API reference and usage guide: https://forge.fedoraproject.org/freeipa/bac-rules
License
Licensed under either of Apache License 2.0 or MIT license, at your option.