7.7
ldap-ffi: a Racket LDAP client built on top of libldap C API
(require ldap-ffi) | package: ldap-ffi |
This package provides an FFI binding to the libldap: the Lightweight Directory Access Protocol (LDAP) client library which is used for access to X.500 directory services.
constructor
(new ldap% [host host] [ [version version] [root-dn root-dn] [password password]]) → (is-a?/c ldap%) host : string? version : (or/c 2 3) = 3 root-dn : (or/c string? #f) = #f password : (or/c string? #f) = #f Constructs a new ldap object, initializes libldap and set the version (LDAPv3 is default version).
method
(send a-ldap set-option key value) → #t
key : positive? value : positive? Set LDAP related options.If the set-option fails, then an instance of exn:fail:libldap is raised.Authenticate to the directory server.If the bind fails, then an instance of exn:fail:libldap is raised.Modify an entry.If the modify fails, then an instance of exn:fail:libldap is raised.Add a new entry.If the add fails, then an instance of exn:fail:libldap is raised.Delete an entry.If the delete fails, then an instance of exn:fail:libldap is raised.Search for the LDAP directory entries and write retrieved data to the internal box storage.If the search fails, then an instance of exn:fail:libldap is raised.Equivalent to search but returs (listof list?) (instead of #t) then clears the object’s internal ldap-message storage.If the search* fails, then an instance of exn:fail:libldap is raised.Check whether or not an entry contains the same attribute value as given.If the compare fails, then an instance of exn:fail:libldap is raised.Return retrieved data from the internal box storage. It doesn’t make a request to the LDAP server.
method
(send a-ldap count-entries) → (or/c zero? positive?)
Return the number of retrieved entries or 0 otherwise.
method
(send a-ldap set-password user oldpw newpw) → boolean?
user : string? oldpw : string? newpw : string? Set a new password.If the set-password fails, then an instance of exn:fail:libldap is raised.
method
(send a-ldap rename-dn dn newrdn new-superior delete-old-rdn) → #t dn : string? newrdn : string? new-superior : string? delete-old-rdn : (or/c 0 1) Rename the DN of an LDAP entry or move it from one superior to another.If the rename-dn fails, then an instance of exn:fail:libldap is raised.Close the connection to the directory server.If the unbind fails, then an instance of exn:fail:libldap is raised.Clear the object’s internal box storage where the latest returned ldap-message storages itself.
struct
(struct exn:fail:ldap exn:fail:user () #:extra-constructor-name make-exn:fail:ldap)
An exception structure type for reporting errors from the underlying
libldap library.