Commit db69945
committed
HOTFIX: AuthenticationError blocks API key auth fallback (OPE-91 root cause)
_validate_jwt catches InvalidTokenError and returns None to allow the
API key path to run. But AuthenticationError (raised when Supabase API
verification also fails) was caught separately and raised HTTPException
401 immediately -- preventing _validate_api_key from ever executing.
Non-JWT tokens like ci_ API keys hit verify_jwt, fail local decode,
fall back to Supabase API call, which also fails and raises
AuthenticationError. The middleware treated this as a hard auth failure
instead of allowing the API key code path.
Fix: catch AuthenticationError and return None, same as InvalidTokenError.
This was the root cause of all MCP server 401 errors since day one.1 parent 865c1fc commit db69945
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
0 commit comments