_origen.utility.ldap¶
Functions¶
ldaps(): Undocumented.
-
_origen.utility.ldap.ldaps()¶
Classes¶
-
class
_origen.utility.ldap.LDAPs¶ Dict-like container to retrieve defined LDAP instances.
-
get()¶
-
items()¶
-
keys()¶
-
values()¶
-
-
class
_origen.utility.ldap.LDAP¶ A single LDAP instance
-
auth¶ Retrieves this LDAP’s authentication configuration
-
base¶ Retrieves the base DNs
-
bind(self) → bool¶ Attempts to bind using its current Auth settings.
- Returns
Trueif the bind was successful. Raises an error otherwise. Note this method will never returnFalse.- Return type
bool
-
bind_as()¶
-
bound¶ Indicates whether this LDAP is currently bound. Returns true only if previously bound and the bind attempt was successful
-
name¶ Retrieves this LDAP’s name. Does not actually influence anything in the connection itself
-
search(filter: str, attrs: list) → dict¶ Runs a search with the given filters and
attribute list. Returns a nested dict where the first level are the returnedDNs. EachDNis a tuple with exactly two items in this order:(returned data, binary returned data). Whether or not your query returns data, binary data, or both is dependent on the server configuration and query itself.- Parameters
filter (str) – Search criteria formatted as an filters
attrs (list) – List of attributes to retrieve from matching search criteria. An empty list returns all available attributes, equivalent to [“*”]
- Returns
Nested dict where the first level is the returned
DNs. EachDNis a tuple with exactly two items in this order:(returned data, binary returned data). Whether or not your query returns data, binary data, or both is dependent on the server configuration and query itself.- Return type
dict
See also
For examples, see the specs tests written against a free LDAP server
-
server¶ Retrieves the server this LDAP was instantiated with
-
single_filter_search(filter: str, attrs: list) → tuple¶ Similar to :meth:search except that this removes the first
dictlayer when a singleDNis expected.- Parameters
filter (str) – Search criteria formatted as an filters, expecting to yield at most one
DN.attrs (list) – List of attributes to retrieve from matching search criteria. An empty list returns all available attributes, equivalent to [“*”]
- Returns
Two-item tuple, each item being a dict corresponding to
(returned data, binary returned data)respectively.- Return type
tuple
-
unbind()¶
-
validate_credentials()¶
-