internetarchive / internetarchive/fatcat

Better API token parse error reponse

Open
#33 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
121
Forks
18
PR merge metrics
No merged PRs in 30d

Description

I made a typo when copy/pasting an API token (removing a trailing `=` character) and the API responded with a 500 error to an auth_check call:

{"success":false,"error":"InternalError","message":"unexpected internal error: invalid length at 196"}

This should be a 400 error (not 500), and the message should indicate the actual problem.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the auth_check API entry point and reproduce the malformed-token request described here. Trace how the invalid token length error is currently converted into the 500 response. Done means malformed API tokens return HTTP 400 with a message describing the actual token problem.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.