You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/01/06 13:39:33 UTC

[superset] branch 1.5 updated (a14839f4ff -> 649a0b3fc1)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a change to branch 1.5
in repository https://gitbox.apache.org/repos/asf/superset.git


    omit a14839f4ff fix: Talisman configuration (#22591)
     new bf0e98c72e fix: Talisman configuration (#22591)
     new 649a0b3fc1 chore: Merge adjustments

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (a14839f4ff)
            \
             N -- N -- N   refs/heads/1.5 (649a0b3fc1)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tests/unit_tests/conftest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[superset] 02/02: chore: Merge adjustments

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 1.5
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 649a0b3fc19c27476fca43497f02b817df52903b
Author: Michael S. Molina <mi...@gmail.com>
AuthorDate: Thu Jan 5 16:03:56 2023 -0500

    chore: Merge adjustments
---
 superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx | 2 ++
 tests/unit_tests/conftest.py                                         | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx b/superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx
index 964adc64d5..b71a13ffeb 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseList.test.jsx
@@ -82,6 +82,8 @@ const mockUser = {
   userId: 1,
 };
 
+const userSelectorMock = jest.spyOn(redux, 'useSelector');
+
 fetchMock.get(databasesInfoEndpoint, {
   permissions: ['can_write'],
 });
diff --git a/tests/unit_tests/conftest.py b/tests/unit_tests/conftest.py
index 43c4ac69ad..7676111ea0 100644
--- a/tests/unit_tests/conftest.py
+++ b/tests/unit_tests/conftest.py
@@ -88,7 +88,7 @@ def client(app: SupersetApp) -> Any:
         yield client
 
 
-@pytest.fixture
+@pytest.fixture(autouse=True)
 def app_context(app: SupersetApp) -> Iterator[None]:
     """
     A fixture that yields and application context.


[superset] 01/02: fix: Talisman configuration (#22591)

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 1.5
in repository https://gitbox.apache.org/repos/asf/superset.git

commit bf0e98c72e3fc3262420f7a3871dde178b6bbf3d
Author: Michael S. Molina <mi...@gmail.com>
AuthorDate: Thu Jan 5 15:05:44 2023 -0500

    fix: Talisman configuration (#22591)
---
 superset/initialization/__init__.py | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/superset/initialization/__init__.py b/superset/initialization/__init__.py
index 1c1a4b8ad4..6e13638478 100644
--- a/superset/initialization/__init__.py
+++ b/superset/initialization/__init__.py
@@ -677,25 +677,33 @@ class SupersetAppInitializer:  # pylint: disable=too-many-public-methods
         # Flask-Compress
         Compress(self.superset_app)
 
+        # Talisman
+        talisman_enabled = self.config["TALISMAN_ENABLED"]
+        talisman_config = self.config["TALISMAN_CONFIG"]
+        csp_warning = self.config["CONTENT_SECURITY_POLICY_WARNING"]
+
+        if talisman_enabled:
+            talisman.init_app(self.superset_app, **talisman_config)
+
         show_csp_warning = False
         if (
-            self.config["CONTENT_SECURITY_POLICY_WARNING"]
+            csp_warning
             and not self.superset_app.debug
+            and (
+                not talisman_enabled
+                or not talisman_config
+                or not talisman_config.get("content_security_policy")
+            )
         ):
-            if self.config["TALISMAN_ENABLED"]:
-                talisman.init_app(self.superset_app, **self.config["TALISMAN_CONFIG"])
-                if not self.config["TALISMAN_CONFIG"].get("content_security_policy"):
-                    show_csp_warning = True
-            else:
-                show_csp_warning = True
+            show_csp_warning = True
 
         if show_csp_warning:
             logger.warning(
                 "We haven't found any Content Security Policy (CSP) defined in "
                 "the configurations. Please make sure to configure CSP using the "
-                "TALISMAN_CONFIG key or any other external software. Failing to "
-                "configure CSP have serious security implications. Check "
-                "https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP for more "
+                "TALISMAN_ENABLED and TALISMAN_CONFIG keys or any other external "
+                "software. Failing to configure CSP have serious security implications. "
+                "Check https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP for more "
                 "information. You can disable this warning using the "
                 "CONTENT_SECURITY_POLICY_WARNING key."
             )