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

Talisman config #7529

Merged
merged 4 commits into from
May 17, 2019
Merged

Talisman config #7529

merged 4 commits into from
May 17, 2019

Conversation

craig-rueda
Copy link
Member

@craig-rueda craig-rueda commented May 16, 2019

CATEGORY

Choose one

  • Enhancement (new features, refinement)

SUMMARY

This PR allows you to conditionally enable Talisman. There are several features that it provides which several orgs may or may not want. Related PR: #7443

REVIEWERS

@mistercrunch

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM

@mistercrunch
Copy link
Member

mistercrunch commented May 16, 2019

@john-bodley FYI, this should be backwards compatible

# If you want Talisman, how do you want it configured??
TALISMAN_CONFIG = {
'content_security_policy': None,
'force_https': True,
Copy link
Member

@john-bodley john-bodley May 16, 2019

Choose a reason for hiding this comment

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

@craig-rueda per the Flask-Talisman documentation the force_https default is True and thus it seems we could nix this line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, that's where I got that key. Wanted it explicit here so that others will know that it might be causing trouble (as it was for me).

Copy link
Member

Choose a reason for hiding this comment

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

Personally I find it a little confusing to include only a subset of the defaults. Maybe there is merit in being more explicit in the comment to include i) a link to the documentation which lists the defaults, and ii) mentioning that this really isn't the entire configuration but rather an augmentation of the explicitly mentioned parameters.

Copy link
Member

Choose a reason for hiding this comment

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

@craig-rueda would you be able to follow up on this comment in a future PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, of course

Talisman(app, content_security_policy=None)
if app.config['TALISMAN_ENABLED']:
talisman_config = app.config.get('TALISMAN_CONFIG') or {
'content_security_policy': None,
Copy link
Member

@john-bodley john-bodley May 16, 2019

Choose a reason for hiding this comment

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

@craig-rueda any reason to have {'content_security_policy': None} as a fallback? Wouldn't one simply re-specify the options they require in their superset_config.py file if they wish to override the settings in superset/config.py?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was the setting that was there before - assumed it had a purpose

Copy link
Member

Choose a reason for hiding this comment

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

This is to match the current behavior by default (Talisman(app, content_security_policy=None))

Copy link
Member

Choose a reason for hiding this comment

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

@mistercrunch wouldn't there be merit in having the logic in superset/__init__.py be,

TALISMAN_CONFIG = {
    'content_security_policy': None,
}

to match the default behavior? In this example it seems like @craig-rueda want's to have force_https_permanent to be True which should then be overridden in the superset_config.py file.

@codecov-io
Copy link

codecov-io commented May 16, 2019

Codecov Report

Merging #7529 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #7529      +/-   ##
=========================================
+ Coverage   65.29%   65.3%   +<.01%     
=========================================
  Files         432     432              
  Lines       21384   21388       +4     
  Branches     2355    2355              
=========================================
+ Hits        13963   13967       +4     
  Misses       7301    7301              
  Partials      120     120
Impacted Files Coverage Δ
superset/config.py 93.93% <100%> (+0.07%) ⬆️
superset/__init__.py 75% <100%> (+0.37%) ⬆️

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 7f858e4...35dcb75. Read the comment docs.

@mistercrunch
Copy link
Member

Ok default was removed and someone on Slack is having similar issues, merging!

@mistercrunch mistercrunch merged commit 21a4670 into apache:master May 17, 2019
@craig-rueda craig-rueda deleted the talisman_config branch May 20, 2019 16:51
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request Jun 1, 2019
* Making Talisman configurable

* Fixing double quotes

* Fixing flake8

* Removing default

(cherry picked from commit 21a4670)
michellethomas pushed a commit that referenced this pull request Jun 1, 2019
* Making Talisman configurable

* Fixing double quotes

* Fixing flake8

* Removing default

(cherry picked from commit 21a4670)
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 28, 2024
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* Making Talisman configurable

* Fixing double quotes

* Fixing flake8

* Removing default

(cherry picked from commit ec5ad7a)
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 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants