Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[talisman] Enforcing HTTP for status checks (apache#8214)
Browse files Browse the repository at this point in the history
(cherry picked from commit 762edf4)
  • Loading branch information
john-bodley committed Sep 13, 2019
1 parent 50cd558 commit a7c0587
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions superset/__init__.py
Expand Up @@ -222,9 +222,11 @@ def is_feature_enabled(feature):
if conf.get("ENABLE_FLASK_COMPRESS"):
Compress(app)


talisman = Talisman()

if app.config["TALISMAN_ENABLED"]:
talisman_config = app.config.get("TALISMAN_CONFIG")
Talisman(app, **talisman_config)
talisman.init_app(app, **app.config["TALISMAN_CONFIG"])

# Hook that provides administrators a handle on the Flask APP
# after initialization
Expand Down
4 changes: 4 additions & 0 deletions superset/views/core.py
Expand Up @@ -62,6 +62,7 @@
results_backend_use_msgpack,
security_manager,
sql_lab,
talisman,
viz,
)
from superset.connectors.connector_registry import ConnectorRegistry
Expand Down Expand Up @@ -629,16 +630,19 @@ class DashboardAddView(DashboardModelView): # noqa
appbuilder.add_view_no_menu(DashboardAddView)


@talisman(force_https=False)
@app.route("/health")
def health():
return "OK"


@talisman(force_https=False)
@app.route("/healthcheck")
def healthcheck():
return "OK"


@talisman(force_https=False)
@app.route("/ping")
def ping():
return "OK"
Expand Down

0 comments on commit a7c0587

Please sign in to comment.