@kengela/adapter-directory-ldap
v0.1.5
Published
Kengela AD/LDAP directory adapter: LDAP(S) bind, paginated search, normalization to LdapEntryParts and DirectoryProfile.
Maintainers
Readme
@kengela/adapter-directory-ldap
An AD/LDAP directory adapter: LDAP(S) bind, paginated search, and normalization into directory profiles.
This package connects to Active Directory or LDAP over LDAP(S), runs paginated searches, and normalizes entries into LdapEntryParts and DirectoryProfile (reusing the pure mappers from @kengela/iam-mapping). It is the adapter ring: it only speaks LDAP, while role mapping stays pure in @kengela/iam-mapping.
Part of Kengela, a Zero Trust identity and access foundation for multi-tenant TypeScript apps (authentication + authorization + identity federation + compliance).
Install
npm install @kengela/adapter-directory-ldapUsage
import { LdapDirectorySource } from '@kengela/adapter-directory-ldap';
const source = new LdapDirectorySource({
connection: {
url: 'ldaps://ad.example.com',
bindDN: 'CN=svc,OU=Service,DC=example,DC=com',
bindPassword: process.env.LDAP_PASSWORD,
baseDN: 'DC=example,DC=com',
},
});
const profiles = await source.toProfiles(tenantId, { filter: '(objectClass=user)' });Key exports
LdapDirectorySource- LDAP(S) bind, paginated search, health-check, andtoProfiles/toRecords.LDAP_SOURCE_DEFAULTS- default source options.LdapConnectionConfig,LdapDirectorySourceOptions,FetchEntriesOptions,DirectoryRecord- configuration and result types.LdapClientLikeand related types - the narrow client surface the realldaptsclient satisfies.profileFromLdap,accountActiveFromLdap,DirectoryProfile- re-exports from@kengela/iam-mappingfor composing without a second dependency.
Documentation
Guides and recipes: https://github.com/yannds/kengela/wiki
License
Apache-2.0
