Skip to content

fix: add exception to catch session not having JWT - #14036

Merged
hughhhh merged 9 commits into
masterfrom
hugh/no-jwt-400
Apr 11, 2021
Merged

hughhhh merged 9 commits into
masterfrom
hugh/no-jwt-400

Conversation

@hughhhh

@hughhhh hughhhh commented Apr 8, 2021

Copy link
Copy Markdown
Member

SUMMARY

Catching the following exception to return 401 instead of 500.

flask_jwt_extended.exceptions.NoAuthorizationError: Missing JWT in cookies or headers (Missing cookie "__s__"; Missing Authorization Header

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

Comment thread superset/views/base.py Resolved
@codecov

codecov Bot commented Apr 8, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #14036 (81e66d1) into master (287bc12) will increase coverage by 0.01%.
The diff coverage is 50.00%.

❗ Current head 81e66d1 differs from pull request most recent head c4eee00. Consider uploading reports for the commit c4eee00 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14036      +/-   ##
==========================================
+ Coverage   79.52%   79.54%   +0.01%     
==========================================
  Files         939      939              
  Lines       47541    47545       +4     
  Branches     5938     5938              
==========================================
+ Hits        37808    37820      +12     
+ Misses       9612     9604       -8     
  Partials      121      121              
Flag Coverage Δ
cypress 56.04% <ø> (-0.01%) ⬇️
hive 80.43% <50.00%> (-0.01%) ⬇️
mysql 80.70% <50.00%> (-0.01%) ⬇️
postgres 80.74% <50.00%> (?)
presto 80.45% <50.00%> (-0.01%) ⬇️
python 81.31% <50.00%> (+0.03%) ⬆️
sqlite 80.34% <50.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/views/base.py 76.47% <50.00%> (-0.40%) ⬇️
...set-frontend/src/dashboard/util/getDropPosition.js 90.90% <0.00%> (-1.52%) ⬇️
superset/views/base_api.py 98.28% <0.00%> (+0.42%) ⬆️
superset/db_engine_specs/postgres.py 96.77% <0.00%> (+1.07%) ⬆️
superset/sql_validators/postgres.py 100.00% <0.00%> (+50.00%) ⬆️

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 287bc12...c4eee00. Read the comment docs.

Comment thread superset/views/base.py Resolved

@suddjian suddjian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@hughhhh
hughhhh merged commit de49f0d into master Apr 11, 2021
amitmiran137 pushed a commit that referenced this pull request Apr 13, 2021
* master:
  fix: unable to apply logging format (#14074)
  refactor: Bootstrap to AntD - Slider (#13989)
  chore(spa refactor): refactoring dashboard to use api's instead of bootstrapdata (#13306)
  fix(listview): update listview feature flag (#13906)
  Add docs for configuring Docker Compose setup (#13961)
  feat: invalid password error message (Postgres) (#14038)
  fix: flacky test in test_update_dataset_item_w_override_columns (#14082)
  feat: Implement Celery SoftTimeLimit handling (#13740)
  feat: only send alert error emails to owners of the alert (#13862)
  feat: add descriptions to report emails (#13827)
  Make chart exclude itself from cross filtering (#14046)
  fix: fix bug when remove chart not  removing it's related cross filter data (#14081)
  feat(native-filters): Add default first value to select filter (#13726)
  feat: Make async query JWT cookie domain configurable (#14007)
  fix: add exception to catch session not having JWT (#14036)

# Conflicts:
#	superset-frontend/src/dashboard/actions/hydrate.js
#	superset/views/core.py
amitmiran137 pushed a commit that referenced this pull request Apr 13, 2021
* master: (53 commits)
  test: Adds tests to the UndoRedoKeyListeners component (#13919)
  chore: Adds dataMask reducer to reducerIndex (#13951)
  test: Tests audit for the Dashboard FilterBar (#13916)
  fix: unable to apply logging format (#14074)
  refactor: Bootstrap to AntD - Slider (#13989)
  chore(spa refactor): refactoring dashboard to use api's instead of bootstrapdata (#13306)
  fix(listview): update listview feature flag (#13906)
  Add docs for configuring Docker Compose setup (#13961)
  feat: invalid password error message (Postgres) (#14038)
  fix: flacky test in test_update_dataset_item_w_override_columns (#14082)
  feat: Implement Celery SoftTimeLimit handling (#13740)
  feat: only send alert error emails to owners of the alert (#13862)
  feat: add descriptions to report emails (#13827)
  Make chart exclude itself from cross filtering (#14046)
  fix: fix bug when remove chart not  removing it's related cross filter data (#14081)
  feat(native-filters): Add default first value to select filter (#13726)
  feat: Make async query JWT cookie domain configurable (#14007)
  fix: add exception to catch session not having JWT (#14036)
  Use consistent chart value (#14031)
  fix: Use superset generic db to catch external_metadata queries (#13974)
  ...
@nytai
nytai deleted the hugh/no-jwt-400 branch May 7, 2021 19:02
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 First shipped in 1.2.0 labels Mar 12, 2024
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
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 size/XS 🚢 1.2.0 First shipped in 1.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants