From f10b72b592071f9e7943c1c47354064f3752410c Mon Sep 17 00:00:00 2001 From: Adam Henry Lewenberg Date: Mon, 26 Aug 2024 09:29:22 -0700 Subject: [PATCH] more work on ldap module documentation (take 5) --- docs/genindex.html | 12 ++++ docs/index.html | 5 ++ docs/modules/ldap.html | 111 +++++++++++++++++++++++++++++++- docs/objects.inv | Bin 760 -> 787 bytes docs/searchindex.js | 2 +- stanford/green/ldap/__init__.py | 63 +++++++++++++++++- 6 files changed, 188 insertions(+), 5 deletions(-) diff --git a/docs/genindex.html b/docs/genindex.html index 2002dcd..27e827f 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -70,10 +70,16 @@

A

  • ApiAccessTokenEndpoint (class in stanford.green.oauth2) +
  • +
  • attribute_is_multi_valued() (in module stanford.green.ldap)
  • attribute_is_single_valued() (in module stanford.green.ldap)
  • @@ -199,6 +205,12 @@

    M

    P

    + diff --git a/docs/index.html b/docs/index.html index e9981a0..be507bd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -67,7 +67,12 @@

    stanford-green documentationLDAP.sunetid_people_info() +
  • account_attribute_is_multi_valued()
  • +
  • account_attribute_is_single_valued()
  • +
  • attribute_is_multi_valued()
  • attribute_is_single_valued()
  • +
  • people_attribute_is_multi_valued()
  • +
  • people_attribute_is_single_valued()
  • stanford.green.oauth2
  • +
  • account_attribute_is_multi_valued()
  • +
  • account_attribute_is_single_valued()
  • +
  • attribute_is_multi_valued()
  • attribute_is_single_valued()
  • +
  • people_attribute_is_multi_valued()
  • +
  • people_attribute_is_single_valued()
  • stanford.green.oauth2
  • diff --git a/docs/objects.inv b/docs/objects.inv index 6241d2229d1bbbb330dab974be930c4ef32b523d..b2b604ccce169fc48f0408f0c3db7aff031200ff 100644 GIT binary patch delta 643 zcmV-}0(|}W1(ODln}1>h;-gLa>pK{GV@G7;O`IDxGtZ3u4g)yP)LL6nZY+Qz=I~H! z5h@@bNgB8hE9Riw`nr0T-pt;US>XnLlS+mp4Q;B9%@TTGz&;|?h23+@LtP`9{M{BGqN&m1afQa06 zQ2fpMXUPs14u2+mD|-55r%$rgX8K%n;G0v{EcorGY-dVSmwHocwcs3_d)B+Oqn$4P zK5G=DguRg#9DZ)(8LJIgf0zU*Rd&(59f$%XrkDu$FH`~dv>K>Gk@eZC-JbXgx41oV`ZIOnDwrgmy$wX4N>35Tt+Ww23 zh-E^X#&zsjnUsd$*N7Lk-(I%D^$bOFqBS{E}^;_zw%f=o?k?J{14} delta 616 zcmV-u0+;=h2KWV#n}6Z};-gLa>pK{GV@G7;P3#+nnP)KXFdjS4)LL6nZY+Qz=J>GJ zB2+*=k~DB1R?I=U_512wnwh;Pv%>ZK${pAhSnaZac5x`A{MrnjCEtOMOkOeP$ov9w zIIH9pFcnO_Pw-nUMuA#j9;mOM=vw02kIL_WsR9s=1|yi4YJYQEoJug0RVprAQ>nK3 z5{KVDFP1;_PjI2~?(x9Ec&Y0gf|rMRhW#q^x7sQFw`MQAw{jIc+>VTxT>cF6EV)(+ zxX+&QK!gKk`SvbCP~fGYjB_27rxMM^;ElyGpbaMG9XQqsO{Jp_(;9JqSQS7-;5sP& z7U4Aue)}n#-+yW8T81}P3(mp0XT3{x@jQjPtU-_x4n|sVl+_7ktTtf%aTKIf*`t3u z5Cup~F%s}!r~+2TJy3@tU#M6Eu|{^tk4hLVmA^xqEU%;+thK(Cebl{n*m#{W6O5cR zM&~Mw8iF&vg&1clw3`Awp{{ssCestyQ|X8`2+f?kg@0_B5_(UAyi}x5ePhNucuui} zfm9g)&u(pzhM)dhXtBsdQnu)~i`UBji=BvRLhHhHs#%#W^}(+ZQNl5C9ah{ap5 diff --git a/docs/searchindex.js b/docs/searchindex.js index a06f7f6..9d7401b 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]], "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]], "sunetid_account_info() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.sunetid_account_info", false]], "sunetid_info() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.sunetid_info", false]], "sunetid_people_info() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.sunetid_people_info", 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"], [4, 2, 1, "", "sunetid_account_info"], [4, 2, 1, "", "sunetid_info"], [4, 2, 1, "", "sunetid_people_info"]], "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": [4, 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, "equal": 4, "error": 4, "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], "found": 4, "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, "meth": [], "method": [3, 4, 5], "methodqq": [], "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, "ok": 4, "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], "seek": 4, "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, "sunetid": 4, "sunetid_account_info": [0, 4], "sunetid_info": [0, 4], "sunetid_people_info": [0, 4], "suppli": [2, 5], "support": [4, 5], "sure": 4, "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, "thisqq": [], "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, "trap": 4, "tree": 4, "true": [3, 4, 5, 6], "two": [3, 4, 5], "type": [2, 5], "uid": [2, 4], "under": 3, "unit": 5, "unless": 2, "unrecogn": 4, "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], "whose": 4, "wrapper": [4, 5], "write": 3, "www": 6, "you": [3, 4, 5], "your": 4, "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": {"account_attribute_is_multi_valued() (in module stanford.green.ldap)": [[4, "stanford.green.ldap.account_attribute_is_multi_valued", false]], "account_attribute_is_single_valued() (in module stanford.green.ldap)": [[4, "stanford.green.ldap.account_attribute_is_single_valued", false]], "attribute_is_multi_valued() (in module stanford.green.ldap)": [[4, "stanford.green.ldap.attribute_is_multi_valued", false]], "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]], "people_attribute_is_multi_valued() (in module stanford.green.ldap)": [[4, "stanford.green.ldap.people_attribute_is_multi_valued", false]], "people_attribute_is_single_valued() (in module stanford.green.ldap)": [[4, "stanford.green.ldap.people_attribute_is_single_valued", false]], "search() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.search", false]], "stanford.green.ldap": [[4, "module-stanford.green.ldap", false]], "sunetid_account_info() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.sunetid_account_info", false]], "sunetid_info() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.sunetid_info", false]], "sunetid_people_info() (stanford.green.ldap.ldap method)": [[4, "stanford.green.ldap.LDAP.sunetid_people_info", 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, "", "account_attribute_is_multi_valued"], [4, 4, 1, "", "account_attribute_is_single_valued"], [4, 4, 1, "", "attribute_is_multi_valued"], [4, 4, 1, "", "attribute_is_single_valued"], [4, 4, 1, "", "people_attribute_is_multi_valued"], [4, 4, 1, "", "people_attribute_is_single_valued"]], "stanford.green.ldap.LDAP": [[4, 2, 1, "", "connect"], [4, 2, 1, "", "search"], [4, 2, 1, "", "sunetid_account_info"], [4, 2, 1, "", "sunetid_info"], [4, 2, 1, "", "sunetid_people_info"]], "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, "account_attribute_is_multi_valu": [0, 4], "account_attribute_is_single_valu": [0, 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": [0, 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, 4], "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": [4, 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, "equal": 4, "error": 4, "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], "found": 4, "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], "ldap1": 4, "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, "meth": [], "method": [3, 4, 5], "methodqq": [], "minim": 5, "modul": 0, "more": [2, 3], "most": 4, "msg": 5, "much": 5, "multi": 4, "must": 4, "name": [3, 4], "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, "ok": 4, "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, "people_attribute_is_multi_valu": [0, 4], "people_attribute_is_single_valu": [0, 4], "peopler": [], "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], "seek": 4, "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, "sunetid": 4, "sunetid_account_info": [0, 4], "sunetid_info": [0, 4], "sunetid_people_info": [0, 4], "suppli": [2, 5], "support": [4, 5], "sure": 4, "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, "thisqq": [], "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, "trap": 4, "tree": 4, "true": [3, 4, 5, 6], "two": [3, 4, 5], "type": [2, 5], "uid": [2, 4], "under": 3, "unit": 5, "unless": 2, "unrecogn": 4, "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], "whose": 4, "wrapper": [4, 5], "write": 3, "www": 6, "you": [3, 4, 5], "your": 4, "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 53328a5..3da89d7 100644 --- a/stanford/green/ldap/__init__.py +++ b/stanford/green/ldap/__init__.py @@ -21,8 +21,14 @@ True Connect to the main Stanford LDAP server and get a user's accounts-tree -information (this assumes you have a valid Kerberos context): +information (this assumes you have a valid Kerberos context):: + from stanford.green.ldap import LDAP + + ldap1 = LDAP() + results = ldap1.sunetid_account_info('jstanford') # Get account tree LDAP information for user 'jstanford' + results = ldap1.sunetid_people_info('jstanford') # Get people tree LDAP information for user 'jstanford' + results = ldap1.sunetid_info('jstanford') # Get BOTH account and people tree LDAP information for user 'jstanford' """ import logging @@ -42,7 +48,7 @@ class GreenUnknownLDAPAttribute(Exception): pass class GreenLDAPNoResultsException(Exception): - """Used when no results are returned""" + """Used when no LDAP results are found""" pass @@ -361,6 +367,17 @@ class GreenLDAPNoResultsException(Exception): BASEDN_PEOPLE = "cn=people,dc=stanford,dc=edu" def account_attribute_is_single_valued(attribute_name: str) -> bool: + """Return True if `attribute_name` is a single-valued account-tree attribute, False otherwise. + + :param attribute_name: a string + :type prefix: str + :return: ``True`` if `attribute_name` is single-valued and a valid + account-tree attribute, ``False`` otherwise. + + :raises GreenUnknownLDAPAttribute: if `attribute_name` is not a valid + account-tree attribute name. + + """ if (attribute_name in ACCOUNT_ATTRIBUTE_TO_MULTIPLICITY): return (ACCOUNT_ATTRIBUTE_TO_MULTIPLICITY[attribute_name] == 'single') else: @@ -368,9 +385,29 @@ def account_attribute_is_single_valued(attribute_name: str) -> bool: raise GreenUnknownLDAPAttribute(msg) def account_attribute_is_multi_valued(attribute_name: str) -> bool: + """Return True if `attribute_name` is multi-valued account-tree, False otherwise. + + :param attribute_name: a string + :type prefix: str + :return: ``True`` if `attribute_name` is a valid + account-tree attribute and is multi-valued, ``False`` otherwise. + + :raises GreenUnknownLDAPAttribute: if `attribute_name` is not a valid + account-tree attribute name. + + """ return not account_attribute_is_single_valued(attribute_name) def people_attribute_is_single_valued(attribute_name: str) -> bool: + """Return True if `attribute_name` is single-valued people-tree, False otherwise. + + :param attribute_name: a string + :type prefix: str + :return: ``True`` if `attribute_name` is single-valued, ``False`` otherwise. + + :raises GreenUnknownLDAPAttribute: if `attribute_name` is not a valid + people-tree attribute name. + """ if (attribute_name in PEOPLE_ATTRIBUTE_TO_MULTIPLICITY): return (PEOPLE_ATTRIBUTE_TO_MULTIPLICITY[attribute_name] == 'single') else: @@ -378,6 +415,15 @@ def people_attribute_is_single_valued(attribute_name: str) -> bool: raise GreenUnknownLDAPAttribute(msg) def people_attribute_is_multi_valued(attribute_name: str) -> bool: + """Return True if `attribute_name` is single-valued, False otherwise. + + :param attribute_name: a string + :type prefix: str + :return: ``True`` if `attribute_name` is single-valued, ``False`` otherwise. + + :raises GreenUnknownLDAPAttribute: if `attribute_name` is not a valid + people-tree attribute name. + """ return not people_attribute_is_single_valued(attribute_name) def attribute_is_single_valued(attribute_name: str) -> bool: @@ -386,6 +432,9 @@ def attribute_is_single_valued(attribute_name: str) -> bool: :param attribute_name: a string :type prefix: str :return: ``True`` if `attribute_name` is single-valued, ``False`` otherwise. + + :raises GreenUnknownLDAPAttribute: if `attribute_name` is not a valid + attribute name. """ if (attribute_name in ATTRIBUTE_TO_MULTIPLICITY): @@ -395,8 +444,16 @@ def attribute_is_single_valued(attribute_name: str) -> bool: raise GreenUnknownLDAPAttribute(msg) def attribute_is_multi_valued(attribute_name: str) -> bool: - return not attribute_is_single_valued(attribute_name) + """Return True if `attribute_name` is multi-valued, False otherwise. + + :param attribute_name: a string + :type prefix: str + :return: ``True`` if `attribute_name` is multi-valued, ``False`` otherwise. + :raises GreenUnknownLDAPAttribute: if `attribute_name` is not a valid + attribute name. + """ + return not attribute_is_single_valued(attribute_name) class LDAP(): """The LDAP class.