Skip to content

Commit

Permalink
more work on ldap module documentation (take 5)
Browse files Browse the repository at this point in the history
  • Loading branch information
rendell77 committed Aug 26, 2024
1 parent 1a31149 commit f10b72b
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 5 deletions.
12 changes: 12 additions & 0 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ <h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="modules/oauth2.html#stanford.green.oauth2.AccessToken">AccessToken (class in stanford.green.oauth2)</a>
</li>
<li><a href="modules/ldap.html#stanford.green.ldap.account_attribute_is_multi_valued">account_attribute_is_multi_valued() (in module stanford.green.ldap)</a>
</li>
<li><a href="modules/ldap.html#stanford.green.ldap.account_attribute_is_single_valued">account_attribute_is_single_valued() (in module stanford.green.ldap)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="modules/oauth2.html#stanford.green.oauth2.ApiAccessTokenEndpoint">ApiAccessTokenEndpoint (class in stanford.green.oauth2)</a>
</li>
<li><a href="modules/ldap.html#stanford.green.ldap.attribute_is_multi_valued">attribute_is_multi_valued() (in module stanford.green.ldap)</a>
</li>
<li><a href="modules/ldap.html#stanford.green.ldap.attribute_is_single_valued">attribute_is_single_valued() (in module stanford.green.ldap)</a>
</li>
Expand Down Expand Up @@ -199,6 +205,12 @@ <h2 id="M">M</h2>
<h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="modules/ldap.html#stanford.green.ldap.people_attribute_is_multi_valued">people_attribute_is_multi_valued() (in module stanford.green.ldap)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="modules/ldap.html#stanford.green.ldap.people_attribute_is_single_valued">people_attribute_is_single_valued() (in module stanford.green.ldap)</a>
</li>
<li><a href="modules/oauth2.html#stanford.green.oauth2.ApiAccessTokenEndpoint.progress">progress() (stanford.green.oauth2.ApiAccessTokenEndpoint method)</a>
</li>
</ul></td>
Expand Down
5 changes: 5 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ <h1>stanford-green documentation<a class="headerlink" href="#stanford-green-docu
<li class="toctree-l4"><a class="reference internal" href="modules/ldap.html#stanford.green.ldap.LDAP.sunetid_people_info"><code class="docutils literal notranslate"><span class="pre">LDAP.sunetid_people_info()</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="modules/ldap.html#stanford.green.ldap.account_attribute_is_multi_valued"><code class="docutils literal notranslate"><span class="pre">account_attribute_is_multi_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="modules/ldap.html#stanford.green.ldap.account_attribute_is_single_valued"><code class="docutils literal notranslate"><span class="pre">account_attribute_is_single_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="modules/ldap.html#stanford.green.ldap.attribute_is_multi_valued"><code class="docutils literal notranslate"><span class="pre">attribute_is_multi_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="modules/ldap.html#stanford.green.ldap.attribute_is_single_valued"><code class="docutils literal notranslate"><span class="pre">attribute_is_single_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="modules/ldap.html#stanford.green.ldap.people_attribute_is_multi_valued"><code class="docutils literal notranslate"><span class="pre">people_attribute_is_multi_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="modules/ldap.html#stanford.green.ldap.people_attribute_is_single_valued"><code class="docutils literal notranslate"><span class="pre">people_attribute_is_single_valued()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="modules/oauth2.html">stanford.green.oauth2</a><ul>
Expand Down
111 changes: 110 additions & 1 deletion docs/modules/ldap.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,19 @@ <h2>Examples<a class="headerlink" href="#examples" title="Link to this heading">
</div>
<p>Connect to the main Stanford LDAP server and get a user’s accounts-tree
information (this assumes you have a valid Kerberos context):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">stanford.green.ldap</span> <span class="kn">import</span> <span class="n">LDAP</span>

