diff options
| author | Claude Sonnet 5 <noreply@anthropic.com> | 2026-10-04 09:11:50 +0000 |
|---|---|---|
| committer | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-10-05 11:36:26 -0500 |
| commit | 76d7e68370019c28d55dfbebc0fce85e96839c8c (patch) | |
| tree | 56174c889866178e0fc7bad56ddae8f8a8dc8533 /gn_auth/errors/http/__init__.py | |
| parent | 2ebc99cf340547a7276209cf39a54caad62a1bb6 (diff) | |
| download | gn-auth-76d7e68370019c28d55dfbebc0fce85e96839c8c.tar.gz | |
fix(resources/views): don't crash on an invalid (not just missing) token
resources_authorisation()'s except _HTTPException branch only set
`resp` when err_msg["error"] == "missing_authorization", leaving it
unset for any other token-related _HTTPException -- in particular
"invalid_token", raised for a malformed or otherwise invalid bearer
token (as opposed to no Authorization header at all). `return resp`
then raised UnboundLocalError, a 500, instead of the same anonymous
public-only fallback this endpoint already gives a request with no
token.
Reproduced: POST /auth/resource/authorisation with
"Authorization: Bearer not-a-real-token" raised UnboundLocalError
before this change, and now returns the same {"public-read": ...}
shape a request with no Authorization header gets.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDDpXvZBQat9uSgDeEMJ8d
Diffstat (limited to 'gn_auth/errors/http/__init__.py')
0 files changed, 0 insertions, 0 deletions
