Module Ldap_ooclient
an object oriented ldap client interface
Basic Data Types
type op_lst= op listtype referral_policy=[|`FOLLOW|`RETURN]The policy the client should take when it encounteres a referral. This is currently not used
Local Representation of LDAP Objects
class type ldapentry_t = object ... endThe base type of an ldap entry represented in memory.
class ldapentry : object ... endthis object represents a remote object within local memory. It records all local changes made to it (if it's changetype is set to `MODIFY), and can commit them to the server at a later time via
Ldap_ooclient.ldapcon.update_entry.
Miscallaneous
val format_entry : < attributes : string list; dn : string; get_value : string -> string list; .. > -> unittoplevel formatter for ldapentry, prints the whole entry with a nice structure. Each attribute is in the correct syntax to be copied and pasted into a modify operation.
val format_entries : < attributes : string list; dn : string; get_value : string -> string list; .. > list -> unitformat lists of entries, in this case only print the dn
type changerec=[|`Modification of string * (Ldap_types.modify_optype * string * string list) list|`Addition of ldapentry|`Delete of string|`Modrdn of string * int * string]The type of an ldap change record, used by extended LDIF
Communication with Ldap_funclient
val to_entry : [< `Entry of Ldap_types.search_result_entry | `Referral of string list ] -> ldapentrygiven a search_result_entry as returned by ldap_funclient, produce an ldapentry containing either the entry, or the referral object
val of_entry : ldapentry -> Ldap_types.search_result_entrygiven an ldapentry as returned by ldapcon, or constructed manually, produce a search_result_entry suitable for ldap_funclient, or ldap_funserver.
Interacting with LDAP Servers
class ldapcon : ?connect_timeout:int -> ?referral_policy:[> `RETURN ] -> ?version:int -> string list -> object ... endThis class abstracts a connection to an LDAP server (or servers), an instance will be connected to the server you specify and can be used to perform operations on that server.
Iterators Over Streams of ldapentry Objects
val iter : (ldapentry -> unit) -> (?abandon:bool -> unit -> ldapentry) -> unitgiven a source of ldapentry objects (unit -> ldapentry), such as the return value of ldapcon#search_a, apply f (first arg) to each entry See List.iter
val rev_map : (ldapentry -> 'a) -> (?abandon:bool -> unit -> ldapentry) -> 'a listgiven a source of ldapentry objects (unit -> ldapentry), such as the return value of ldapcon#search_a apply f (first arg) to each entry in reverse, and return a list containing the result of each application. See List.map
Schema Aware ldapentry Derivatives
General Schema Aware Entry
module OrdOid : sig ... endan ordered oid type, for placing oids in sets
module Setstr : sig ... endA set of Oids
type scflavor=The type of schema checking to perform in
Ldap_ooclient.scldapentry. Normally this is picked automatically, however it can be overridden in some cases.
val attrToOid : Ldap_schemaparser.schema -> Ldap_schemaparser.Lcstring.t -> Ldap_schemaparser.Oid.tgiven a name of an attribute name (canonical or otherwise), return its oid
- raises Invalid_attribute
If the attribute is not found in the schema.
val oidToAttr : Ldap_schemaparser.schema -> Ldap_schemaparser.Oid.t -> stringgiven the oid of an attribute, return its canonical name
- raises Invalid_attribute
If the attribute is not found in the schema.
val ocToOid : Ldap_schemaparser.schema -> Ldap_schemaparser.Lcstring.t -> Ldap_schemaparser.Oid.tgiven a name of an objectclass (canonical or otherwise), return its oid.
- raises Invalid_objectclass
If the objectclass is not found in the schema.
val oidToOc : Ldap_schemaparser.schema -> Ldap_schemaparser.Oid.t -> stringgiven the oid of an objectclass, return its canonical name
- raises Invalid_objectclass
If the objectclass is not found in the schema.
val getOc : Ldap_schemaparser.schema -> Ldap_schemaparser.Lcstring.t -> Ldap_schemaparser.objectclassget an objectclass structure by one of its names (canonical or otherwise, however getting it by canonical name is currently much faster)
- raises Invalid_objectclass
If the objectclass is not found in the schema.
val getAttr : Ldap_schemaparser.schema -> Ldap_schemaparser.Lcstring.t -> Ldap_schemaparser.attributeget an attr structure by one of its names (canonical or otherwise, however getting it by canonical name is currently much faster)
- raises Invalid_attribute
If the attribute is not found in the schema.
val equateAttrs : Ldap_schemaparser.schema -> Ldap_schemaparser.Lcstring.t -> Ldap_schemaparser.Lcstring.t -> boolequate attributes by oid. This allows non canonical names to be handled correctly, for example "uid" and "userID" are actually the same attribute.
- raises Invalid_attribute
If either attribute is not found in the schema.
exceptionInvalid_objectclass of stringexceptionInvalid_attribute of stringexceptionSingle_value of stringexceptionObjectclass_is_required
class scldapentry : Ldap_schemaparser.schema -> object ... endSchema Aware Entry for Account Managment
type generator={gen_name : string;The name of the generator, this should also be its key in the hashtbl
required : string list;A list of names of attributes which are required by this generator. The names need not be canonical.
genfun : ldapentry_t -> string list;A function which returns a list of values for the attribute, given the entire object.
}The structure of a generator
type service={}The structure of a service
type generation_error=|Missing_required of string list|Generator_error of stringThe type of error raised by attribute generators
exceptionNo_generator of stringYou've asked it to generate an attribute (in a service) which doesn't have a generator
exceptionGeneration_failed of generation_errorGenerator has failed because of some kind of error
exceptionService_dep_unsatisfiable of stringA service which the one you tried to add depends on doesn't exists
exceptionGenerator_dep_unsatisfiable of string * stringYour generator depends on an attribute which isn't in the schema
exceptionCannot_sort_dependancies of string listYou have detached cycles in your generator dependancy lists
class ldapaccount : Ldap_schemaparser.schema -> (string, generator) Stdlib.Hashtbl.t -> (string, service) Stdlib.Hashtbl.t -> object ... end