This commit is contained in:
@@ -1302,55 +1302,62 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>jwtlib: A framework-agnostic JWT authentication library.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib--summary">Summary</h4>
|
||||
<p><code>jwtlib</code> provides a set of pure logic components for handling JWT discovery,
|
||||
<h3 id="jwtlib--summary">Summary</h3>
|
||||
<p><code>jwtlib</code>: A framework-agnostic <code>JWT</code> authentication library.</p>
|
||||
<p><code>jwtlib</code> provides a set of pure logic components for handling <code>JWT</code> discovery,
|
||||
user registration, login, and token introspection. It is designed to be
|
||||
decoupled from any specific web framework (like FastAPI or Flask).</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib--installation">Installation</h4>
|
||||
<h3 id="jwtlib--installation">Installation</h3>
|
||||
<p>Install using pip:</p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>pip install py-jwt
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<div class="language-bash highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a>pip<span class="w"> </span>install<span class="w"> </span>py-jwt
|
||||
</span></code></pre></div></td></tr></table></div>
|
||||
<hr />
|
||||
<h4 id="jwtlib--quick-start">Quick Start</h4>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span>
|
||||
<span class="normal">4</span>
|
||||
<span class="normal">5</span>
|
||||
<span class="normal">6</span>
|
||||
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><code>import asyncio
|
||||
from jwtlib import login_user, LoginRequest
|
||||
|
||||
async def main():
|
||||
request = LoginRequest(username="admin", password="password")
|
||||
response = await login_user(request)
|
||||
print(f"Access Token: {response.access_token}")
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<h3 id="jwtlib--quick-start">Quick Start</h3>
|
||||
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-1-1">1</a></span>
|
||||
<span class="normal"><a href="#__codelineno-1-2">2</a></span>
|
||||
<span class="normal"><a href="#__codelineno-1-3">3</a></span>
|
||||
<span class="normal"><a href="#__codelineno-1-4">4</a></span>
|
||||
<span class="normal"><a href="#__codelineno-1-5">5</a></span>
|
||||
<span class="normal"><a href="#__codelineno-1-6">6</a></span>
|
||||
<span class="normal"><a href="#__codelineno-1-7">7</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1"></a><span class="kn">import</span><span class="w"> </span><span class="nn">asyncio</span>
|
||||
</span><span id="__span-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2"></a><span class="kn">from</span><span class="w"> </span><span class="nn">jwtlib</span><span class="w"> </span><span class="kn">import</span> <span class="n">login_user</span><span class="p">,</span> <span class="n">LoginRequest</span>
|
||||
</span><span id="__span-1-3"><a id="__codelineno-1-3" name="__codelineno-1-3"></a>
|
||||
</span><span id="__span-1-4"><a id="__codelineno-1-4" name="__codelineno-1-4"></a><span class="k">async</span> <span class="k">def</span><span class="w"> </span><span class="nf">main</span><span class="p">():</span>
|
||||
</span><span id="__span-1-5"><a id="__codelineno-1-5" name="__codelineno-1-5"></a> <span class="n">request</span> <span class="o">=</span> <span class="n">LoginRequest</span><span class="p">(</span><span class="n">username</span><span class="o">=</span><span class="s2">"admin"</span><span class="p">,</span> <span class="n">password</span><span class="o">=</span><span class="s2">"password"</span><span class="p">)</span>
|
||||
</span><span id="__span-1-6"><a id="__codelineno-1-6" name="__codelineno-1-6"></a> <span class="n">response</span> <span class="o">=</span> <span class="k">await</span> <span class="n">login_user</span><span class="p">(</span><span class="n">request</span><span class="p">)</span>
|
||||
</span><span id="__span-1-7"><a id="__codelineno-1-7" name="__codelineno-1-7"></a> <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Access Token: </span><span class="si">{</span><span class="n">response</span><span class="o">.</span><span class="n">access_token</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
</span></code></pre></div></td></tr></table></div>
|
||||
<hr />
|
||||
<h4 id="jwtlib--public-api">Public API</h4>
|
||||
<h3 id="jwtlib--public-api">Public API</h3>
|
||||
<p>This package re-exports the <strong>core authentication primitives</strong>.
|
||||
Consumers are encouraged to import from this namespace for high-level
|
||||
operations.</p>
|
||||
<p><strong>Authentication:</strong>
|
||||
- register_user
|
||||
- login_user
|
||||
- logout_user
|
||||
- get_logged_in_user</p>
|
||||
<p><strong>Introspection:</strong>
|
||||
- introspect_token
|
||||
- authenticate_request (logic-only)</p>
|
||||
<p><strong>Models:</strong>
|
||||
- RegisterRequest / LoginRequest / LoginResponse / LogoutResponse
|
||||
- PublicUser
|
||||
- IntrospectRequest / IntrospectResponse
|
||||
- TokenPayload</p>
|
||||
<p><strong>Exceptions:</strong>
|
||||
- AuthError
|
||||
- InvalidToken
|
||||
- UserNotFound</p>
|
||||
<p><strong>Authentication:</strong></p>
|
||||
<ul>
|
||||
<li><code>register_user</code></li>
|
||||
<li><code>login_user</code></li>
|
||||
<li><code>logout_user</code></li>
|
||||
<li><code>get_logged_in_user</code></li>
|
||||
</ul>
|
||||
<p><strong>Introspection:</strong></p>
|
||||
<ul>
|
||||
<li><code>introspect_token</code></li>
|
||||
<li><code>authenticate_request</code> (logic-only)</li>
|
||||
</ul>
|
||||
<p><strong>Models:</strong></p>
|
||||
<ul>
|
||||
<li><code>RegisterRequest</code> / <code>LoginRequest</code> / <code>LoginResponse</code> / <code>LogoutResponse</code></li>
|
||||
<li><code>PublicUser</code></li>
|
||||
<li><code>IntrospectRequest</code> / <code>IntrospectResponse</code></li>
|
||||
<li><code>TokenPayload</code></li>
|
||||
</ul>
|
||||
<p><strong>Exceptions:</strong></p>
|
||||
<ul>
|
||||
<li><code>AuthError</code></li>
|
||||
<li><code>InvalidToken</code></li>
|
||||
<li><code>UserNotFound</code></li>
|
||||
</ul>
|
||||
<hr />
|
||||
|
||||
|
||||
@@ -1387,8 +1394,12 @@ operations.</p>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Guarantees:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- All authentication-related exceptions raised by this library inherit from this class
|
||||
- Consumers may catch this exception to handle all auth failures uniformly
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span>
|
||||
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- All authentication-related exceptions raised by this library
|
||||
inherit from this class.
|
||||
- Consumers may catch this exception to handle all auth failures
|
||||
uniformly.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -1432,7 +1443,7 @@ operations.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>JWT access token to introspect.</p>
|
||||
<p><code>JWT</code> access token to introspect.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1548,16 +1559,18 @@ operations.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
<p class="doc doc-class-bases">
|
||||
Bases: <code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthError" href="jwtlib/exceptions/#jwtlib.exceptions.AuthError">AuthError</a></code></p>
|
||||
Bases: <code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthError" href="exceptions/#jwtlib.exceptions.AuthError">AuthError</a></code></p>
|
||||
|
||||
|
||||
<p>Raised when a JWT is missing, malformed, expired, or invalid.</p>
|
||||
<p>Raised when a <code>JWT</code> is missing, malformed, expired, or invalid.</p>
|
||||
|
||||
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Guarantees:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This error indicates that the provided token cannot be used to authenticate a request
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This error indicates that the provided token cannot be used to
|
||||
authenticate a request.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -1581,7 +1594,7 @@ operations.</p>
|
||||
Bases: <code><a class="autorefs autorefs-internal" title="jwtlib.models.common.IdentityMixin" href="models/common/#jwtlib.models.common.IdentityMixin">IdentityMixin</a></code>, <code><a class="autorefs autorefs-internal" title="jwtlib.models.common.PasswordMixin" href="models/common/#jwtlib.models.common.PasswordMixin">PasswordMixin</a></code></p>
|
||||
|
||||
|
||||
<p>Payload for authenticating a user and issuing a JWT.</p>
|
||||
<p>Payload for authenticating a user and issuing a <code>JWT</code>.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Attributes:</span></p>
|
||||
@@ -1676,7 +1689,7 @@ operations.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>JWT access token for authenticated requests.</p>
|
||||
<p><code>JWT</code> access token for authenticated requests.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1967,7 +1980,7 @@ operations.</p>
|
||||
Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p>
|
||||
|
||||
|
||||
<p>Decoded JWT payload.</p>
|
||||
<p>Decoded <code>JWT</code> payload.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Attributes:</span></p>
|
||||
@@ -2009,10 +2022,18 @@ operations.</p>
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Responsibilities:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Represents the validated claims extracted from a JWT after signature verification. This model is used internally to enforce required claims and provide a typed interface to token data.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Represents the validated claims extracted from a `JWT` after
|
||||
signature verification. This model is used internally to enforce
|
||||
required claims and provide a typed interface to token data.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p><strong>Guarantees:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This model assumes the JWT signature has already been verified. No authorization decisions should be made solely on this model. Additional claims may exist but are intentionally ignored.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This model assumes the `JWT` signature has already been verified.
|
||||
No authorization decisions should be made solely on this model.
|
||||
Additional claims may exist but are intentionally ignored.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -2083,10 +2104,18 @@ operations.</p>
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Responsibilities:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Represents a user record as stored in the database. Includes sensitive fields and is strictly confined to the persistence layer.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Represents a user record as stored in the database. Includes
|
||||
sensitive fields and is strictly confined to the persistence
|
||||
layer.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p><strong>Guarantees:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This model MUST NOT be returned from authentication APIs. Consumers should use `PublicUser` instead. Password verification is handled by the repository layer.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This model MUST NOT be returned from authentication APIs.
|
||||
Consumers should use `PublicUser` instead. Password verification
|
||||
is handled by the repository layer.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -2123,7 +2152,7 @@ operations.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
<p class="doc doc-class-bases">
|
||||
Bases: <code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthError" href="jwtlib/exceptions/#jwtlib.exceptions.AuthError">AuthError</a></code></p>
|
||||
Bases: <code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthError" href="exceptions/#jwtlib.exceptions.AuthError">AuthError</a></code></p>
|
||||
|
||||
|
||||
<p>Raised when a valid token does not map to an existing user.</p>
|
||||
@@ -2132,7 +2161,9 @@ operations.</p>
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Guarantees:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Indicates that authentication succeeded at the token level, but the associated user record could not be resolved
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Indicates that authentication succeeded at the token level, but
|
||||
the associated user record could not be resolved.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -2267,7 +2298,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.InvalidToken" href="jwtlib/exceptions/#jwtlib.exceptions.InvalidToken">InvalidToken</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.InvalidToken" href="exceptions/#jwtlib.exceptions.InvalidToken">InvalidToken</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -2277,7 +2308,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
</tr>
|
||||
<tr class="doc-section-item">
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthServiceUnavailable" href="jwtlib/exceptions/#jwtlib.exceptions.AuthServiceUnavailable">AuthServiceUnavailable</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthServiceUnavailable" href="exceptions/#jwtlib.exceptions.AuthServiceUnavailable">AuthServiceUnavailable</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -2319,7 +2350,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Resolve the currently authenticated user from a JWT.</p>
|
||||
<p>Resolve the currently authenticated user from a <code>JWT</code>.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
@@ -2340,7 +2371,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>JWT access token.</p>
|
||||
<p><code>JWT</code> access token.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -2350,11 +2381,12 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>repo</code></td>
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.repository.UserRepository" href="jwtlib/repository/#jwtlib.repository.UserRepository">UserRepository</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.repository.UserRepository" href="repository/#jwtlib.repository.UserRepository">UserRepository</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>Optional user repository instance. If not provided, a default repository is obtained via dependency utilities.</p>
|
||||
<p>Optional user repository instance. If not provided, a default
|
||||
repository is obtained via dependency utilities.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -2380,7 +2412,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>The authenticated user as a PublicUser.</p>
|
||||
<p>The authenticated user as a <code>PublicUser</code>.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2399,7 +2431,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.InvalidToken" href="jwtlib/exceptions/#jwtlib.exceptions.InvalidToken">InvalidToken</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.InvalidToken" href="exceptions/#jwtlib.exceptions.InvalidToken">InvalidToken</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -2409,7 +2441,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
</tr>
|
||||
<tr class="doc-section-item">
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthError" href="jwtlib/exceptions/#jwtlib.exceptions.AuthError">AuthError</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthError" href="exceptions/#jwtlib.exceptions.AuthError">AuthError</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -2441,7 +2473,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Introspect a JWT for service-to-service authentication.</p>
|
||||
<p>Introspect a <code>JWT</code> for service-to-service authentication.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
@@ -2462,7 +2494,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>JWT access token to introspect.</p>
|
||||
<p><code>JWT</code> access token to introspect.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -2472,11 +2504,12 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>repo</code></td>
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.repository.UserRepository" href="jwtlib/repository/#jwtlib.repository.UserRepository">UserRepository</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.repository.UserRepository" href="repository/#jwtlib.repository.UserRepository">UserRepository</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>Optional user repository instance. If not provided, a default repository is obtained via dependency utilities.</p>
|
||||
<p>Optional user repository instance. If not provided, a default
|
||||
repository is obtained via dependency utilities.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -2502,7 +2535,8 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>IntrospectResponse indicating valid token with user, invalid token, or valid token with no user.</p>
|
||||
<p><code>IntrospectResponse</code> indicating valid token with user, invalid
|
||||
token, or valid token with no user.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2513,10 +2547,18 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Responsibilities:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Validates the provided token and resolves the associated user, returning a structured introspection response suitable for internal service use
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Validate the provided token and resolve the associated user,
|
||||
returning a structured introspection response suitable for
|
||||
internal service use.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p><strong>Guarantees:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function never raises authentication exceptions. Instead, it returns a typed response indicating token validity and user presence.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function never raises authentication exceptions. Instead, it
|
||||
returns a typed response indicating token validity and user
|
||||
presence.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
</div>
|
||||
@@ -2571,11 +2613,12 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>repo</code></td>
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.repository.UserRepository" href="jwtlib/repository/#jwtlib.repository.UserRepository">UserRepository</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.repository.UserRepository" href="repository/#jwtlib.repository.UserRepository">UserRepository</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>Optional user repository instance. If not provided, a default repository is obtained via dependency utilities.</p>
|
||||
<p>Optional user repository instance. If not provided, a default
|
||||
repository is obtained via dependency utilities.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -2601,7 +2644,8 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>LoginResponse containing the issued access token and related metadata.</p>
|
||||
<p><code>LoginResponse</code> containing the issued access token and related
|
||||
metadata.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2620,7 +2664,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthError" href="jwtlib/exceptions/#jwtlib.exceptions.AuthError">AuthError</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.AuthError" href="exceptions/#jwtlib.exceptions.AuthError">AuthError</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -2670,7 +2714,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>LogoutResponse containing a logout confirmation message.</p>
|
||||
<p><code>LogoutResponse</code> containing a logout confirmation message.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2681,7 +2725,11 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Guarantees:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function does not invalidate tokens server-side. Instead, it provides a standardized response indicating that the client must discard its token.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function does not invalidate tokens server-side. Instead, it
|
||||
provides a standardized response indicating that the client must
|
||||
discard its token.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
</div>
|
||||
@@ -2736,11 +2784,12 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>repo</code></td>
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.repository.UserRepository" href="jwtlib/repository/#jwtlib.repository.UserRepository">UserRepository</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.repository.UserRepository" href="repository/#jwtlib.repository.UserRepository">UserRepository</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>Optional user repository instance. If not provided, a default repository is obtained via dependency utilities.</p>
|
||||
<p>Optional user repository instance. If not provided, a default
|
||||
repository is obtained via dependency utilities.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -2783,9 +2832,7 @@ PublicUser if authentication succeeds; None if authentication is skipped.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div><ul>
|
||||
<li><a href="jwtlib/">Jwtlib</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user