Repository navigation
Bound unauthenticated SSO work: JWKS refreshes and pending logins - #26
Open
Deep-Sixed wants to merge 1 commit into
Open
Deep-Sixed wants to merge 1 commit into
Deep-Sixed wants to merge 1 commit into
Conversation
AdminSSO._key_for refetched JWKS whenever a token's kid was unknown, with no rate limit, and admin_gate validates any bearer before any other check — so each request carrying a made-up kid cost one outbound fetch to Authentik. It now uses the same 10 s minimum refresh interval as AuthentikVerifier. /admin/login/start stored a pending row per call and nothing swept on insert, so a request loop grew memory or the state file for the whole login TTL. put_pending now sweeps expired rows and caps the table at MAX_PENDING, evicting the soonest-expiring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lj4neZ1qzw7tpiCJ8oedxJ
Owner
Author
|
The fix is at the source: #24's single commit was amended to use Generated by Claude Code |
Deep-Sixed
marked this pull request as ready for review
October 11, 2026 00:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AdminSSO._key_forrefetched Authentik's JWKS whenever a token'skidwas unknown, with no rate limit.admin_gatevalidates any three-part bearer before any other check. Result: every unauthenticated/admin/*request carrying a made-upkidcost one outbound fetch to Authentik.AuthentikVerifieralready has a 10 s limiter for this case;AdminSSOdid not./admin/login/startcall stores a pending row that lives for the 10-minute login TTL, and nothing swept or capped on insert. A request loop could grow memory, or the SQLite state file, without bound.Change
AdminSSO._key_foruses the same 10 s minimum refresh interval asAuthentikVerifier.put_pending, in both the in-memory and SQLite stores, now sweeps expired rows and caps the table atMAX_PENDING(10,000).Tests
kidrequests and asserts 1 JWKS fetch.main.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lj4neZ1qzw7tpiCJ8oedxJ
Generated by Claude Code