This commit is contained in:
@@ -1004,12 +1004,11 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Application-level authentication logic.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.app--summary">Summary</h4>
|
||||
<h3 id="jwtlib.app--summary">Summary</h3>
|
||||
<p>Application-level authentication logic.</p>
|
||||
<p>This module contains <strong>pure authentication and introspection logic</strong> with no
|
||||
framework or transport coupling. It is intended to be used by HTTP adapters,
|
||||
CLIs, background workers, and other services that require JWT-based
|
||||
CLIs, background workers, and other services that require <code>JWT</code>-based
|
||||
authentication and user resolution.</p>
|
||||
|
||||
|
||||
@@ -1019,13 +1018,21 @@ authentication and user resolution.</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>
|
||||
<span class="normal">3</span>
|
||||
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- User registration and login
|
||||
- Stateless logout semantics
|
||||
- Current-user resolution from JWTs
|
||||
- Service-to-service token introspection
|
||||
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- User registration and login.
|
||||
- Stateless logout semantics.
|
||||
- Current-user resolution from `JWT`s.
|
||||
- Service-to-service token introspection.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p><strong>Constraints:</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 module intentionally does NOT: Define HTTP routes, manage sessions, perform request parsing or response formatting, or handle transport-level concerns.
|
||||
<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></pre></div></td><td class="code"><div><pre><span></span><code>- This module intentionally does NOT:
|
||||
- Define HTTP routes.
|
||||
- Manage sessions.
|
||||
- Perform request parsing or response formatting.
|
||||
- Handle transport-level concerns.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -1057,7 +1064,7 @@ authentication and user resolution.</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>
|
||||
@@ -1078,7 +1085,7 @@ authentication and user resolution.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>JWT access token.</p>
|
||||
<p><code>JWT</code> access token.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -1088,11 +1095,12 @@ authentication and user resolution.</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>
|
||||
@@ -1118,7 +1126,7 @@ authentication and user resolution.</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>
|
||||
@@ -1137,7 +1145,7 @@ authentication and user resolution.</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">
|
||||
@@ -1147,7 +1155,7 @@ authentication and user resolution.</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">
|
||||
@@ -1179,7 +1187,7 @@ authentication and user resolution.</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>
|
||||
@@ -1200,7 +1208,7 @@ authentication and user resolution.</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>
|
||||
@@ -1210,11 +1218,12 @@ authentication and user resolution.</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>
|
||||
@@ -1240,7 +1249,8 @@ authentication and user resolution.</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>
|
||||
@@ -1251,10 +1261,18 @@ authentication and user resolution.</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>
|
||||
@@ -1309,11 +1327,12 @@ authentication and user resolution.</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>
|
||||
@@ -1339,7 +1358,8 @@ authentication and user resolution.</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>
|
||||
@@ -1358,7 +1378,7 @@ authentication and user resolution.</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">
|
||||
@@ -1408,7 +1428,7 @@ authentication and user resolution.</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>
|
||||
@@ -1419,7 +1439,11 @@ authentication and user resolution.</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>
|
||||
@@ -1474,11 +1498,12 @@ authentication and user resolution.</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>
|
||||
|
||||
@@ -1002,9 +1002,8 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Authentication and authorization exceptions.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.exceptions--summary">Summary</h4>
|
||||
<h3 id="jwtlib.exceptions--summary">Summary</h3>
|
||||
<p>Authentication and authorization exceptions.</p>
|
||||
<p>This module defines the exception hierarchy used throughout the
|
||||
authentication library to represent authentication, authorization,
|
||||
and service-level failures.</p>
|
||||
@@ -1046,8 +1045,12 @@ selectively.</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>
|
||||
|
||||
@@ -1068,7 +1071,7 @@ selectively.</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="#jwtlib.exceptions.AuthError">AuthError</a></code></p>
|
||||
|
||||
|
||||
<p>Raised when the authentication service cannot be reached.</p>
|
||||
@@ -1077,7 +1080,9 @@ selectively.</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 a network failure, timeout, or unexpected error while communicating with the auth service
|
||||
<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 a network failure, timeout, or unexpected error while
|
||||
communicating with the auth service.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -1098,16 +1103,19 @@ selectively.</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="#jwtlib.exceptions.AuthError">AuthError</a></code></p>
|
||||
|
||||
|
||||
<p>Raised when the Authorization header is missing or incorrectly formatted.</p>
|
||||
<p>Raised when the <code>Authorization</code> header is missing or incorrectly
|
||||
formatted.</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 the header is not present or does not follow the expected `Bearer <token>` format
|
||||
<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 the header is not present or does not follow the
|
||||
expected `Bearer <token>` format.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -1128,16 +1136,18 @@ selectively.</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="#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>
|
||||
|
||||
@@ -1158,7 +1168,7 @@ selectively.</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="#jwtlib.exceptions.AuthError">AuthError</a></code></p>
|
||||
|
||||
|
||||
<p>Raised when authentication is required but no user context is present.</p>
|
||||
@@ -1167,7 +1177,9 @@ selectively.</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>- Typically used when attempting to access a protected operation without an authenticated user
|
||||
<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>- Typically used when attempting to access a protected operation
|
||||
without an authenticated user.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -1188,7 +1200,7 @@ selectively.</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="#jwtlib.exceptions.AuthError">AuthError</a></code></p>
|
||||
|
||||
|
||||
<p>Raised when a valid token does not map to an existing user.</p>
|
||||
@@ -1197,7 +1209,9 @@ selectively.</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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1109,7 +1109,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">
|
||||
@@ -1119,7 +1119,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">
|
||||
@@ -1228,7 +1228,7 @@ A dictionary containing the authenticated user's public payload.</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">
|
||||
@@ -1238,7 +1238,7 @@ A dictionary containing the authenticated user's public payload.</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">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,987 +0,0 @@
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/images/favicon.png">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.23">
|
||||
|
||||
|
||||
|
||||
<title>Mongo - jwtlib</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../assets/stylesheets/main.84d31ad4.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../assets/stylesheets/palette.06af60db.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i%7CJetBrains+Mono:400,400i,700,700i&display=fallback">
|
||||
<style>:root{--md-text-font:"Inter";--md-code-font:"JetBrains Mono"}</style>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../assets/_mkdocstrings.css">
|
||||
|
||||
<script>__md_scope=new URL("../../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan">
|
||||
|
||||
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" for="__drawer"></label>
|
||||
<div data-md-component="skip">
|
||||
|
||||
|
||||
<a href="#mongo" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div data-md-component="announce">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<header class="md-header md-header--shadow" data-md-component="header">
|
||||
<nav class="md-header__inner md-grid" aria-label="Header">
|
||||
<a href="../../.." title="jwtlib" class="md-header__button md-logo" aria-label="jwtlib" data-md-component="logo">
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
|
||||
|
||||
</a>
|
||||
<label class="md-header__button md-icon" for="__drawer">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
|
||||
</label>
|
||||
<div class="md-header__title" data-md-component="header-title">
|
||||
<div class="md-header__ellipsis">
|
||||
<div class="md-header__topic">
|
||||
<span class="md-ellipsis">
|
||||
jwtlib
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-header__topic" data-md-component="header-topic">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Mongo
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<form class="md-header__option" data-md-component="palette">
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan" aria-hidden="true" type="radio" name="__palette" id="__palette_0">
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-header__button md-icon" for="__search">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
|
||||
</label>
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
||||
<label class="md-search__icon md-icon" for="__search">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
|
||||
</label>
|
||||
<nav class="md-search__options" aria-label="Search">
|
||||
|
||||
<a href="javascript:void(0)" class="md-search__icon md-icon" title="Share" aria-label="Share" data-clipboard data-clipboard-text="" data-md-component="search-share" tabindex="-1">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"/></svg>
|
||||
</a>
|
||||
|
||||
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<div class="md-search__suggest" data-md-component="search-suggest"></div>
|
||||
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="search-result">
|
||||
<div class="md-search-result__meta">
|
||||
Initializing search
|
||||
</div>
|
||||
<ol class="md-search-result__list" role="presentation"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="md-container" data-md-component="container">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main" data-md-component="main">
|
||||
<div class="md-main__inner md-grid">
|
||||
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||||
<label class="md-nav__title" for="__drawer">
|
||||
<a href="../../.." title="jwtlib" class="md-nav__button md-logo" aria-label="jwtlib" data-md-component="logo">
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
|
||||
|
||||
</a>
|
||||
jwtlib
|
||||
</label>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../.." class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Home
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
|
||||
|
||||
|
||||
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Authentication Logic
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_2">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Authentication Logic
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../app/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
App
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../introspection/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Introspection
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
|
||||
|
||||
|
||||
<div class="md-nav__link md-nav__container">
|
||||
<a href="../../../models/" class="md-nav__link ">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Data & Models
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
<label class="md-nav__link " for="__nav_3" id="__nav_3_label" tabindex="">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_3">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Data & Models
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../models/app/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
App
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../models/security/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Security
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../models/common/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Common
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
|
||||
|
||||
|
||||
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Persistence & Security
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_4">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Persistence & Security
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../repository/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Repository
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../models/mongo/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Mongo
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../security/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Security
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
|
||||
|
||||
|
||||
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Support & Utilities
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_5">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Support & Utilities
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../utils/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Utils
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../exceptions/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Exceptions
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Table of contents
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#jwtlib.models.mongo" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
mongo
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="mongo">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#jwtlib.models.mongo--summary" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Summary
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#jwtlib.models.mongo-classes" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Classes
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Classes">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#jwtlib.models.mongo.User" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
User
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="md-content" data-md-component="content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 id="mongo">Mongo</h1>
|
||||
|
||||
|
||||
<div class="doc doc-object doc-module">
|
||||
|
||||
|
||||
|
||||
<h2 id="jwtlib.models.mongo" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">jwtlib.models.mongo</span>
|
||||
|
||||
|
||||
</h2>
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Persistence-layer user model for MongoDB.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models.mongo--summary">Summary</h4>
|
||||
<p>This module defines the internal database representation of a user.
|
||||
It is used exclusively by the repository and persistence layers and
|
||||
must never be exposed directly to consumers.</p>
|
||||
<p>Public-facing user data is provided via dedicated projection models.</p>
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-children">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="jwtlib.models.mongo-classes">Classes</h3>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
<h4 id="jwtlib.models.mongo.User" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">User</span>
|
||||
|
||||
|
||||
</h4>
|
||||
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
<p class="doc doc-class-bases">
|
||||
Bases: <code><span title="mongo_ops.BaseDocument">BaseDocument</span></code>, <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.ActiveStateMixin" href="../../../models/common/#jwtlib.models.common.ActiveStateMixin">ActiveStateMixin</a></code></p>
|
||||
|
||||
|
||||
<p>Internal user persistence model.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Attributes:</span></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td><code><span title="jwtlib.models.mongo.User.hashed_password">hashed_password</span></code></td>
|
||||
<td>
|
||||
<code>str</code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>Secure hash of the user's password.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<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.
|
||||
</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.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-children">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
|
||||
|
||||
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
|
||||
|
||||
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
|
||||
</div>
|
||||
|
||||
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
|
||||
Back to top
|
||||
</button>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-copyright">
|
||||
|
||||
|
||||
Made with
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
||||
Material for MkDocs
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
<div class="md-dialog" data-md-component="dialog">
|
||||
<div class="md-dialog__inner md-typeset"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.sections", "navigation.expand", "navigation.top", "navigation.instant", "navigation.tracking", "navigation.indexes", "content.code.copy", "content.code.annotate", "content.tabs.link", "content.action.edit", "search.highlight", "search.share", "search.suggest"], "search": "../../../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
|
||||
|
||||
|
||||
<script src="../../../assets/javascripts/bundle.f55a23d4.min.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,996 +0,0 @@
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/images/favicon.png">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.23">
|
||||
|
||||
|
||||
|
||||
<title>Security - jwtlib</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../assets/stylesheets/main.84d31ad4.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../assets/stylesheets/palette.06af60db.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i%7CJetBrains+Mono:400,400i,700,700i&display=fallback">
|
||||
<style>:root{--md-text-font:"Inter";--md-code-font:"JetBrains Mono"}</style>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../assets/_mkdocstrings.css">
|
||||
|
||||
<script>__md_scope=new URL("../../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan">
|
||||
|
||||
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" for="__drawer"></label>
|
||||
<div data-md-component="skip">
|
||||
|
||||
|
||||
<a href="#security" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div data-md-component="announce">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<header class="md-header md-header--shadow" data-md-component="header">
|
||||
<nav class="md-header__inner md-grid" aria-label="Header">
|
||||
<a href="../../.." title="jwtlib" class="md-header__button md-logo" aria-label="jwtlib" data-md-component="logo">
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
|
||||
|
||||
</a>
|
||||
<label class="md-header__button md-icon" for="__drawer">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
|
||||
</label>
|
||||
<div class="md-header__title" data-md-component="header-title">
|
||||
<div class="md-header__ellipsis">
|
||||
<div class="md-header__topic">
|
||||
<span class="md-ellipsis">
|
||||
jwtlib
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-header__topic" data-md-component="header-topic">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Security
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<form class="md-header__option" data-md-component="palette">
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan" aria-hidden="true" type="radio" name="__palette" id="__palette_0">
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-header__button md-icon" for="__search">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
|
||||
</label>
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
||||
<label class="md-search__icon md-icon" for="__search">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
|
||||
</label>
|
||||
<nav class="md-search__options" aria-label="Search">
|
||||
|
||||
<a href="javascript:void(0)" class="md-search__icon md-icon" title="Share" aria-label="Share" data-clipboard data-clipboard-text="" data-md-component="search-share" tabindex="-1">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"/></svg>
|
||||
</a>
|
||||
|
||||
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<div class="md-search__suggest" data-md-component="search-suggest"></div>
|
||||
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="search-result">
|
||||
<div class="md-search-result__meta">
|
||||
Initializing search
|
||||
</div>
|
||||
<ol class="md-search-result__list" role="presentation"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="md-container" data-md-component="container">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main" data-md-component="main">
|
||||
<div class="md-main__inner md-grid">
|
||||
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||||
<label class="md-nav__title" for="__drawer">
|
||||
<a href="../../.." title="jwtlib" class="md-nav__button md-logo" aria-label="jwtlib" data-md-component="logo">
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
|
||||
|
||||
</a>
|
||||
jwtlib
|
||||
</label>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../.." class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Home
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
|
||||
|
||||
|
||||
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Authentication Logic
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_2">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Authentication Logic
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../app/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
App
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../introspection/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Introspection
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
|
||||
|
||||
|
||||
<div class="md-nav__link md-nav__container">
|
||||
<a href="../../../models/" class="md-nav__link ">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Data & Models
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
<label class="md-nav__link " for="__nav_3" id="__nav_3_label" tabindex="">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_3">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Data & Models
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../models/app/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
App
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../models/security/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Security
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../models/common/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Common
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
|
||||
|
||||
|
||||
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Persistence & Security
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_4">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Persistence & Security
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../repository/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Repository
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../models/mongo/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Mongo
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../security/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Security
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
|
||||
|
||||
|
||||
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Support & Utilities
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_5">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Support & Utilities
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../utils/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Utils
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../../exceptions/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
Exceptions
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
Table of contents
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#jwtlib.models.security" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
security
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="security">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#jwtlib.models.security--summary" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Summary
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#jwtlib.models.security-classes" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Classes
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Classes">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#jwtlib.models.security.TokenPayload" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
TokenPayload
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="md-content" data-md-component="content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 id="security">Security</h1>
|
||||
|
||||
|
||||
<div class="doc doc-object doc-module">
|
||||
|
||||
|
||||
|
||||
<h2 id="jwtlib.models.security" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">jwtlib.models.security</span>
|
||||
|
||||
|
||||
</h2>
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>JWT token payload models.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models.security--summary">Summary</h4>
|
||||
<p>This module defines typed representations of decoded JWT payloads used
|
||||
internally for token validation and user resolution.</p>
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-children">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="jwtlib.models.security-classes">Classes</h3>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
<h4 id="jwtlib.models.security.TokenPayload" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">TokenPayload</span>
|
||||
|
||||
|
||||
</h4>
|
||||
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
<p class="doc doc-class-bases">
|
||||
Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p>
|
||||
|
||||
|
||||
<p>Decoded JWT payload.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Attributes:</span></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td><code><span title="jwtlib.models.security.TokenPayload.sub">sub</span></code></td>
|
||||
<td>
|
||||
<code>str</code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>Subject claim identifying the user (typically a username or user ID).</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="doc-section-item">
|
||||
<td><code><span title="jwtlib.models.security.TokenPayload.exp">exp</span></code></td>
|
||||
<td>
|
||||
<code>int</code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>Expiration time as a Unix timestamp (seconds since epoch).</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<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.
|
||||
</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.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-children">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
|
||||
|
||||
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
|
||||
|
||||
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
|
||||
</div>
|
||||
|
||||
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
|
||||
Back to top
|
||||
</button>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-copyright">
|
||||
|
||||
|
||||
Made with
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
||||
Material for MkDocs
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
<div class="md-dialog" data-md-component="dialog">
|
||||
<div class="md-dialog__inner md-typeset"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.sections", "navigation.expand", "navigation.top", "navigation.instant", "navigation.tracking", "navigation.indexes", "content.code.copy", "content.code.annotate", "content.tabs.link", "content.action.edit", "search.highlight", "search.share", "search.suggest"], "search": "../../../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
|
||||
|
||||
|
||||
<script src="../../../assets/javascripts/bundle.f55a23d4.min.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1022,9 +1022,8 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Authentication request and response models.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models.app--summary">Summary</h4>
|
||||
<h3 id="jwtlib.models.app--summary">Summary</h3>
|
||||
<p>Authentication request and response models.</p>
|
||||
<p>This module defines all <strong>typed data models</strong> used by the authentication
|
||||
library for user registration, login, logout, and token introspection.</p>
|
||||
|
||||
@@ -1034,18 +1033,18 @@ library for user registration, login, logout, and token introspection.</p>
|
||||
<p><strong>Model Categories:</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>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Request payloads used by authentication workflows
|
||||
- Public response models exposed to consumers
|
||||
- Introspection responses used for service-to-service authentication
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Request payloads used by authentication workflows.
|
||||
- Public response models exposed to consumers.
|
||||
- Introspection responses used for service-to-service authentication.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p><strong>Design Principles:</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>
|
||||
<span class="normal">3</span>
|
||||
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Fully typed (Pydantic v2)
|
||||
- Serialization-safe
|
||||
- Framework-agnostic
|
||||
- Suitable for both internal logic and external adapters
|
||||
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Fully typed (Pydantic v2).
|
||||
- Serialization-safe.
|
||||
- Framework-agnostic.
|
||||
- Suitable for both internal logic and external adapters.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -1095,7 +1094,7 @@ library for user registration, login, logout, and token introspection.</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>
|
||||
@@ -1214,7 +1213,7 @@ library for user registration, login, logout, and token introspection.</p>
|
||||
Bases: <code><a class="autorefs autorefs-internal" title="jwtlib.models.common.IdentityMixin" href="../common/#jwtlib.models.common.IdentityMixin">IdentityMixin</a></code>, <code><a class="autorefs autorefs-internal" title="jwtlib.models.common.PasswordMixin" href="../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>
|
||||
@@ -1309,7 +1308,7 @@ library for user registration, login, logout, and token introspection.</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>
|
||||
|
||||
@@ -950,9 +950,8 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Common Pydantic mixins for authentication models.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models.common--summary">Summary</h4>
|
||||
<h3 id="jwtlib.models.common--summary">Summary</h3>
|
||||
<p>Common Pydantic mixins for authentication models.</p>
|
||||
<p>This module provides reusable mixins for identity, password, and
|
||||
account state. These mixes ensure consistency across internal
|
||||
persistence models and public-facing projection models.</p>
|
||||
@@ -1004,7 +1003,8 @@ persistence models and public-facing projection models.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>Indicates whether the account is active and allowed to authenticate.</p>
|
||||
<p>Indicates whether the account is active and allowed to
|
||||
authenticate.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -923,51 +923,57 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>jwtlib Models: Structured Data for Authentication.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models--summary">Summary</h4>
|
||||
<h3 id="jwtlib.models--summary">Summary</h3>
|
||||
<p><code>jwtlib</code> Models: Structured Data for Authentication.</p>
|
||||
<p>This package defines the core data models used by <code>jwtlib</code>. These models are
|
||||
categorized into request payloads, response objects, persistence documents,
|
||||
and security context.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models--model-categories">Model Categories</h4>
|
||||
<p><strong>API Requests:</strong>
|
||||
- <code>RegisterRequest</code>: Payload for creating new user accounts.
|
||||
- <code>LoginRequest</code>: User credentials for issuing JWTs.
|
||||
- <code>IntrospectRequest</code>: Internal payload for service-to-service token verification.</p>
|
||||
<p><strong>API Responses:</strong>
|
||||
- <code>PublicUser</code>: A safe, non-sensitive projection of a user profile.
|
||||
- <code>LoginResponse</code>: Contains the issued access token and the PublicUser.
|
||||
- <code>LogoutResponse</code>: Instruction for clients to clear stateless session state.</p>
|
||||
<p><strong>Internal & Security:</strong>
|
||||
- <code>User</code>: The MongoDB-backed persistence model (Confined to repository layer).
|
||||
- <code>TokenPayload</code>: Decoded claims from a validated JWT (sub, exp).
|
||||
- <code>IntrospectResponse</code>: Structured result of a token validity check.</p>
|
||||
<h3 id="jwtlib.models--model-categories">Model Categories</h3>
|
||||
<p><strong>API Requests:</strong></p>
|
||||
<ul>
|
||||
<li><code>RegisterRequest</code>: Payload for creating new user accounts.</li>
|
||||
<li><code>LoginRequest</code>: User credentials for issuing <code>JWT</code>s.</li>
|
||||
<li><code>IntrospectRequest</code>: Internal payload for service-to-service token
|
||||
verification.</li>
|
||||
</ul>
|
||||
<p><strong>API Responses:</strong></p>
|
||||
<ul>
|
||||
<li><code>PublicUser</code>: A safe, non-sensitive projection of a user profile.</li>
|
||||
<li><code>LoginResponse</code>: Contains the issued access token and the <code>PublicUser</code>.</li>
|
||||
<li><code>LogoutResponse</code>: Instruction for clients to clear stateless session state.</li>
|
||||
</ul>
|
||||
<p><strong>Internal & Security:</strong></p>
|
||||
<ul>
|
||||
<li><code>User</code>: The MongoDB-backed persistence model (Confined to repository layer).</li>
|
||||
<li><code>TokenPayload</code>: Decoded claims from a validated <code>JWT</code> (<code>sub</code>, <code>exp</code>).</li>
|
||||
<li><code>IntrospectResponse</code>: Structured result of a token validity check.</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models--usage">Usage</h4>
|
||||
<h3 id="jwtlib.models--usage">Usage</h3>
|
||||
<p><strong>Validating an Auth Request:</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>from jwtlib.models import LoginRequest
|
||||
auth_data = LoginRequest(username="tester", password="secure_password")
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<div class="language-python 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>
|
||||
<span class="normal"><a href="#__codelineno-0-2">2</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><span class="kn">from</span><span class="w"> </span><span class="nn">jwtlib.models</span><span class="w"> </span><span class="kn">import</span> <span class="n">LoginRequest</span>
|
||||
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a><span class="n">auth_data</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">"tester"</span><span class="p">,</span> <span class="n">password</span><span class="o">=</span><span class="s2">"secure_password"</span><span class="p">)</span>
|
||||
</span></code></pre></div></td></tr></table></div>
|
||||
<p><strong>Projecting a User to Public View:</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>from jwtlib.models import User, PublicUser
|
||||
user_profile = PublicUser.model_validate(db_user, from_attributes=True)
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<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></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">from</span><span class="w"> </span><span class="nn">jwtlib.models</span><span class="w"> </span><span class="kn">import</span> <span class="n">User</span><span class="p">,</span> <span class="n">PublicUser</span>
|
||||
</span><span id="__span-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2"></a><span class="n">user_profile</span> <span class="o">=</span> <span class="n">PublicUser</span><span class="o">.</span><span class="n">model_validate</span><span class="p">(</span><span class="n">db_user</span><span class="p">,</span> <span class="n">from_attributes</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
</span></code></pre></div></td></tr></table></div>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models--public-api">Public API</h4>
|
||||
<h3 id="jwtlib.models--public-api">Public API</h3>
|
||||
<p>This package re-exports all <strong>validated data models</strong> required by the
|
||||
authentication system. Consumers should import from this namespace
|
||||
to ensure type safety and consistency.</p>
|
||||
<ul>
|
||||
<li>LoginRequest / LoginResponse</li>
|
||||
<li>RegisterRequest</li>
|
||||
<li>LogoutResponse</li>
|
||||
<li>PublicUser</li>
|
||||
<li>IntrospectRequest / IntrospectResponse</li>
|
||||
<li>User (Persistence)</li>
|
||||
<li>TokenPayload (JWT)</li>
|
||||
<li><code>LoginRequest</code> / <code>LoginResponse</code></li>
|
||||
<li><code>RegisterRequest</code></li>
|
||||
<li><code>LogoutResponse</code></li>
|
||||
<li><code>PublicUser</code></li>
|
||||
<li><code>IntrospectRequest</code> / <code>IntrospectResponse</code></li>
|
||||
<li><code>User</code> (Persistence)</li>
|
||||
<li><code>TokenPayload</code> (<code>JWT</code>)</li>
|
||||
</ul>
|
||||
<hr />
|
||||
|
||||
@@ -1018,7 +1024,7 @@ to ensure type safety and consistency.</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>
|
||||
@@ -1137,7 +1143,7 @@ to ensure type safety and consistency.</p>
|
||||
Bases: <code><a class="autorefs autorefs-internal" title="jwtlib.models.common.IdentityMixin" href="common/#jwtlib.models.common.IdentityMixin">IdentityMixin</a></code>, <code><a class="autorefs autorefs-internal" title="jwtlib.models.common.PasswordMixin" href="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>
|
||||
@@ -1232,7 +1238,7 @@ to ensure type safety and consistency.</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>
|
||||
@@ -1523,7 +1529,7 @@ to ensure type safety and consistency.</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>
|
||||
@@ -1565,10 +1571,18 @@ to ensure type safety and consistency.</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>
|
||||
|
||||
@@ -1639,10 +1653,18 @@ to ensure type safety and consistency.</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>
|
||||
|
||||
|
||||
@@ -914,9 +914,8 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Persistence-layer user model for MongoDB.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models.mongo--summary">Summary</h4>
|
||||
<h3 id="jwtlib.models.mongo--summary">Summary</h3>
|
||||
<p>Persistence-layer user model for MongoDB.</p>
|
||||
<p>This module defines the internal database representation of a user.
|
||||
It is used exclusively by the repository and persistence layers and
|
||||
must never be exposed directly to consumers.</p>
|
||||
@@ -980,10 +979,18 @@ must never be exposed directly to consumers.</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>
|
||||
|
||||
|
||||
@@ -914,10 +914,9 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>JWT token payload models.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.models.security--summary">Summary</h4>
|
||||
<p>This module defines typed representations of decoded JWT payloads used
|
||||
<h3 id="jwtlib.models.security--summary">Summary</h3>
|
||||
<p>JWT token payload models.</p>
|
||||
<p>This module defines typed representations of decoded <code>JWT</code> payloads used
|
||||
internally for token validation and user resolution.</p>
|
||||
|
||||
|
||||
@@ -947,7 +946,7 @@ internally for token validation and user resolution.</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>
|
||||
@@ -989,10 +988,18 @@ internally for token validation and user resolution.</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>
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1064,9 +1064,8 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>UserRepository: Persistence layer for authentication.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.repository--summary">Summary</h4>
|
||||
<h3 id="jwtlib.repository--summary">Summary</h3>
|
||||
<p>UserRepository: Persistence layer for authentication.</p>
|
||||
<p>This module defines the MongoDB-backed repository for managing user records,
|
||||
including creation, lookup, and credential verification.</p>
|
||||
|
||||
@@ -1098,15 +1097,15 @@ including creation, lookup, and credential verification.</p>
|
||||
Bases: <code><span title="mongo_ops.BaseRepository">BaseRepository</span>[<a class="autorefs autorefs-internal" title="jwtlib.models.User" href="../models/#jwtlib.models.User">User</a>]</code></p>
|
||||
|
||||
|
||||
<p>MongoDB-backed repository for User documents.</p>
|
||||
<p>MongoDB-backed repository for <code>User</code> documents.</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>
|
||||
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Managing user persistence (CRUD)
|
||||
- Credential verification and token issuance
|
||||
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Manage user persistence (CRUD).
|
||||
- Handle credential verification and token issuance.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -986,11 +986,10 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Security utilities: Password hashing and JWT management.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.security--summary">Summary</h4>
|
||||
<h3 id="jwtlib.security--summary">Summary</h3>
|
||||
<p>Security utilities: Password hashing and <code>JWT</code> management.</p>
|
||||
<p>This module provides low-level cryptographic helpers for password
|
||||
hashing and JWT token lifecycle management. It serves as the
|
||||
hashing and <code>JWT</code> token lifecycle management. It serves as the
|
||||
cryptographic engine for the authentication library.</p>
|
||||
|
||||
|
||||
@@ -1018,7 +1017,7 @@ cryptographic engine for the authentication library.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Generate a new JWT access token.</p>
|
||||
<p>Generate a new <code>JWT</code> access token.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
@@ -1079,7 +1078,7 @@ cryptographic engine for the authentication library.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>An encoded JWT string.</p>
|
||||
<p>An encoded <code>JWT</code> string.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1103,7 +1102,7 @@ cryptographic engine for the authentication library.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Decode and validate a JWT, returning a strongly-typed payload.</p>
|
||||
<p>Decode and validate a <code>JWT</code>, returning a strongly-typed payload.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
@@ -1124,7 +1123,7 @@ cryptographic engine for the authentication library.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>The JWT string to decode.</p>
|
||||
<p>The <code>JWT</code> string to decode.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Binary file not shown.
@@ -968,10 +968,9 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Auth Utilities: Token validation and user resolution.</p>
|
||||
<hr />
|
||||
<h4 id="jwtlib.utils--summary">Summary</h4>
|
||||
<p>This module provides high-level helpers for validating JWT payloads and
|
||||
<h3 id="jwtlib.utils--summary">Summary</h3>
|
||||
<p>Auth Utilities: Token validation and user resolution.</p>
|
||||
<p>This module provides high-level helpers for validating <code>JWT</code> payloads and
|
||||
resolving users, intended for use in dependency injection or middleware.</p>
|
||||
|
||||
|
||||
@@ -1024,7 +1023,7 @@ resolving users, intended for use in dependency injection or middleware.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>The JWT string to validate.</p>
|
||||
<p>The <code>JWT</code> string to validate.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -1034,7 +1033,7 @@ resolving users, intended for use in dependency injection or middleware.</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">
|
||||
@@ -1083,7 +1082,7 @@ resolving users, intended for use in dependency injection or middleware.</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">
|
||||
@@ -1093,11 +1092,12 @@ resolving users, intended for use in dependency injection or middleware.</p>
|
||||
</tr>
|
||||
<tr class="doc-section-item">
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.UserNotFound" href="../jwtlib/exceptions/#jwtlib.exceptions.UserNotFound">UserNotFound</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="jwtlib.exceptions.UserNotFound" href="../exceptions/#jwtlib.exceptions.UserNotFound">UserNotFound</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>If the token is valid, but the user does not exist in the repository.</p>
|
||||
<p>If the token is valid, but the user does not exist in the
|
||||
repository.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1121,7 +1121,7 @@ resolving users, intended for use in dependency injection or middleware.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Return a singleton or new instance of the UserRepository.</p>
|
||||
<p>Return a singleton or new instance of the <code>UserRepository</code>.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
@@ -1135,7 +1135,7 @@ resolving users, intended for use in dependency injection or middleware.</p>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>UserRepository</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">
|
||||
@@ -1163,7 +1163,7 @@ resolving users, intended for use in dependency injection or middleware.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Validate a JWT and return a typed payload.</p>
|
||||
<p>Validate a <code>JWT</code> and return a typed payload.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
@@ -1184,7 +1184,7 @@ resolving users, intended for use in dependency injection or middleware.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>The JWT string to validate.</p>
|
||||
<p>The <code>JWT</code> string to validate.</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user