This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 21a4670 Talisman config (#7529)
21a4670 is described below
commit 21a467094ba3e194b9799026f0706c5453a5fb1e
Author: Craig Rueda <[email protected]>
AuthorDate: Thu May 16 20:55:59 2019 -0700
Talisman config (#7529)
* Making Talisman configurable
* Fixing double quotes
* Fixing flake8
* Removing default
---
superset/__init__.py | 4 +++-
superset/config.py | 9 +++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/superset/__init__.py b/superset/__init__.py
index 47811db..6971dc9 100644
--- a/superset/__init__.py
+++ b/superset/__init__.py
@@ -230,7 +230,9 @@ def is_feature_enabled(feature):
if conf.get('ENABLE_FLASK_COMPRESS'):
Compress(app)
-Talisman(app, content_security_policy=None)
+if app.config['TALISMAN_ENABLED']:
+ talisman_config = app.config.get('TALISMAN_CONFIG')
+ Talisman(app, **talisman_config)
# Hook that provides administrators a handle on the Flask APP
# after initialization
diff --git a/superset/config.py b/superset/config.py
index d191a28..4949bf9 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -612,6 +612,15 @@ SQL_VALIDATORS_BY_ENGINE = {
'presto': 'PrestoDBSQLValidator',
}
+# Do you want Talisman enabled?
+TALISMAN_ENABLED = True
+# If you want Talisman, how do you want it configured??
+TALISMAN_CONFIG = {
+ 'content_security_policy': None,
+ 'force_https': True,
+ 'force_https_permanent': False,
+}
+
try:
if CONFIG_PATH_ENV_VAR in os.environ:
# Explicitly import config module that is not in pythonpath; useful