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

fix: optionally return HTTP 403 instead of 401 when unauthorized #1748

Merged
merged 4 commits into from
Dec 2, 2021

Conversation

dpgaspar
Copy link
Owner

@dpgaspar dpgaspar commented Nov 30, 2021

Description

Adds a temporary flag named AUTH_STRICT_RESPONSE_CODES that enables strict (correct) authorization HTTP responses, instead of 401 sends 403 when a user is not authorized to make a request to an endpoint.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Is CRUD MVC related.
  • Is Auth, RBAC security related.
  • Changes the security db schema.
  • Introduces new feature
  • Removes existing feature

@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #1748 (de69ddd) into master (e09e629) will increase coverage by 0.02%.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1748      +/-   ##
==========================================
+ Coverage   76.76%   76.78%   +0.01%     
==========================================
  Files          56       56              
  Lines        8124     8131       +7     
==========================================
+ Hits         6236     6243       +7     
  Misses       1888     1888              
Flag Coverage Δ
python 76.78% <90.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flask_appbuilder/security/decorators.py 88.23% <90.00%> (-0.23%) ⬇️
flask_appbuilder/api/__init__.py 97.79% <0.00%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e09e629...de69ddd. Read the comment docs.

@dpgaspar dpgaspar marked this pull request as ready for review December 2, 2021 10:43
@dpgaspar dpgaspar merged commit 0706abe into master Dec 2, 2021
@dpgaspar dpgaspar deleted the fix/protect-status-codes branch December 2, 2021 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant