Fix except clause syntax in JWT verification fallback #81

Merged
TheFurya merged 1 commits from feature/fix-except-clause-syntax-in-jwt-verification into develop 2026-03-22 09:53:48 +01:00
Owner

Summary

  • ruff format stripped parentheses from except (jwt.InvalidTokenError, PyJWKClientError):, turning it into Python 2 comma syntax (except A, B:) which only catches InvalidTokenError and binds it to the name PyJWKClientError
  • PyJWKSetError (raised when JWKS returns empty keys) was never caught, causing the 500 to persist even after #80
  • Fixed by using separate except clauses that ruff won't mangle

Test plan

  • docker compose up --build and verify POST /api/v1/runs works with authentication
## Summary - `ruff format` stripped parentheses from `except (jwt.InvalidTokenError, PyJWKClientError):`, turning it into Python 2 comma syntax (`except A, B:`) which only catches `InvalidTokenError` and binds it to the name `PyJWKClientError` - `PyJWKSetError` (raised when JWKS returns empty keys) was never caught, causing the 500 to persist even after #80 - Fixed by using separate `except` clauses that ruff won't mangle ## Test plan - [ ] `docker compose up --build` and verify `POST /api/v1/runs` works with authentication
TheFurya added 1 commit 2026-03-22 09:52:47 +01:00
fix: use separate except clauses for JWT verification fallback
All checks were successful
CI / backend-tests (pull_request) Successful in 29s
CI / frontend-tests (pull_request) Successful in 29s
41a18edb4f
ruff format strips parentheses from `except (A, B):`, turning it into
Python 2 comma syntax that only catches the first exception. Use
separate except clauses so PyJWKClientError is actually caught.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TheFurya merged commit 94cc74c0fb into develop 2026-03-22 09:53:48 +01:00
TheFurya deleted branch feature/fix-except-clause-syntax-in-jwt-verification 2026-03-22 09:53:49 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pokemon/nuzlocke-tracker#81