Skip to content

Commit 57ef517

Browse files
Deployed 0b67ec8 to dev with MkDocs 1.6.1 and mike 2.1.4
1 parent 9a07e84 commit 57ef517

File tree

3 files changed

+217
-3
lines changed

3 files changed

+217
-3
lines changed

dev/configuration-and-management/token-management/index.html

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,28 @@
15151515
</span>
15161516
</a>
15171517

1518+
</li>
1519+
1520+
<li class="md-nav__item">
1521+
<a href="#ephemeral-keys" class="md-nav__link">
1522+
<span class="md-ellipsis">
1523+
1524+
Ephemeral Keys
1525+
1526+
</span>
1527+
</a>
1528+
1529+
</li>
1530+
1531+
<li class="md-nav__item">
1532+
<a href="#ephemeral-key-cleanup" class="md-nav__link">
1533+
<span class="md-ellipsis">
1534+
1535+
Ephemeral Key Cleanup
1536+
1537+
</span>
1538+
</a>
1539+
15181540
</li>
15191541

15201542
</ul>
@@ -2620,6 +2642,28 @@
26202642
</span>
26212643
</a>
26222644

2645+
</li>
2646+
2647+
<li class="md-nav__item">
2648+
<a href="#ephemeral-keys" class="md-nav__link">
2649+
<span class="md-ellipsis">
2650+
2651+
Ephemeral Keys
2652+
2653+
</span>
2654+
</a>
2655+
2656+
</li>
2657+
2658+
<li class="md-nav__item">
2659+
<a href="#ephemeral-key-cleanup" class="md-nav__link">
2660+
<span class="md-ellipsis">
2661+
2662+
Ephemeral Key Cleanup
2663+
2664+
</span>
2665+
</a>
2666+
26232667
</li>
26242668

