feat: add token introspection endpoint and token test UI (#12702)

* feat: add token introspection endpoint and token test UI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvuQ2VAhEVRfa9AiGq9

* fix: report effective superadmin rights in token introspection

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvuQ2VAhEVRfa9AiGq9

* fix: resolve guest tokens and check webhooks by path in token introspection

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjsYvuQ2VAhEVRfa9AiGq9

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-11-27 15:24:00 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 5b3a40b1a4
commit 55aec82102
9 changed files with 933 additions and 64 deletions
+6
View File
@@ -36,6 +36,12 @@ Symbols, not line numbers, are cited: they drift less.
expiry or another login changes or drops it. A session revoked server-side keeps its hint,
so until `whoami` answers that browser still renders as its own last user.
- **`tokens/impersonate`** (superadmin) returns a multi-use token and sets no cookie.
- **`GET /api/tokens/introspect`** describes the credential presenting it, never one named in
the request, and resolves it in the handler rather than through `ApiAuthed`: the route layer
would refuse a scoped token there, and a workspace-bound one resolves on no global route. Its
route verdict is `check_route_layer` (`windmill-api-auth/src/auth.rs`), the function the auth
extractor runs, plus the runnable scope of the run-by-path endpoints (`run_by_path_scope`); a
handler that checks a scope of its own and is missing there gets an over-reported "allowed".
- **`max_token_expiration_days`** caps `POST /users/tokens/create` and `tokens/impersonate`, by
shortening the stored expiration (`cap_token_expiration`), never by refusing: `wmill user
create-token` and the editor's language-server token pick a lifetime without reading the