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(async-queries): make global async. queries cookie SameSite option configurable #21185

Conversation

rdubois
Copy link
Contributor

@rdubois rdubois commented Aug 24, 2022

This PR fixes #21183

SUMMARY

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️
We hope to see you in our Slack community too!

@rusackas
Copy link
Member

Thanks for the fix, and sorry it hasn't gotten more attention. Trying to get it routed on a path to success!

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Looks great! One minor nit, but happy to get this merged asap if you can update that type annotation!

@@ -1282,6 +1282,7 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument
GLOBAL_ASYNC_QUERIES_REDIS_STREAM_LIMIT_FIREHOSE = 1000000
GLOBAL_ASYNC_QUERIES_JWT_COOKIE_NAME = "async-token"
GLOBAL_ASYNC_QUERIES_JWT_COOKIE_SECURE = False
GLOBAL_ASYNC_QUERIES_JWT_COOKIE_SAMESITE = None # One of [None, 'None', 'Lax', 'Strict']
Copy link
Member

Choose a reason for hiding this comment

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

nit: it's generally convention to add these as type annotations:

Suggested change
GLOBAL_ASYNC_QUERIES_JWT_COOKIE_SAMESITE = None # One of [None, 'None', 'Lax', 'Strict']
GLOBAL_ASYNC_QUERIES_JWT_COOKIE_SAMESITE: Optional[Literal['None', 'Lax', 'Strict']] = None

@codecov
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Merging #21185 (58b4859) into master (eb66590) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #21185   +/-   ##
=======================================
  Coverage   67.10%   67.11%           
=======================================
  Files        1869     1869           
  Lines       71609    71612    +3     
  Branches     7822     7822           
=======================================
+ Hits        48056    48059    +3     
  Misses      21526    21526           
  Partials     2027     2027           
Flag Coverage Δ
hive 52.59% <100.00%> (+<0.01%) ⬆️
mysql 78.03% <100.00%> (+<0.01%) ⬆️
postgres 78.10% <100.00%> (+<0.01%) ⬆️
presto 52.48% <100.00%> (+<0.01%) ⬆️
python 81.34% <100.00%> (+<0.01%) ⬆️
sqlite 76.48% <100.00%> (+<0.01%) ⬆️
unit 51.49% <80.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/config.py 91.76% <100.00%> (+0.02%) ⬆️
superset/utils/async_query_manager.py 80.80% <100.00%> (+0.39%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding this option

@villebro villebro merged commit 80b3113 into apache:master Jan 16, 2023
@rdubois rdubois deleted the rdubois/fix/21183/define-samesite-for-global-async-queries-cookie branch January 16, 2023 11:34
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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 size/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to define the 'SameSite' for Global Async Query async-token cookie
4 participants