chore: collect auth-server wiki and lib refresh
Picks up the rewritten auth-server wiki (platform anatomy theme) and the regenerated lib artifacts, including the new pep-typed marker bounce.
This commit is contained in:
@@ -456,7 +456,7 @@
|
||||
<li class="md-nav__item">
|
||||
<a href="#path-1-jwtlib-client-py-jwt" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Path 1: jwtlib client (py-jwt)
|
||||
🧩 Path 1: jwtlib client (py-jwt)
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -465,7 +465,7 @@
|
||||
<li class="md-nav__item">
|
||||
<a href="#path-2-openapi-first-generated-dependencies" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Path 2: openapi-first generated dependencies
|
||||
🛠️ Path 2: openapi-first generated dependencies
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -474,7 +474,7 @@
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-introspect-contract" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
The /introspect contract
|
||||
📋 The /introspect contract
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -483,7 +483,7 @@
|
||||
<li class="md-nav__item">
|
||||
<a href="#protecting-endpoints-in-fastapi" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Protecting endpoints in FastAPI
|
||||
🐍 Protecting endpoints in FastAPI
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -492,7 +492,16 @@
|
||||
<li class="md-nav__item">
|
||||
<a href="#golden-rules" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Golden rules
|
||||
⚠️ Golden rules
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#read-next" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
📚 Read Next
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -566,10 +575,11 @@
|
||||
|
||||
|
||||
|
||||
<h1 id="platform-integration">Platform Integration</h1>
|
||||
<h1 id="platform-integration">🔌 Platform Integration</h1>
|
||||
<p>This page is for <strong>service authors</strong> wiring authentication into Aetos
|
||||
applications. It covers both supported integration paths.</p>
|
||||
<h2 id="path-1-jwtlib-client-py-jwt">Path 1: <code>jwtlib</code> client (<code>py-jwt</code>)</h2>
|
||||
<hr />
|
||||
<h2 id="path-1-jwtlib-client-py-jwt">🧩 Path 1: <code>jwtlib</code> client (<code>py-jwt</code>)</h2>
|
||||
<p>Services that depend on the <code>py-jwt</code> library can authenticate requests
|
||||
without an OpenAPI generator. Set the auth server base URL:</p>
|
||||
<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><span class="nb">export</span><span class="w"> </span><span class="nv">JWT_SERVER</span><span class="o">=</span>http://auth.aetoskia.com
|
||||
@@ -598,7 +608,8 @@ without an OpenAPI generator. Set the auth server base URL:</p>
|
||||
<p>For zero-request validation (offline token decode), <code>jwtlib</code> also exposes the
|
||||
token payload helpers used by the auth server itself — see the
|
||||
<code>py-jwt</code> documentation.</p>
|
||||
<h2 id="path-2-openapi-first-generated-dependencies">Path 2: <code>openapi-first</code> generated dependencies</h2>
|
||||
<hr />
|
||||
<h2 id="path-2-openapi-first-generated-dependencies">🛠️ Path 2: <code>openapi-first</code> generated dependencies</h2>
|
||||
<p>Services declared with an <strong>OpenAPI-first</strong> contract can generate their
|
||||
FastAPI dependencies from the spec. Declare a bearer security scheme pointing
|
||||
at the auth server:</p>
|
||||
@@ -617,7 +628,8 @@ at the auth server:</p>
|
||||
<p>The generated dependency then POSTs <code>{"token": token}</code> to the introspection
|
||||
path and returns the user on <code>active == true</code>, raising <code>401</code> on invalid or
|
||||
inactive tokens and <code>503</code> when the auth server is unreachable.</p>
|
||||
<h2 id="the-introspect-contract">The <code>/introspect</code> contract</h2>
|
||||
<hr />
|
||||
<h2 id="the-introspect-contract">📋 The <code>/introspect</code> contract</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -647,7 +659,8 @@ inactive tokens and <code>503</code> when the auth server is unreachable.</p>
|
||||
<p>The endpoint <strong>always answers <code>200</code></strong> — validity is expressed through
|
||||
<code>active</code>. <code>IntrospectResponse</code> never raises, so the caller can act on the
|
||||
tri-state (valid / invalid / user missing) without exception handling.</p>
|
||||
<h2 id="protecting-endpoints-in-fastapi">Protecting endpoints in FastAPI</h2>
|
||||
<hr />
|
||||
<h2 id="protecting-endpoints-in-fastapi">🐍 Protecting endpoints in FastAPI</h2>
|
||||
<p>For first-party services, mount the auth router's dependency directly:</p>
|
||||
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-3-1">1</a></span>
|
||||
<span class="normal"><a href="#__codelineno-3-2">2</a></span>
|
||||
@@ -663,7 +676,8 @@ tri-state (valid / invalid / user missing) without exception handling.</p>
|
||||
</span><span id="__span-3-6"><a id="__codelineno-3-6" name="__codelineno-3-6"></a><span class="k">async</span> <span class="k">def</span><span class="w"> </span><span class="nf">profile</span><span class="p">(</span><span class="n">current_user</span><span class="p">:</span> <span class="n">PublicUser</span> <span class="o">=</span> <span class="n">Depends</span><span class="p">(</span><span class="n">get_current_user</span><span class="p">)):</span>
|
||||
</span><span id="__span-3-7"><a id="__codelineno-3-7" name="__codelineno-3-7"></a> <span class="k">return</span> <span class="n">current_user</span>
|
||||
</span></code></pre></div></td></tr></table></div>
|
||||
<h2 id="golden-rules">Golden rules</h2>
|
||||
<hr />
|
||||
<h2 id="golden-rules">⚠️ Golden rules</h2>
|
||||
<ol>
|
||||
<li><strong>Never trust an unverified token</strong> — always decode through <code>jwtlib</code> or
|
||||
introspect before handling the request.</li>
|
||||
@@ -672,6 +686,11 @@ tri-state (valid / invalid / user missing) without exception handling.</p>
|
||||
the <code>jwtlib</code> client so revocation and issuer changes stay centralized.</li>
|
||||
</ol>
|
||||
<hr />
|
||||
<h2 id="read-next">📚 Read Next</h2>
|
||||
<ul>
|
||||
<li><a href="../02_how_to_use/">How to Use</a> — the plain HTTP flow.</li>
|
||||
<li><a href="../04_deployment/">Deployment</a> — environment, Docker, and CI/CD.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user