diff options
| author | Claude Sonnet 5 <noreply@anthropic.com> | 2026-10-04 08:41:29 +0000 |
|---|---|---|
| committer | Claude Sonnet 5 <noreply@anthropic.com> | 2026-10-04 08:41:29 +0000 |
| commit | 93beeb6a2af22c179069dbc135b437c7819e942b (patch) | |
| tree | 7c2827804eee45e40cf5b5441434402bd003bbcc /gn_auth/scripts/batch_assign_data_to_default_admin.py | |
| parent | e06c50a97b17c3d80af6ed6874531f2c79e1b785 (diff) | |
| download | gn-auth-93beeb6a2af22c179069dbc135b437c7819e942b.tar.gz | |
fix(resource_server): refresh JWKS cache when empty, not just stale
JWTBearerTokenValidator caches its JWKS key set and only refreshes it every jwt_refresh_frequency_hours (default 6). On a fresh deployment, no JWK exists until the first token is issued (keys are generated lazily in jwks.py), which can happen after the validator was already constructed with an empty key set -- every token issued before the next scheduled refresh then failed to validate, even though a usable key existed on disk by the time the token arrived. Also fixes _last_jwks_update never being updated after a refresh, which meant that once the 6-hour window first elapsed, every later token validation re-read the JWKS directory from disk instead of using the cache. Reproduced against a from-scratch instance: clear the JWKS directory, start the server, issue a token via the password grant, then use that same token immediately on another endpoint -- it was rejected with invalid_token before this change, and is accepted after it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDDpXvZBQat9uSgDeEMJ8d
Diffstat (limited to 'gn_auth/scripts/batch_assign_data_to_default_admin.py')
0 files changed, 0 insertions, 0 deletions
