Skip to content

Commit

Permalink
Reuse timestamp from JS instead of re-creating
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Jan 27, 2024
1 parent 8af5e9c commit 6a969b9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
9 changes: 6 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"

<dl class="py function">
<dt class="sig sig-object py" id="pystream.models.authenticator.verify_login">
<em class="property"><span class="k"><span class="pre">async</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pystream.models.authenticator.</span></span><span class="sig-name descname"><span class="pre">verify_login</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Request</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">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#pystream.models.authenticator.verify_login" title="Permalink to this definition"></a></dt>
<em class="property"><span class="k"><span class="pre">async</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pystream.models.authenticator.</span></span><span class="sig-name descname"><span class="pre">verify_login</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Request</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">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#pystream.models.authenticator.verify_login" title="Permalink to this definition"></a></dt>
<dd><p>Verifies authentication and generates session token for each user.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
Expand Down Expand Up @@ -774,11 +774,14 @@ <h1>Routers<a class="headerlink" href="#routers" title="Permalink to this headin
<span id="authentication"></span><h1>Authentication<a class="headerlink" href="#module-pystream.routers.auth" title="Permalink to this heading"></a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="pystream.routers.auth.get_expiry">
<span class="sig-prename descclassname"><span class="pre">pystream.routers.auth.</span></span><span class="sig-name descname"><span class="pre">get_expiry</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">lease</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</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">str</span></span></span><a class="headerlink" href="#pystream.routers.auth.get_expiry" title="Permalink to this definition"></a></dt>
<span class="sig-prename descclassname"><span class="pre">pystream.routers.auth.</span></span><span class="sig-name descname"><span class="pre">get_expiry</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">lease_start</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lease_duration</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</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">str</span></span></span><a class="headerlink" href="#pystream.routers.auth.get_expiry" title="Permalink to this definition"></a></dt>
<dd><p>Get expiry datetime as string using max age.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>lease</strong> – Number of seconds until expiry.</p>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lease_start</strong> – Time when the authentication was made.</p></li>
<li><p><strong>lease_duration</strong> – Number of seconds until expiry.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Returns the date and time of expiry in GMT.</p>
Expand Down
Loading

0 comments on commit 6a969b9

Please sign in to comment.