+ |
+
-
stanford.green.ldap
@@ -225,8 +240,6 @@
S
- module
- |
-
diff --git a/docs/modules/ldap.html b/docs/modules/ldap.html
index 51064cd..32f0311 100644
--- a/docs/modules/ldap.html
+++ b/docs/modules/ldap.html
@@ -38,8 +38,8 @@
Useful LDAP functions.
Overview
-LDAP functions useful for Stanford-based applications. Currenently the
-only authentication supported when connecting to an LDAP server is GSSAPI
+ LDAP functions useful for Stanford-based applications. Currently the
+only authentication method supported when connecting to an LDAP server is GSSAPI
(Kerberos).
@@ -66,6 +66,63 @@ Examples
+
+-
+class stanford.green.ldap.LDAP(host: str = 'ldap.stanford.edu', connect_on_init: bool = True)
+The LDAP class.
+
+-
+connect() → Any
+Create a connected ldap object.
+Currently, the only connection method is using GSSAPI. That is, there
+must be a valid Kerberos context.
+
+
+
+-
+search(basedn: str, filterstr: str = '(objectClass=*)', attrlist: list[str] | None = None, scope: str = 'sub') → dict[str, dict[str, dict[str, str | list[str]]]]
+Perform an LDAP search.
+
+- Parameters:
+
+basedn (str) – base DN on which to search
+filterstr (list[str]) – a valid LDAP filter clause (e.g., (uid=jstanford) )
+filterstr – a list of attributes to return
+scope (str) – the search scope; must be one “sub”, “base”, or “one”.
+
+
+
+This method is a thin wrapper around the ldap package’s search method. The
+difference is in how it behaves when there are no results and the format
+of the returned value.
+The returned result is a dict where each key is the dn of some
+tree result. Each key maps to another dict containing the attributes. This
+is most easily explained with an example:
+basedn = "dc=stanford,dc=edu"
+filterstr = "uid=jstanford"
+results = search(basdn, filterstr=filterstr)
+#
+# results will look something like
+# {
+# 'suRegID=f0d08565850320613717ebf068585447,cn=people,dc=stanford,dc=edu':
+# {'suMailCode': '4321', 'suGwAffilCode1': 'stanford:staff', ... }
+# 'uid=jstanford,cn=accounts,dc=stanford,dc=edu':
+# { 'uid': 'jstanford', 'suSeasSunetID': ['jstanford', 'jane.stanford'], ... }
+# }
+#
+# There are two keys in the above: the "suRegID=f0..." one and the "uid=jstanford,..." one.
+
+
+Note that the attributes are returned as either a string (for
+single-valued attributes) or a list (for multi-valued attributes).
+Furthermore, LDAP returns vaules as byte-strings so this method
+converts these byte-strings into regular utf8 strings.
+If no results are returned this method raises the
+LDAPNoResultsException exception.
+
+
+
+
-
stanford.green.ldap.attribute_is_single_valued(attribute_name: str) → bool
@@ -118,6 +175,11 @@
Examples
GreenLDAPNoResultsException
GreenUnknownLDAPAttribute
+LDAP
+
attribute_is_single_valued()
diff --git a/docs/objects.inv b/docs/objects.inv
index 81256ff..5978625 100644
Binary files a/docs/objects.inv and b/docs/objects.inv differ
diff --git a/docs/searchindex.js b/docs/searchindex.js
index 714df18..487cf77 100644
--- a/docs/searchindex.js
+++ b/docs/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"alltitles": {"Contents:": [[0, null], [1, null]], "Examples": [[3, "examples"], [4, "examples"], [5, "examples"]], "Overview": [[3, "overview"], [4, "overview"], [5, "overview"]], "stanford-green documentation": [[0, null]], "stanford.green": [[2, null]], "stanford.green Modules": [[1, null]], "stanford.green.kerberos": [[3, null]], "stanford.green.ldap": [[4, null]], "stanford.green.oauth2": [[5, null]], "stanford.green.zulutime": [[6, null]]}, "docnames": ["index", "modules", "modules/base", "modules/kerberos", "modules/ldap", "modules/oauth2", "modules/zulutime"], "envversion": {"sphinx": 63, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["index.rst", "modules.rst", "modules/base.rst", "modules/kerberos.rst", "modules/ldap.rst", "modules/oauth2.rst", "modules/zulutime.rst"], "indexentries": {"attribute_is_single_valued() (in module stanford.green.ldap)": [[4, "stanford.green.ldap.attribute_is_single_valued", false]], "greenldapnoresultsexception": [[4, "stanford.green.ldap.GreenLDAPNoResultsException", false]], "greenunknownldapattribute": [[4, "stanford.green.ldap.GreenUnknownLDAPAttribute", false]], "module": [[4, "module-stanford.green.ldap", false]], "stanford.green.ldap": [[4, "module-stanford.green.ldap", false]]}, "objects": {"stanford": [[2, 0, 0, "-", "green"]], "stanford.green": [[3, 0, 0, "-", "kerberos"], [4, 0, 0, "-", "ldap"], [5, 0, 0, "-", "oauth2"], [2, 4, 1, "", "random_uid"], [2, 4, 1, "", "utc_datetime_secs_from_now"], [6, 0, 0, "-", "zulutime"]], "stanford.green.kerberos": [[3, 1, 1, "", "KerberosTicket"]], "stanford.green.kerberos.KerberosTicket": [[3, 2, 1, "", "cleanup"], [3, 2, 1, "", "create_ticket_file"], [3, 2, 1, "", "ticket_file_needs_updating"]], "stanford.green.ldap": [[4, 3, 1, "", "GreenLDAPNoResultsException"], [4, 3, 1, "", "GreenUnknownLDAPAttribute"], [4, 4, 1, "", "attribute_is_single_valued"]], "stanford.green.oauth2": [[5, 1, 1, "", "AccessToken"], [5, 1, 1, "", "ApiAccessTokenEndpoint"]], "stanford.green.oauth2.AccessToken": [[5, 5, 1, "", "expires_at"], [5, 2, 1, "", "expires_in"], [5, 2, 1, "", "is_expired"], [5, 2, 1, "", "zulu_time_string"]], "stanford.green.oauth2.ApiAccessTokenEndpoint": [[5, 2, 1, "", "_get_token"], [5, 2, 1, "", "_get_token_acs_api"], [5, 2, 1, "", "_get_token_oauth2"], [5, 2, 1, "", "cache_get"], [5, 2, 1, "", "cache_set"], [5, 2, 1, "", "get_token"], [5, 2, 1, "", "is_acs_api"], [5, 2, 1, "", "is_oauth2"], [5, 2, 1, "", "progress"]], "stanford.green.zulutime": [[6, 4, 1, "", "dt_to_zulu_string"], [6, 4, 1, "", "is_zulu_string"], [6, 4, 1, "", "zulu_string_to_utc"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "exception", "Python exception"], "4": ["py", "function", "Python function"], "5": ["py", "property", "Python property"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:exception", "4": "py:function", "5": "py:property"}, "terms": {"": [4, 5], "0": 5, "00": 6, "00z": [], "07": 6, "1": 2, "10": [3, 5], "10t12": [], "10z": 6, "12": [], "123456z": 6, "15": 5, "2": 2, "2014": [], "2024": 6, "21": 6, "28": 6, "28t21": 6, "3": [2, 5], "30": 3, "300": 3, "30t11": 6, "34": 6, "34z": 6, "4": [2, 5], "42": 6, "5": 2, "57": 6, "8": 2, "A": 3, "AND": 2, "For": 5, "If": [2, 5], "NOT": [], "The": [3, 5], "There": 5, "These": 5, "To": 5, "_": [], "__": [], "__getstat": 5, "__setstate__": 5, "_expires_at": 5, "_get_token": [0, 5], "_get_token_acs_api": [0, 5], "_get_token_oauth2": [0, 5], "abc": 2, "abcdefgh": 2, "abclsah": 2, "abov": 5, "ac": 5, "access": 5, "access_token": 5, "accesstoken": [0, 5], "account": 4, "acquir": 3, "acs_api": 5, "actual": 5, "adasaad": [], "add": [], "age_limit_second": 3, "algorithm": 2, "allow": [], "alreadi": 3, "also": [3, 6], "america": 6, "an": [2, 4, 5], "ani": 5, "api": 5, "api_access": 5, "apiaccesstokenendpoint": [0, 5], "applic": 4, "appropri": 5, "ar": [2, 4, 5], "assum": 4, "attempt": [3, 5], "attr": [], "attribut": [4, 5], "attribute_is_multi_valu": 4, "attribute_is_single_valu": [0, 4], "attribute_nam": 4, "authent": 4, "author": 5, "authorizaton": [], "avoid": 3, "awar": [5, 6], "azxlg": 2, "backoff": 5, "base": [4, 5], "befor": 5, "between": 2, "bool": [3, 4, 5, 6], "both": 2, "built": 5, "ca": [], "ca_": [], "cach": [3, 5], "cache_get": [0, 5], "cache_set": [0, 5], "calcul": 5, "call": 5, "can": [3, 5], "case": [2, 3], "caus": [], "charact": 2, "check": [], "circumst": [3, 5], "class": [3, 5], "cleanup": [0, 3], "client": 5, "client_credenti": 5, "client_id": 5, "client_secret": 5, "code": 5, "com": 5, "come": 3, "commun": 2, "compat": 5, "compliant": 2, "connect": [4, 5], "constructor": [], "contain": 5, "content": [], "context": [3, 4], "convert": [5, 6], "correspond": 2, "could": [], "creat": [2, 3, 5], "create_ticket_fil": [0, 3], "curren": 4, "current": [2, 3, 5], "custom": 5, "date": 5, "datetim": [2, 5, 6], "debug": 5, "default": [2, 3, 5], "defin": 5, "depend": 5, "desir": 2, "detail": [], "determin": 4, "dev": [], "dherkk": 2, "differ": [], "do": 5, "doe": [3, 5], "don": 5, "dt": [], "dt_to_zulu_str": [0, 6], "dtime": 6, "dure": 5, "e": 5, "each": 5, "eight": 2, "empti": [2, 3, 5], "enabl": 5, "endpoint": 5, "endpoint_typ": 5, "enough": 2, "environ": 3, "exampl": [0, 2, 6], "except": [2, 4], "excption": [], "exist": 3, "exp_backoff": 5, "expir": 5, "expires_at": [0, 5], "expires_at_overrid": 5, "expires_in": [0, 5], "expires_in_overrid": [], "exponenti": 5, "exponential_backoff_ca": 5, "exponential_backoff_ca_": [], "exponentialbackoff": 5, "fals": [3, 4, 5, 6], "far": [], "file": [3, 5], "filelock": 3, "filenam": 3, "flag": 5, "float": 5, "follow": 3, "format": 6, "from": [2, 3, 4, 5], "full": [], "function": [2, 4, 5, 6], "furthermor": 5, "g": 5, "gadmin2": [], "gener": [2, 5], "get": [2, 4, 5], "get_token": [0, 5], "get_token_acs_api": [], "get_token_oauth2": [], "github": [], "given": [2, 3], "go": 5, "goe": [], "grant": 5, "grant_typ": 5, "green": [], "greenldapnoresultsexcept": [0, 4], "greenunknownldapattribut": [0, 4], "gssapi": 4, "ha": 5, "have": [2, 3, 4, 5], "hello": 6, "http": [5, 6], "i": [2, 3, 4, 5, 6], "identifi": 5, "ignor": 5, "import": [3, 4, 5], "inclus": 2, "inform": [4, 5], "initi": 3, "instanc": [3, 5], "instead": 5, "int": [2, 3, 5], "interact": 5, "ioervion": 2, "is_acs_api": [0, 5], "is_expir": [0, 5], "is_oauth2": [0, 5], "is_zulu_str": [0, 6], "iter": 5, "itself": 5, "json": 5, "kerbero": [0, 1, 4], "kerberosticket": [0, 3], "keytab": 3, "keytab_path": 3, "kind": 5, "kprincip": 3, "krb5ccname": 3, "kt": 3, "larger": 2, "ldap": [0, 1], "length": 2, "less": 3, "librari": [3, 5], "limit_valu": 5, "linknam": [], "linkname_": [], "list": 5, "local_tim": 6, "local_tz": 6, "locat": 3, "lock": 3, "lockfil": 3, "long": 2, "longer": 5, "macrotex": [], "main": 4, "maintain": 3, "make": 5, "manag": 3, "maximum": 5, "messag": 5, "method": [3, 5], "minim": 5, "modul": 0, "more": [2, 3], "msg": 5, "much": 5, "multi": 4, "name": 3, "need": 3, "neg": 5, "neither": 2, "new": [], "new_york": 6, "none": [2, 3, 5, 6], "nor": 2, "normal": 3, "note": [5, 6], "now": [2, 3, 5, 6], "num_iter": 5, "number": 5, "oauth": 5, "oauth2": [0, 1], "object": [2, 3, 5, 6], "offset": 6, "old": 3, "onc": 5, "onli": [3, 4, 5], "oper": 5, "option": [2, 5], "org": 6, "other": 5, "otherwis": [3, 4, 5, 6], "out": 5, "output": 5, "overrid": 5, "overview": 0, "packag": [3, 5], "param": [], "paramet": [2, 4, 5, 6], "pass": 3, "password": 5, "path": 3, "pickl": 5, "plu": 2, "point": [3, 5], "prefix": 2, "princip": 3, "progress": [0, 5], "properti": 5, "provid": [2, 5], "provis": 3, "put": [2, 3], "py": [], "python": [3, 5], "pytz": 6, "rais": [2, 6], "random": 2, "random_uid": [0, 2], "randomli": 2, "read": 5, "recogn": 5, "relat": [5, 6], "relev": 5, "remov": 3, "renew": 3, "repres": 5, "request": 5, "requir": [3, 5], "respons": 5, "rest": 2, "restructuredtext": [], "result": [2, 4], "retri": 5, "retriev": 5, "return": [2, 3, 4, 5, 6], "same": [3, 5], "scope": 5, "sdfjsdflk": [], "sec": 2, "second": [2, 3, 5], "secret": 5, "see": [5, 6], "self": [3, 5], "sent": 5, "server": [4, 5], "servic": 5, "set": [3, 5], "show": 5, "simpl": [3, 5], "sinc": [], "singl": 4, "slot": 5, "smaller": 2, "so": 5, "some": [], "sourc": 5, "space": 2, "standard": 5, "start": 2, "storag": 5, "str": [2, 3, 4, 5, 6], "string": [2, 4, 5, 6], "style": 5, "suffici": 3, "suffix": 3, "suit": [], "sumaildrop": 4, "suppli": [2, 5], "support": [4, 5], "syntax": [], "t": 5, "t21": 6, "take": 3, "tell": 5, "test": [2, 5], "testcwq": 2, "than": [2, 3, 5], "thi": [2, 3, 4, 5], "those": 5, "three": 2, "ticket": 3, "ticket_fil": 3, "ticket_file_needs_upd": [0, 3], "ticket_lock_fil": 3, "time": [2, 3, 5, 6], "time_slot_sec": 5, "timeout": [3, 5], "timezon": [2, 5, 6], "token": 5, "too": [2, 3], "tr": 6, "tree": 4, "true": [3, 4, 5, 6], "two": [3, 5], "type": [2, 5], "uid": [2, 4], "under": 3, "unit": 5, "unless": 2, "until": 5, "up": 5, "updat": 3, "url": 5, "us": [2, 3, 4, 5], "use_cach": 5, "user": 4, "usernam": 5, "utc": [2, 5, 6], "utc_datetime_secs_from_now": [0, 2], "util": [], "v1": 5, "valid": [2, 3, 4, 5, 6], "valu": [4, 5], "valueerror": 6, "variabl": 3, "verbos": [3, 5], "via": 5, "w3": 6, "wa": 5, "wait": 5, "want": 5, "we": 5, "what": [], "when": [4, 5], "where": 5, "which": [2, 5], "wrapper": 5, "write": 3, "www": 6, "you": [3, 4, 5], "your": [], "z": 6, "zule": [], "zulu": [5, 6], "zulu_str": 6, "zulu_string_to_utc": [0, 6], "zulu_time_str": [0, 5], "zulutim": [0, 1], "zzz": []}, "titles": ["stanford-green documentation", "stanford.green Modules", "stanford.green", "stanford.green.kerberos", "stanford.green.ldap", "stanford.green.oauth2", "stanford.green.zulutime"], "titleterms": {"account": [], "adasaad": [], "content": [0, 1], "document": 0, "exampl": [3, 4, 5], "green": [0, 1, 2, 3, 4, 5, 6], "kerbero": 3, "ldap": 4, "modul": 1, "oauth2": 5, "overview": [3, 4, 5], "stanford": [0, 1, 2, 3, 4, 5, 6], "suit": [], "zulutim": 6}})
\ No newline at end of file
+Search.setIndex({"alltitles": {"Contents:": [[0, null], [1, null]], "Examples": [[3, "examples"], [4, "examples"], [5, "examples"]], "Overview": [[3, "overview"], [4, "overview"], [5, "overview"]], "stanford-green documentation": [[0, null]], "stanford.green": [[2, null]], "stanford.green Modules": [[1, null]], "stanford.green.kerberos": [[3, null]], "stanford.green.ldap": [[4, null]], "stanford.green.oauth2": [[5, null]], "stanford.green.zulutime": [[6, null]]}, "docnames": ["index", "modules", "modules/base", "modules/kerberos", "modules/ldap", "modules/oauth2", "modules/zulutime"], "envversion": {"sphinx": 63, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["index.rst", "modules.rst", "modules/base.rst", "modules/kerberos.rst", "modules/ldap.rst", "modules/oauth2.rst", "modules/zulutime.rst"], "indexentries": {"attribute_is_single_valued() (in module stanford.green.ldap)": [[4, "stanford.green.ldap.attribute_is_single_valued", false]], "connect() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.connect", false]], "greenldapnoresultsexception": [[4, "stanford.green.ldap.GreenLDAPNoResultsException", false]], "greenunknownldapattribute": [[4, "stanford.green.ldap.GreenUnknownLDAPAttribute", false]], "ldap (class in stanford.green.ldap)": [[4, "stanford.green.ldap.LDAP", false]], "module": [[4, "module-stanford.green.ldap", false]], "search() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.search", false]], "stanford.green.ldap": [[4, "module-stanford.green.ldap", false]]}, "objects": {"stanford": [[2, 0, 0, "-", "green"]], "stanford.green": [[3, 0, 0, "-", "kerberos"], [4, 0, 0, "-", "ldap"], [5, 0, 0, "-", "oauth2"], [2, 4, 1, "", "random_uid"], [2, 4, 1, "", "utc_datetime_secs_from_now"], [6, 0, 0, "-", "zulutime"]], "stanford.green.kerberos": [[3, 1, 1, "", "KerberosTicket"]], "stanford.green.kerberos.KerberosTicket": [[3, 2, 1, "", "cleanup"], [3, 2, 1, "", "create_ticket_file"], [3, 2, 1, "", "ticket_file_needs_updating"]], "stanford.green.ldap": [[4, 3, 1, "", "GreenLDAPNoResultsException"], [4, 3, 1, "", "GreenUnknownLDAPAttribute"], [4, 1, 1, "", "LDAP"], [4, 4, 1, "", "attribute_is_single_valued"]], "stanford.green.ldap.LDAP": [[4, 2, 1, "", "connect"], [4, 2, 1, "", "search"]], "stanford.green.oauth2": [[5, 1, 1, "", "AccessToken"], [5, 1, 1, "", "ApiAccessTokenEndpoint"]], "stanford.green.oauth2.AccessToken": [[5, 5, 1, "", "expires_at"], [5, 2, 1, "", "expires_in"], [5, 2, 1, "", "is_expired"], [5, 2, 1, "", "zulu_time_string"]], "stanford.green.oauth2.ApiAccessTokenEndpoint": [[5, 2, 1, "", "_get_token"], [5, 2, 1, "", "_get_token_acs_api"], [5, 2, 1, "", "_get_token_oauth2"], [5, 2, 1, "", "cache_get"], [5, 2, 1, "", "cache_set"], [5, 2, 1, "", "get_token"], [5, 2, 1, "", "is_acs_api"], [5, 2, 1, "", "is_oauth2"], [5, 2, 1, "", "progress"]], "stanford.green.zulutime": [[6, 4, 1, "", "dt_to_zulu_string"], [6, 4, 1, "", "is_zulu_string"], [6, 4, 1, "", "zulu_string_to_utc"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "exception", "Python exception"], "4": ["py", "function", "Python function"], "5": ["py", "property", "Python property"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:exception", "4": "py:function", "5": "py:property"}, "terms": {"": [4, 5], "0": 5, "00": 6, "00z": [], "07": 6, "1": 2, "10": [3, 5], "10t12": [], "10z": 6, "12": [], "123456z": 6, "15": 5, "2": 2, "2014": [], "2024": 6, "21": 6, "28": 6, "28t21": 6, "3": [2, 5], "30": 3, "300": 3, "30t11": 6, "34": 6, "34z": 6, "4": [2, 5], "42": 6, "4321": 4, "5": 2, "57": 6, "8": 2, "A": 3, "AND": 2, "For": 5, "If": [2, 4, 5], "NOT": [], "That": 4, "The": [3, 4, 5], "There": [4, 5], "These": 5, "To": 5, "_": [], "__": [], "__getstat": 5, "__setstate__": 5, "_expires_at": 5, "_get_token": [0, 5], "_get_token_acs_api": [0, 5], "_get_token_oauth2": [0, 5], "abc": 2, "abcdefgh": 2, "abclsah": 2, "abov": [4, 5], "ac": 5, "access": 5, "access_token": 5, "accesstoken": [0, 5], "account": 4, "acquir": 3, "acs_api": 5, "actual": 5, "adasaad": [], "add": [], "age_limit_second": 3, "algorithm": 2, "allow": [], "alreadi": 3, "also": [3, 6], "america": 6, "an": [2, 4, 5], "ani": [4, 5], "anoth": 4, "api": 5, "api_access": 5, "apiaccesstokenendpoint": [0, 5], "applic": 4, "appropri": 5, "ar": [2, 4, 5], "around": 4, "assum": 4, "attempt": [3, 5], "attr": [], "attribut": [4, 5], "attribute_is_multi_valu": 4, "attribute_is_single_valu": [0, 4], "attribute_nam": 4, "attrlist": 4, "authent": 4, "author": 5, "authorizaton": [], "avoid": 3, "awar": [5, 6], "azxlg": 2, "backoff": 5, "basdn": 4, "base": [4, 5], "basedn": 4, "befor": 5, "behav": 4, "between": 2, "bool": [3, 4, 5, 6], "both": 2, "built": 5, "byte": 4, "ca": [], "ca_": [], "cach": [3, 5], "cache_get": [0, 5], "cache_set": [0, 5], "calcul": 5, "call": 5, "can": [3, 5], "case": [2, 3], "caus": [], "charact": 2, "check": [], "circumst": [3, 5], "class": [3, 4, 5], "claus": 4, "cleanup": [0, 3], "client": 5, "client_credenti": 5, "client_id": 5, "client_secret": 5, "cn": 4, "code": 5, "com": 5, "come": 3, "commun": 2, "compat": 5, "compliant": 2, "connect": [0, 4, 5], "connect_on_init": 4, "constructor": [], "contain": [4, 5], "content": [], "context": [3, 4], "convert": [4, 5, 6], "correspond": 2, "could": [], "creat": [2, 3, 4, 5], "create_ticket_fil": [0, 3], "curren": [], "current": [2, 3, 4, 5], "custom": 5, "date": 5, "datetim": [2, 5, 6], "dc": 4, "debug": 5, "default": [2, 3, 5], "defin": 5, "depend": 5, "desir": 2, "detail": [], "determin": 4, "dev": [], "dherkk": 2, "dict": 4, "differ": 4, "dn": 4, "do": 5, "doe": [3, 5], "don": 5, "dt": [], "dt_to_zulu_str": [0, 6], "dtime": 6, "dure": 5, "e": [4, 5], "each": [4, 5], "easili": 4, "edu": 4, "eight": 2, "either": 4, "empti": [2, 3, 5], "enabl": 5, "endpoint": 5, "endpoint_typ": 5, "enough": 2, "environ": 3, "exampl": [0, 2, 6], "except": [2, 4], "excption": [], "exist": 3, "exp_backoff": 5, "expir": 5, "expires_at": [0, 5], "expires_at_overrid": 5, "expires_in": [0, 5], "expires_in_overrid": [], "explain": 4, "exponenti": 5, "exponential_backoff_ca": 5, "exponential_backoff_ca_": [], "exponentialbackoff": 5, "f0": 4, "f0d08565850320613717ebf068585447": 4, "fals": [3, 4, 5, 6], "far": [], "file": [3, 5], "filelock": 3, "filenam": 3, "filter": 4, "filterstr": 4, "flag": 5, "float": 5, "follow": 3, "format": [4, 6], "from": [2, 3, 4, 5], "full": [], "function": [2, 4, 5, 6], "furthermor": [4, 5], "g": [4, 5], "gadmin2": [], "gener": [2, 5], "get": [2, 4, 5], "get_token": [0, 5], "get_token_acs_api": [], "get_token_oauth2": [], "github": [], "given": [2, 3], "go": 5, "goe": [], "grant": 5, "grant_typ": 5, "green": [], "greenldapnoresultsexcept": [0, 4], "greenunknownldapattribut": [0, 4], "gssapi": 4, "ha": 5, "have": [2, 3, 4, 5], "hello": 6, "host": 4, "how": 4, "http": [5, 6], "i": [2, 3, 4, 5, 6], "identifi": 5, "ignor": 5, "import": [3, 4, 5], "inclus": 2, "inform": [4, 5], "initi": 3, "instanc": [3, 5], "instead": 5, "int": [2, 3, 5], "interact": 5, "ioervion": 2, "is_acs_api": [0, 5], "is_expir": [0, 5], "is_oauth2": [0, 5], "is_zulu_str": [0, 6], "iter": 5, "itself": 5, "jane": 4, "json": 5, "jstanford": 4, "kei": 4, "kerbero": [0, 1, 4], "kerberosticket": [0, 3], "keytab": 3, "keytab_path": 3, "kind": 5, "kprincip": 3, "krb5ccname": 3, "kt": 3, "larger": 2, "ldap": [0, 1], "ldapnoresultsexcept": 4, "length": 2, "less": 3, "librari": [3, 5], "like": 4, "limit_valu": 5, "linknam": [], "linkname_": [], "list": [4, 5], "local_tim": 6, "local_tz": 6, "locat": 3, "lock": 3, "lockfil": 3, "long": 2, "longer": 5, "look": 4, "macrotex": [], "main": 4, "maintain": 3, "make": 5, "manag": 3, "map": 4, "maximum": 5, "messag": 5, "method": [3, 4, 5], "minim": 5, "modul": 0, "more": [2, 3], "most": 4, "msg": 5, "much": 5, "multi": 4, "must": 4, "name": 3, "need": 3, "neg": 5, "neither": 2, "new": [], "new_york": 6, "none": [2, 3, 4, 5, 6], "nor": 2, "normal": 3, "note": [4, 5, 6], "now": [2, 3, 5, 6], "num_iter": 5, "number": 5, "oauth": 5, "oauth2": [0, 1], "object": [2, 3, 4, 5, 6], "objectclass": 4, "offset": 6, "old": 3, "onc": 5, "one": 4, "onli": [3, 4, 5], "oper": 5, "option": [2, 5], "org": 6, "other": 5, "otherwis": [3, 4, 5, 6], "out": 5, "output": 5, "overrid": 5, "overview": 0, "packag": [3, 4, 5], "param": [], "paramet": [2, 4, 5, 6], "pass": 3, "password": 5, "path": 3, "peopl": 4, "perform": 4, "pickl": 5, "plu": 2, "point": [3, 5], "prefix": 2, "princip": 3, "progress": [0, 5], "properti": 5, "provid": [2, 5], "provis": 3, "put": [2, 3], "py": [], "python": [3, 5], "pytz": 6, "rais": [2, 4, 6], "random": 2, "random_uid": [0, 2], "randomli": 2, "read": 5, "recogn": 5, "regular": 4, "relat": [5, 6], "relev": 5, "remov": 3, "renew": 3, "repres": 5, "request": 5, "requir": [3, 5], "respons": 5, "rest": 2, "restructuredtext": [], "result": [2, 4], "retri": 5, "retriev": 5, "return": [2, 3, 4, 5, 6], "same": [3, 5], "scope": [4, 5], "sdfjsdflk": [], "search": [0, 4], "sec": 2, "second": [2, 3, 5], "secret": 5, "see": [5, 6], "self": [3, 5], "sent": 5, "server": [4, 5], "servic": 5, "set": [3, 5], "show": 5, "simpl": [3, 5], "sinc": [], "singl": 4, "slot": 5, "smaller": 2, "so": [4, 5], "some": 4, "someth": 4, "sourc": 5, "space": 2, "staff": 4, "standard": 5, "start": 2, "storag": 5, "str": [2, 3, 4, 5, 6], "string": [2, 4, 5, 6], "style": 5, "sub": 4, "suffici": 3, "suffix": 3, "sugwaffilcode1": 4, "suit": [], "sumailcod": 4, "sumaildrop": 4, "suppli": [2, 5], "support": [4, 5], "suregid": 4, "suseassunetid": 4, "syntax": [], "t": 5, "t21": 6, "take": 3, "tell": 5, "test": [2, 5], "testcwq": 2, "than": [2, 3, 5], "thi": [2, 3, 4, 5], "thin": 4, "those": 5, "three": 2, "ticket": 3, "ticket_fil": 3, "ticket_file_needs_upd": [0, 3], "ticket_lock_fil": 3, "time": [2, 3, 5, 6], "time_slot_sec": 5, "timeout": [3, 5], "timezon": [2, 5, 6], "token": 5, "too": [2, 3], "tr": 6, "tree": 4, "true": [3, 4, 5, 6], "two": [3, 4, 5], "type": [2, 5], "uid": [2, 4], "under": 3, "unit": 5, "unless": 2, "until": 5, "up": 5, "updat": 3, "url": 5, "us": [2, 3, 4, 5], "use_cach": 5, "user": 4, "usernam": 5, "utc": [2, 5, 6], "utc_datetime_secs_from_now": [0, 2], "utf8": 4, "util": [], "v1": 5, "valid": [2, 3, 4, 5, 6], "valu": [4, 5], "valueerror": 6, "variabl": 3, "vaul": 4, "verbos": [3, 5], "via": 5, "w3": 6, "wa": 5, "wait": 5, "want": 5, "we": 5, "what": [], "when": [4, 5], "where": [4, 5], "which": [2, 4, 5], "wrapper": [4, 5], "write": 3, "www": 6, "you": [3, 4, 5], "your": [], "z": 6, "zule": [], "zulu": [5, 6], "zulu_str": 6, "zulu_string_to_utc": [0, 6], "zulu_time_str": [0, 5], "zulutim": [0, 1], "zzz": []}, "titles": ["stanford-green documentation", "stanford.green Modules", "stanford.green", "stanford.green.kerberos", "stanford.green.ldap", "stanford.green.oauth2", "stanford.green.zulutime"], "titleterms": {"account": [], "adasaad": [], "content": [0, 1], "document": 0, "exampl": [3, 4, 5], "green": [0, 1, 2, 3, 4, 5, 6], "kerbero": 3, "ldap": 4, "modul": 1, "oauth2": 5, "overview": [3, 4, 5], "stanford": [0, 1, 2, 3, 4, 5, 6], "suit": [], "zulutim": 6}})
\ No newline at end of file
diff --git a/stanford/green/ldap/__init__.py b/stanford/green/ldap/__init__.py
index d09b0ae..a1fdeee 100644
--- a/stanford/green/ldap/__init__.py
+++ b/stanford/green/ldap/__init__.py
@@ -4,8 +4,8 @@
Overview
--------
-LDAP functions useful for Stanford-based applications. Currenently the
-only authentication supported when connecting to an LDAP server is GSSAPI
+LDAP functions useful for Stanford-based applications. Currently the
+only authentication method supported when connecting to an LDAP server is GSSAPI
(Kerberos).
--------
@@ -394,6 +394,8 @@ def attribute_is_multi_valued(attribute_name: str) -> bool:
class LDAP():
+ """The LDAP class.
+ """
def __init__(self,
host: str = 'ldap.stanford.edu',
@@ -468,6 +470,18 @@ def search(
) -> dict[str, LDAPResult]:
"""Perform an LDAP search.
+ :param basedn: base DN on which to search
+ :type basedn: str
+
+ :param filterstr: a valid LDAP filter clause (e.g., ``(uid=jstanford)``)
+ :type filterstr: str
+
+ :param filterstr: a list of attributes to return
+ :type filterstr: list[str]
+
+ :param scope: the search scope; must be one "sub", "base", or "one".
+ :type scope: str
+
This method is a thin wrapper around the ldap package's search method. The
difference is in how it behaves when there are no results and the format
of the returned value.
|