This is an automated email from the ASF dual-hosted git repository. amitmiran pushed a commit to branch feat/dashboard_extra_jwt in repository https://gitbox.apache.org/repos/asf/superset.git
commit b0b576c9d53c586981e9e7f7b788b52941949529 Merge: a2261f7 38c678d Author: amitmiran137 <[email protected]> AuthorDate: Wed Mar 24 11:23:39 2021 +0200 Merge remote-tracking branch 'upstream/feat/dashboard_extra_jwt' into feat/dashboard_extra_jwt * upstream/feat/dashboard_extra_jwt: start of dashboard jwt manager # Conflicts: # superset/utils/dashboard_jwt_manager.py superset/app.py | 3 ++- superset/views/core.py | 29 +++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --cc superset/app.py index 25c0a9e,38d499f..b7bc850 --- a/superset/app.py +++ b/superset/app.py @@@ -34,13 -34,13 +34,14 @@@ from superset.extensions import cache_manager, celery_app, csrf, ++ dashboard_jwt_manager, db, feature_flag_manager, machine_auth_provider_factory, manifest_processor, migrate, results_backend_manager, -- talisman, dashboard_jwt_manager, ++ talisman, ) from superset.security import SupersetSecurityManager from superset.typing import FlaskResponse diff --cc superset/views/core.py index b681878,aa561f9..41aff97 --- a/superset/views/core.py +++ b/superset/views/core.py @@@ -84,8 -84,8 +84,11 @@@ from superset.exceptions import SupersetTemplateParamsErrorException, SupersetTimeoutException, ) --from superset.extensions import async_query_manager, cache_manager, \ -- dashboard_jwt_manager ++from superset.extensions import ( ++ async_query_manager, ++ cache_manager, ++ dashboard_jwt_manager, ++) from superset.jinja_context import get_template_processor from superset.models.core import Database, FavStar, Log from superset.models.dashboard import Dashboard @@@ -103,8 -103,8 +106,10 @@@ from superset.utils import core as util from superset.utils.async_query_manager import AsyncQueryTokenException from superset.utils.cache import etag_cache from superset.utils.core import ReservedUrlParameters --from superset.utils.dashboard_jwt_manager import DashboardJwtManager, \ -- DashboardJwtDataObject ++from superset.utils.dashboard_jwt_manager import ( ++ DashboardJwtDataObject, ++ DashboardJwtManager, ++) from superset.utils.dates import now_as_float from superset.utils.decorators import check_dashboard_access from superset.views.base import ( @@@ -1875,8 -1869,8 +1880,6 @@@ class Superset(BaseSupersetView): # py if key not in [param.value for param in utils.ReservedUrlParameters] } -- -- bootstrap_data = { "user_id": g.user.get_id(), "common": common_bootstrap_payload(), @@@ -1891,14 -1885,14 +1894,12 @@@ "superset_can_csv": superset_can_csv, "slice_can_edit": slice_can_edit, }, -- "extra_jwt": dashboard_jwt_manager -- .generate_jwt(DashboardJwtDataObject(dashboard.id, -- list( -- map( -- lambda -- datasource: datasource.id, -- dashboard.datasources)) -- )), ++ "extra_jwt": dashboard_jwt_manager.generate_jwt( ++ DashboardJwtDataObject( ++ dashboard.id, ++ list(map(lambda datasource: datasource.id, dashboard.datasources)), ++ ) ++ ), "datasources": data["datasources"], }
