Skip to content

Commit

Permalink
Add 403 Forbidden to STANDARD_ERRORS
Browse files Browse the repository at this point in the history
This isn't actually an error the Eve Framework will ever raise. As far
as I could tell.

However, separation between authentication and authorization is a must
even for less complex applicatons. 403 is the most adequate response a
server can provide to client whose authentication was accepted, yet for
some reason or another the server will not comply with the request.

The Eve Framework documentation suggests the usage of 403 in, at least
two instances:

 * `abort(403)` in: https://docs.python-eve.org/en/stable/features.html#database-event-hooks
 * The actual documentation for the `STANDARD_ERRORS` config variable,
describes 403 as a supported code, in: https://docs.python-eve.org/en/stable/config.html#global-configuration
  • Loading branch information
pedro2555 committed Mar 1, 2020
1 parent 529a3ad commit 39168f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eve/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@

# codes for which we want to return a standard response which includes
# a JSON body with the status, code, and description.
STANDARD_ERRORS = [400, 401, 404, 405, 406, 409, 410, 412, 422, 428, 429]
STANDARD_ERRORS = [400, 401, 403, 404, 405, 406, 409, 410, 412, 422, 428, 429]

# field returned on GET requests so we know if we have the latest copy even if
# we access a specific version
Expand Down

0 comments on commit 39168f5

Please sign in to comment.