etr2460 commented on a change in pull request #16367:
URL: https://github.com/apache/superset/pull/16367#discussion_r695113463
##########
File path: superset/views/base.py
##########
@@ -346,9 +347,21 @@ def common_bootstrap_payload() -> Dict[str, Any]:
messages = get_flashed_messages(with_categories=True)
locale = str(get_locale())
+ # should not expose API TOKEN to frontend
+ frontend_config = {k: conf.get(k) for k in FRONTEND_CONF_KEYS}
+ if conf.get("SLACK_API_TOKEN"):
+ frontend_config["ALERT_REPORTS_NOTIFICATION_METHODS"] = [
+ ReportRecipientType.EMAIL,
+ ReportRecipientType.SLACK,
+ ]
+ else:
+ frontend_config["ALERT_REPORTS_NOTIFICATION_METHODS"] = [
+ ReportRecipientType.EMAIL,
+ ]
Review comment:
why does this need to live in the frontend config/bootstrap data? i'm
not super familiar with the reports/alerts code, but it seems like they might
call apis on load, which would mean we could just get this configuration via an
api request instead of bundling it in the bootstrap data on every request.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]