indigo-dc / flaat

FLAsk with Access Tokens - FLAAT
MIT License
11 stars 6 forks source link

consistent status codes #49

Closed dianagudu closed 2 years ago

dianagudu commented 2 years ago

Is there any documentation on what status codes are expected in different cases? Based on my testing (maybe not comprehensive list):

401:

403:

In the first item of 403, I wonder if this should be 401?

My understanding of the http codes:

In any case, it would be nice to document this.

Originally posted by @dianagudu in https://github.com/indigo-dc/flaat/issues/47#issuecomment-1050858055

dianagudu commented 2 years ago

LE: this testing is done with fastapi.

With aio, the behaviour is as expected: https://github.com/indigo-dc/flaat/pull/47#issuecomment-1050867395

dianagudu commented 2 years ago

Seems the issue is not actually with flaat, but with fastapi: depends=Depends(HTTPBearer()) returns a 403 response when a bearer token is missing... https://github.com/tiangolo/fastapi/issues/2026#issuecomment-690217615. There is an open PR on that.