Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should other response than 403 be used for forbidden access due to db problem #331

Open
fmigneault opened this issue Apr 24, 2020 · 0 comments
Labels
db Issues related to database connection, migration or data models enhancement Improvements in term of performance or behaviour investigate Issue or new component that needs further exploration question
Milestone

Comments

@fmigneault
Copy link
Collaborator

Searching for HTTPForbidden in the code, we can find quite a lot of references to this error being raised in case of errors related to database access (eg: failing to fetch user groups of a user, although the user is valid an authorized).

This error code can be misleading as the user is technically allowed access to the resource in these kind of situations, but cannot do anything to address it as the problem is internal. Due to this, it would be better to return an 500 code.

On the other hand, 500 errors have been very useful to indicate that something odd happened in Magpie's implementation. Therefore, these error messages should be even further improved to explicitly indicate the kind of 500 error. Probably an additional keyword indicating "error-type" in the response content could be integrated in handlers: https://github.com/Ouranosinc/Magpie/blob/master/magpie/api/exception.py

@fmigneault fmigneault added enhancement Improvements in term of performance or behaviour question investigate Issue or new component that needs further exploration db Issues related to database connection, migration or data models labels Apr 24, 2020
@fmigneault fmigneault added this to the Backlog milestone May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db Issues related to database connection, migration or data models enhancement Improvements in term of performance or behaviour investigate Issue or new component that needs further exploration question
Projects
None yet
Development

No branches or pull requests

1 participant