<span class="n">ldap1</span> <span class="o">=</span> <span class="n">LDAP</span><span class="p">()</span>
<span class="n">results</span> <span class="o">=</span> <span class="n">ldap1</span><span class="o">.</span><span class="n">sunetid_account_info</span><span class="p">(</span><span class="s1">&#39;jstanford&#39;</span><span class="p">)</span> <span class="c1"># Get account tree LDAP information for user &#39;jstanford&#39;</span>
<span class="n">results</span> <span class="o">=</span> <span class="n">ldap1</span><span class="o">.</span><span class="n">sunetid_people_info</span><span class="p">(</span><span class="s1">&#39;jstanford&#39;</span><span class="p">)</span> <span class="c1"># Get people tree LDAP information for user &#39;jstanford&#39;</span>
<span class="n">results</span> <span class="o">=</span> <span class="n">ldap1</span><span class="o">.</span><span class="n">sunetid_info</span><span class="p">(</span><span class="s1">&#39;jstanford&#39;</span><span class="p">)</span> <span class="c1"># Get BOTH account and people tree LDAP information for user &#39;jstanford&#39;</span>
</pre></div>
</div>
</section>
<dl class="py exception">
<dt class="sig sig-object py" id="stanford.green.ldap.GreenLDAPNoResultsException">
<em class="property"><span class="pre">exception</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">stanford.green.ldap.</span></span><span class="sig-name descname"><span class="pre">GreenLDAPNoResultsException</span></span><a class="headerlink" href="#stanford.green.ldap.GreenLDAPNoResultsException" title="Link to this definition"></a></dt>
<dd><p>Used when no results are returned</p>
<dd><p>Used when no LDAP results are found</p>
</dd></dl>

<dl class="py exception">
Expand Down Expand Up @@ -222,6 +230,62 @@ <h2>Examples<a class="headerlink" href="#examples" title="Link to this heading">

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="stanford.green.ldap.account_attribute_is_multi_valued">
<span class="sig-prename descclassname"><span class="pre">stanford.green.ldap.</span></span><span class="sig-name descname"><span class="pre">account_attribute_is_multi_valued</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attribute_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#stanford.green.ldap.account_attribute_is_multi_valued" title="Link to this definition"></a></dt>
<dd><p>Return True if <cite>attribute_name</cite> is multi-valued account-tree, False otherwise.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>attribute_name</strong> – a string</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if <cite>attribute_name</cite> is a valid
account-tree attribute and is multi-valued, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#stanford.green.ldap.GreenUnknownLDAPAttribute" title="stanford.green.ldap.GreenUnknownLDAPAttribute"><strong>GreenUnknownLDAPAttribute</strong></a> – if <cite>attribute_name</cite> is not a valid
account-tree attribute name.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="stanford.green.ldap.account_attribute_is_single_valued">
<span class="sig-prename descclassname"><span class="pre">stanford.green.ldap.</span></span><span class="sig-name descname"><span class="pre">account_attribute_is_single_valued</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attribute_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#stanford.green.ldap.account_attribute_is_single_valued" title="Link to this definition"></a></dt>
<dd><p>Return True if <cite>attribute_name</cite> is a single-valued account-tree attribute, False otherwise.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>attribute_name</strong> – a string</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if <cite>attribute_name</cite> is single-valued and a valid
account-tree attribute, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#stanford.green.ldap.GreenUnknownLDAPAttribute" title="stanford.green.ldap.GreenUnknownLDAPAttribute"><strong>GreenUnknownLDAPAttribute</strong></a> – if <cite>attribute_name</cite> is not a valid
account-tree attribute name.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="stanford.green.ldap.attribute_is_multi_valued">
<span class="sig-prename descclassname"><span class="pre">stanford.green.ldap.</span></span><span class="sig-name descname"><span class="pre">attribute_is_multi_valued</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attribute_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#stanford.green.ldap.attribute_is_multi_valued" title="Link to this definition"></a></dt>
<dd><p>Return True if <cite>attribute_name</cite> is multi-valued, False otherwise.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>attribute_name</strong> – a string</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if <cite>attribute_name</cite> is multi-valued, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#stanford.green.ldap.GreenUnknownLDAPAttribute" title="stanford.green.ldap.GreenUnknownLDAPAttribute"><strong>GreenUnknownLDAPAttribute</strong></a> – if <cite>attribute_name</cite> is not a valid
attribute name.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="stanford.green.ldap.attribute_is_single_valued">
<span class="sig-prename descclassname"><span class="pre">stanford.green.ldap.</span></span><span class="sig-name descname"><span class="pre">attribute_is_single_valued</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attribute_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#stanford.green.ldap.attribute_is_single_valued" title="Link to this definition"></a></dt>
Expand All @@ -233,6 +297,46 @@ <h2>Examples<a class="headerlink" href="#examples" title="Link to this heading">
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if <cite>attribute_name</cite> is single-valued, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#stanford.green.ldap.GreenUnknownLDAPAttribute" title="stanford.green.ldap.GreenUnknownLDAPAttribute"><strong>GreenUnknownLDAPAttribute</strong></a> – if <cite>attribute_name</cite> is not a valid
attribute name.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="stanford.green.ldap.people_attribute_is_multi_valued">
<span class="sig-prename descclassname"><span class="pre">stanford.green.ldap.</span></span><span class="sig-name descname"><span class="pre">people_attribute_is_multi_valued</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attribute_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#stanford.green.ldap.people_attribute_is_multi_valued" title="Link to this definition"></a></dt>
<dd><p>Return True if <cite>attribute_name</cite> is single-valued, False otherwise.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>attribute_name</strong> – a string</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if <cite>attribute_name</cite> is single-valued, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#stanford.green.ldap.GreenUnknownLDAPAttribute" title="stanford.green.ldap.GreenUnknownLDAPAttribute"><strong>GreenUnknownLDAPAttribute</strong></a> – if <cite>attribute_name</cite> is not a valid
people-tree attribute name.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="stanford.green.ldap.people_attribute_is_single_valued">
<span class="sig-prename descclassname"><span class="pre">stanford.green.ldap.</span></span><span class="sig-name descname"><span class="pre">people_attribute_is_single_valued</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attribute_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#stanford.green.ldap.people_attribute_is_single_valued" title="Link to this definition"></a></dt>
<dd><p>Return True if <cite>attribute_name</cite> is single-valued people-tree, False otherwise.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>attribute_name</strong> – a string</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if <cite>attribute_name</cite> is single-valued, <code class="docutils literal notranslate"><span class="pre">False</span></code> otherwise.</p>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#stanford.green.ldap.GreenUnknownLDAPAttribute" title="stanford.green.ldap.GreenUnknownLDAPAttribute"><strong>GreenUnknownLDAPAttribute</strong></a> – if <cite>attribute_name</cite> is not a valid
people-tree attribute name.</p>
</dd>
</dl>
</dd></dl>

Expand Down Expand Up @@ -282,7 +386,12 @@ <h1 class="logo"><a href="../index.html">stanford-green</a></h1>
<li class="toctree-l4"><a class="reference internal" href="#stanford.green.ldap.LDAP.sunetid_people_info"><code class="docutils literal notranslate"><span class="pre">LDAP.sunetid_people_info()</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#stanford.green.ldap.account_attribute_is_multi_valued"><code class="docutils literal notranslate"><span class="pre">account_attribute_is_multi_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#stanford.green.ldap.account_attribute_is_single_valued"><code class="docutils literal notranslate"><span class="pre">account_attribute_is_single_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#stanford.green.ldap.attribute_is_multi_valued"><code class="docutils literal notranslate"><span class="pre">attribute_is_multi_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#stanford.green.ldap.attribute_is_single_valued"><code class="docutils literal notranslate"><span class="pre">attribute_is_single_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#stanford.green.ldap.people_attribute_is_multi_valued"><code class="docutils literal notranslate"><span class="pre">people_attribute_is_multi_valued()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#stanford.green.ldap.people_attribute_is_single_valued"><code class="docutils literal notranslate"><span class="pre">people_attribute_is_single_valued()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="oauth2.html">stanford.green.oauth2</a></li>
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
Loading

0 comments on commit f10b72b

Please sign in to comment.