26252669
</ul>
@@ -2831,6 +2875,78 @@ <h3 id="key-revocation">Key Revocation</h3>
28312875
<p class="admonition-title">Important</p>
28322876
<p><strong>For Platform Administrators</strong>: Admins can revoke any user's keys via <code>DELETE /v1/api-keys/:id</code> (if they own or have admin access) or <code>POST /v1/api-keys/bulk-revoke</code> with the target username. This is an effective way to immediately cut off access for a specific user in response to a security event.</p>
28332877
</div>
2878+
<h3 id="ephemeral-keys">Ephemeral Keys</h3>
2879+
<p>Ephemeral keys are short-lived credentials designed for temporary programmatic access (e.g., playground sessions). They differ from regular keys:</p>
2880+
<table>
2881+
<thead>
2882+
<tr>
2883+
<th>Property</th>
2884+
<th>Regular Key</th>
2885+
<th>Ephemeral Key</th>
2886+
</tr>
2887+
</thead>
2888+
<tbody>
2889+
<tr>
2890+
<td>Default expiration</td>
2891+
<td>Configured maximum (e.g., 90 days)</td>
2892+
<td>1 hour</td>
2893+
</tr>
2894+
<tr>
2895+
<td>Maximum expiration</td>
2896+
<td>Configured maximum</td>
2897+
<td>1 hour</td>
2898+
</tr>
2899+
<tr>
2900+
<td>Name required</td>
2901+
<td>Yes</td>
2902+
<td>No (auto-generated if omitted)</td>
2903+
</tr>
2904+
<tr>
2905+
<td>Visible in default search</td>
2906+
<td>Yes</td>
2907+
<td>No (<code>includeEphemeral: true</code> required)</td>
2908+
</tr>
2909+
</tbody>
2910+
</table>
2911+
<p>Create an ephemeral key:</p>
2912+
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>curl<span class="w"> </span>-sSk<span class="w"> </span>-X<span class="w"> </span>POST<span class="w"> </span><span class="s2">&quot;</span><span class="si">${</span><span class="nv">MAAS_API_URL</span><span class="si">}</span><span class="s2">/maas-api/v1/api-keys&quot;</span><span class="w"> </span><span class="se">\</span>
2913+
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="w"> </span>-H<span class="w"> </span><span class="s2">&quot;Authorization: Bearer </span><span class="k">$(</span>oc<span class="w"> </span>whoami<span class="w"> </span>-t<span class="k">)</span><span class="s2">&quot;</span><span class="w"> </span><span class="se">\</span>
2914+
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="w"> </span>-H<span class="w"> </span><span class="s2">&quot;Content-Type: application/json&quot;</span><span class="w"> </span><span class="se">\</span>
2915+
<a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span>-d<span class="w"> </span><span class="s1">&#39;{&quot;ephemeral&quot;: true, &quot;expiresIn&quot;: &quot;30m&quot;}&#39;</span>
2916+
</code></pre></div>
2917+
<h3 id="ephemeral-key-cleanup">Ephemeral Key Cleanup</h3>
2918+
<p>Expired ephemeral keys are automatically deleted from the database by a <strong>CronJob</strong> (<code>maas-api-key-cleanup</code>) that runs every 15 minutes. This prevents unbounded accumulation of expired short-lived credentials.</p>
2919+
<p><strong>How it works:</strong></p>
2920+
<ol>
2921+
<li>The CronJob sends <code>POST /internal/v1/api-keys/cleanup</code> to the maas-api Service</li>
2922+
<li>The endpoint deletes ephemeral keys that expired <strong>more than 30 minutes ago</strong> (grace period)</li>
2923+
<li>Regular (non-ephemeral) keys are <strong>never</strong> deleted by cleanup — they remain until manually revoked</li>
2924+
</ol>
2925+
<p><strong>Grace period:</strong> A 30-minute grace period after expiration ensures that recently-expired keys are not deleted while in-flight requests may still reference them. Only keys expired for longer than 30 minutes are removed.</p>
2926+
<p><strong>Security:</strong> The cleanup endpoint is cluster-internal only:</p>
2927+
<ul>
2928+
<li>It is registered under <code>/internal/v1/</code> and is <strong>not exposed</strong> on the external Service or Route</li>
2929+
<li>A <code>NetworkPolicy</code> (<code>maas-api-cleanup-restrict</code>) restricts cleanup pods to communicate only with <code>maas-api:8080</code> and DNS</li>
2930+
<li>No authentication is required on the endpoint itself — access control is enforced at the network layer</li>
2931+
</ul>
2932+
<div class="admonition tip">
2933+
<p class="admonition-title">Troubleshooting cleanup</p>
2934+
<p><strong>Check CronJob status:</strong>
2935+
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>oc<span class="w"> </span>get<span class="w"> </span>cronjob<span class="w"> </span>maas-api-key-cleanup<span class="w"> </span>-n<span class="w"> </span>&lt;namespace&gt;
2936+
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a>oc<span class="w"> </span>get<span class="w"> </span><span class="nb">jobs</span><span class="w"> </span>-n<span class="w"> </span>&lt;namespace&gt;<span class="w"> </span>-l<span class="w"> </span><span class="nv">app</span><span class="o">=</span>maas-api-cleanup<span class="w"> </span>--sort-by<span class="o">=</span>.metadata.creationTimestamp
2937+
</code></pre></div></p>
2938+
<p><strong>View cleanup logs:</strong>
2939+
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="c1"># Latest CronJob run</span>
2940+
<a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a>oc<span class="w"> </span>logs<span class="w"> </span>job/<span class="k">$(</span>oc<span class="w"> </span>get<span class="w"> </span><span class="nb">jobs</span><span class="w"> </span>-n<span class="w"> </span>&lt;namespace&gt;<span class="w"> </span>-l<span class="w"> </span><span class="nv">app</span><span class="o">=</span>maas-api-cleanup<span class="w"> </span><span class="se">\</span>
2941+
<a id="__codelineno-5-3" name="__codelineno-5-3" href="#__codelineno-5-3"></a><span class="w"> </span>--sort-by<span class="o">=</span>.metadata.creationTimestamp<span class="w"> </span>-o<span class="w"> </span><span class="nv">jsonpath</span><span class="o">=</span><span class="s1">&#39;{.items[-1].metadata.name}&#39;</span><span class="k">)</span><span class="w"> </span><span class="se">\</span>
2942+
<a id="__codelineno-5-4" name="__codelineno-5-4" href="#__codelineno-5-4"></a><span class="w"> </span>-n<span class="w"> </span>&lt;namespace&gt;
2943+
</code></pre></div></p>
2944+
<p><strong>Manually trigger cleanup</strong> (from an allowed pod or via oc exec):
2945+
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>oc<span class="w"> </span><span class="nb">exec</span><span class="w"> </span>deploy/maas-api<span class="w"> </span>-n<span class="w"> </span>&lt;namespace&gt;<span class="w"> </span>--<span class="w"> </span><span class="se">\</span>
2946+
<a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a><span class="w"> </span>curl<span class="w"> </span>-sf<span class="w"> </span>-X<span class="w"> </span>POST<span class="w"> </span>http://localhost:8080/internal/v1/api-keys/cleanup
2947+
</code></pre></div>
2948+
Response: <code>{"deletedCount": N, "message": "Successfully deleted N expired ephemeral key(s)"}</code></p>
2949+
</div>
28342950
<hr />
28352951
<h2 id="frequently-asked-questions-faq">Frequently Asked Questions (FAQ)</h2>
28362952
<p><strong>Q: My subscription access is wrong. How do I fix it?</strong></p>
@@ -2888,7 +3004,7 @@ <h2 id="related-documentation">Related Documentation</h2>
28883004
<span class="md-icon" title="Last update">
28893005
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg>
28903006
</span>
2891-
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="March 29, 2026 14:34:45 UTC">March 29, 2026</span>
3007+
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="March 30, 2026 16:08:31 UTC">March 30, 2026</span>
28923008
</span>
28933009

28943010

dev/reference/maas-api-overview/index.html

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,28 @@
20562056
</span>
20572057
</a>
20582058

2059+
</li>
2060+
2061+
<li class="md-nav__item">
2062+
<a href="#subscriptions" class="md-nav__link">
2063+
<span class="md-ellipsis">
2064+
2065+
Subscriptions
2066+
2067+
</span>
2068+
</a>
2069+
2070+
</li>
2071+
2072+
<li class="md-nav__item">
2073+
<a href="#internal-endpoints-cluster-only" class="md-nav__link">
2074+
<span class="md-ellipsis">
2075+
2076+
Internal Endpoints (Cluster-Only)
2077+
2078+
</span>
2079+
</a>
2080+
20592081
</li>
20602082

20612083
</ul>
@@ -2397,6 +2419,28 @@
23972419
</span>
23982420
</a>
23992421

2422+
</li>
2423+
2424+
<li class="md-nav__item">
2425+
<a href="#subscriptions" class="md-nav__link">
2426+
<span class="md-ellipsis">
2427+
2428+
Subscriptions
2429+
2430+
</span>
2431+
</a>
2432+
2433+
</li>
2434+
2435+
<li class="md-nav__item">
2436+
<a href="#internal-endpoints-cluster-only" class="md-nav__link">
2437+
<span class="md-ellipsis">
2438+
2439+
Internal Endpoints (Cluster-Only)
2440+
2441+
</span>
2442+
</a>
2443+
24002444
</li>
24012445

24022446
</ul>
@@ -2548,6 +2592,60 @@ <h3 id="api-keys">API Keys</h3>
25482592
</tr>
25492593
</tbody>
25502594
</table>
2595+
<h3 id="subscriptions">Subscriptions</h3>
2596+
<table>
2597+
<thead>
2598+
<tr>
2599+
<th>Method</th>
2600+
<th>Path</th>
2601+
<th>Description</th>
2602+
</tr>
2603+
</thead>
2604+
<tbody>
2605+
<tr>
2606+
<td>GET</td>
2607+
<td><code>/v1/subscriptions</code></td>
2608+
<td>List subscriptions accessible to the authenticated user.</td>
2609+
</tr>
2610+
<tr>
2611+
<td>GET</td>
2612+
<td><code>/v1/model/{model-id}/subscriptions</code></td>
2613+
<td>List subscriptions that provide access to a specific model.</td>
2614+
</tr>
2615+
</tbody>
2616+
</table>
2617+
<h3 id="internal-endpoints-cluster-only">Internal Endpoints (Cluster-Only)</h3>
2618+
<p>These endpoints are registered under <code>/internal/v1/</code> and are <strong>not exposed</strong> on the external Service or Route. They are called by internal components (Authorino, CronJob) and protected by NetworkPolicy.</p>
2619+
<table>
2620+
<thead>
2621+
<tr>
2622+
<th>Method</th>
2623+
<th>Path</th>
2624+
<th>Called By</th>
2625+
<th>Description</th>
2626+
</tr>
2627+
</thead>
2628+
<tbody>
2629+
<tr>
2630+
<td>POST</td>
2631+
<td><code>/internal/v1/api-keys/validate</code></td>
2632+
<td>Authorino</td>
2633+
<td>Validate an API key (hash lookup, status/expiry check). Returns user identity and subscription for the gateway.</td>
2634+
</tr>
2635+
<tr>
2636+
<td>POST</td>
2637+
<td><code>/internal/v1/api-keys/cleanup</code></td>
2638+
<td>CronJob <code>maas-api-key-cleanup</code></td>
2639+
<td>Delete expired ephemeral keys (30-minute grace period). Returns <code>{"deletedCount": N, "message": "..."}</code>.</td>
2640+
</tr>
2641+
<tr>
2642+
<td>POST</td>
2643+
<td><code>/internal/v1/subscriptions/select</code></td>
2644+
<td>Authorino</td>
2645+
<td>Select the appropriate subscription for a request based on user groups and optional explicit selection.</td>
2646+
</tr>
2647+
</tbody>
2648+
</table>
25512649
<hr />
25522650
<h2 id="base-url">Base URL</h2>
25532651
<p>The MaaS API is typically exposed under a path prefix, for example:</p>
@@ -2585,7 +2683,7 @@ <h2 id="next-steps">Next Steps</h2>
25852683
<span class="md-icon" title="Last update">
25862684
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg>
25872685
</span>
2588-
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="March 25, 2026 18:05:47 UTC">March 25, 2026</span>
2686+
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="March 30, 2026 16:08:31 UTC">March 30, 2026</span>
25892687
</span>
25902688

25912689

dev/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)