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>
|
||||
|
||||
Reference in New Issue
Block a user