package ocamldap
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=be85eccfa45de6066238da85c6ad2a409d69df245b6cd2b740ec2bf3400b587c
md5=6137a123978ac5b0dd301af26122e437
doc/ldap/Ldap_funclient/index.html
Module Ldap_funclient
a functional ldap client interface
type modattr = Ldap_types.modify_optype * string * string list
type result = Ldap_types.search_result_entry list
type entry = Ldap_types.search_result_entry
type search_result = [
| `Entry of entry
| `Referral of string list
| `Success of Ldap_types.ldap_controls option
]
Initializes the conn data structure, and opens a connection to the server. init ["ldap://rrhost.example.com/";"ldap://backup.example.com:1389"]
. init is round robin dns aware, if dns returns multiple mappings it will try each one before finially failing. It also takes a list of hostnames, so you can specify backup servers to try. SSL and TLS are supported if selected at compile time.
val init : ?connect_timeout:int -> ?version:int -> string list -> conn
Initializes the conn data structure, and opens a connection to the server. init ["ldap://rrhost.example.com/";"ldap://backup.example.com:1389"]
. init is round robin dns aware, if dns returns multiple mappings it will try each one before finially failing. It also takes a list of hostnames, so you can specify backup servers to try. SSL and TLS are supported if selected at compile time.
val unbind : conn -> unit
close the connection to the server. You may not use the conn after you have unbound, if you do you will get an exception.
val bind_s :
?who:string ->
?cred:string ->
?auth_method:[> `SIMPLE ] ->
conn ->
unit
authenticatite to the server. In this version only simple binds are supported, however the ldap_protocol.ml module DOES implement sasl binds. It would be fairly easy to support them here. We eventually will.
val search :
?base:string ->
?scope:Ldap_types.search_scope ->
?aliasderef:Ldap_types.alias_deref ->
?sizelimit:int32 ->
?timelimit:int32 ->
?attrs:string list ->
?attrsonly:bool ->
?page_control:page_control ->
conn ->
string ->
msgid
Search for the given entry with the specified base node and search scope, optionally limiting the returned attributes to those listed in 'attrs'. aliasderef sets the server's alias dereferencing policy, sizelimit is the number of entries to return, timelimit is the number of seconds to allow the search to run for, attrsonly tells the server not to return the values. This is the asyncronus version of search (it does not block) you will need to call the get_search_entry function below to actually get any data back. This function will return a msgid which you must use when you call get_search_entry.
val get_search_entry :
conn ->
msgid ->
[> `Entry of Ldap_types.search_result_entry | `Referral of string list ]
fetch a search entry from the wire using the given msgid. The entry could be a search entry, OR it could be a referral structure.
val get_search_entry_with_controls :
conn ->
msgid ->
[> `Entry of Ldap_types.search_result_entry
| `Referral of string list
| `Success of Ldap_types.ldap_controls option ]
fetch a search entry from the wire using the given msgid. The entry could be a search entry, OR it could be a referral structure.
The version supports passing ldap_controls (like page control) through on success. Returning an entry of type `SUCCESS was thus needed.
val search_s :
?base:string ->
?scope:Ldap_types.search_scope ->
?aliasderef:Ldap_types.alias_deref ->
?sizelimit:int32 ->
?timelimit:int32 ->
?attrs:string list ->
?attrsonly:bool ->
conn ->
string ->
[> `Entry of Ldap_types.search_result_entry | `Referral of string list ] list
This is the syncronus version of search. It blocks until the search is complete, and returns a list of objects. It is exactly the same in all other ways.
val delete_s : conn -> dn:string -> unit
delete the entry named by dn from the directory
val modify_s :
conn ->
dn:string ->
mods:(Ldap_types.modify_optype * string * string list) list ->
unit
apply the list of modifications to the named entry
val modrdn_s :
?deleteoldrdn:bool ->
?newsup:'a option ->
conn ->
dn:string ->
newdn:string ->
unit
change the rdn, and optionally the superior entry of dn