HHS / OPRE-OPS

ACF's OPRE OPS product. Code name Unicorn.
Other
12 stars 3 forks source link

API is using HTTP status codes 401 and 403 incorrectly #2457

Open stevtek opened 2 weeks ago

stevtek commented 2 weeks ago

I think 401 and 403 have been mixed up and we just need to swap them.

401: Unauthorized - although the HTTP status is called Unauthorized, it means Unauthenticated - not logged in (or no valid session) 403: Forbidden should be used for Authorization failures of a logged in user.

These are set in the error_handlers.py, but we'll need to change or check using of the numbers in tests and the FrontEnd.