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: Fix NoAuthorizationError in /me endpoint #19355

Merged
merged 1 commit into from
Mar 24, 2022
Merged

fix: Fix NoAuthorizationError in /me endpoint #19355

merged 1 commit into from
Mar 24, 2022

Conversation

geido
Copy link
Member

@geido geido commented Mar 24, 2022

SUMMARY

Fixes an error for which the /me endpoint was returning 500 instead of 401 when a NoAuthorizationError exception was thrown.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #19355 (5211e7a) into master (3313530) will decrease coverage by 0.18%.
The diff coverage is 80.00%.

❗ Current head 5211e7a differs from pull request most recent head b04f461. Consider uploading reports for the commit b04f461 to get more accurate results

@@            Coverage Diff             @@
##           master   #19355      +/-   ##
==========================================
- Coverage   66.65%   66.46%   -0.19%     
==========================================
  Files        1675     1675              
  Lines       64654    64658       +4     
  Branches     6503     6503              
==========================================
- Hits        43092    42974     -118     
- Misses      19876    19998     +122     
  Partials     1686     1686              
Flag Coverage Δ
hive ?
mysql 81.65% <80.00%> (-0.01%) ⬇️
postgres 81.69% <80.00%> (-0.01%) ⬇️
presto ?
python 81.74% <80.00%> (-0.38%) ⬇️
sqlite ?

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

Impacted Files Coverage Δ
superset/views/users/api.py 88.88% <80.00%> (-11.12%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-85.19%) ⬇️
superset/db_engine_specs/hive.py 70.00% <0.00%> (-15.77%) ⬇️
superset/db_engine_specs/presto.py 83.68% <0.00%> (-5.44%) ⬇️
superset/db_engine_specs/sqlite.py 91.89% <0.00%> (-5.41%) ⬇️
superset/utils/celery.py 86.20% <0.00%> (-3.45%) ⬇️
superset/connectors/sqla/utils.py 88.33% <0.00%> (-3.34%) ⬇️
superset/result_set.py 96.77% <0.00%> (-1.62%) ⬇️
superset/databases/commands/test_connection.py 98.57% <0.00%> (-1.43%) ⬇️
... and 6 more

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 3313530...b04f461. Read the comment docs.

@michael-s-molina
Copy link
Member

@geido Can we add a test to this scenario?

@geido
Copy link
Member Author

geido commented Mar 24, 2022

@geido Can we add a test to this scenario?

@michael-s-molina this is tested here already superset/tests/integration_tests/users/api_tests.py and it covers the 401 response. As for testing the NoAuthorizationError that's triggered within Flask, so I don't think we need to test that specifically.

@geido geido merged commit a2bb912 into apache:master Mar 24, 2022
villebro pushed a commit that referenced this pull request Apr 3, 2022
(cherry picked from commit a2bb912)
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 and removed 🚢 2.0.1 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels lts-v1 size/XS 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants