Skip to content

Commit d4e985d

Browse files
committed
Adding STACKABLE_OPA_BASE_URL
1 parent b3de046 commit d4e985d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

superset/stackable/patches/4.0.2/001-opa-integration.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
diff --git a/superset/security/OpaSupersetSecurityManager.py b/superset/security/OpaSupersetSecurityManager.py
22
new file mode 100644
3-
index 0000000000..b3f216c405
3+
index 0000000000..a435572d0e
44
--- /dev/null
55
+++ b/superset/security/OpaSupersetSecurityManager.py
66
@@ -0,0 +1,73 @@
@@ -28,8 +28,8 @@ index 0000000000..b3f216c405
2828
+
2929
+ opa_roles = set(map(self.resolve_role, opa_role_names))
3030
+ logging.info(f'found Roles in Database: {opa_roles}')
31-
+ # Ensure that in case of a bad or no reponse from OPA each user will have at least one role.
32-
+ if opa_roles == {None}:
31+
+ # Ensure that in case of a bad or no response from OPA each user will have at least one role.
32+
+ if opa_roles == {None} or opa_roles == []:
3333
+ opa_roles.add(default_role)
3434
+
3535
+ if set(user.roles) != opa_roles:
@@ -66,7 +66,7 @@ index 0000000000..b3f216c405
6666
+
6767
+
6868
+ def resolve_opa_endpoint(self) -> Tuple[str, int, bool]:
69-
+ opa_endpoint = current_app.config.get('STACKABLE_OPA_ENDPOINT')
69+
+ opa_endpoint = current_app.config.get('STACKABLE_OPA_BASE_URL')
7070
+ [protocol, host, port] = opa_endpoint.split(":")
7171
+ return host.lstrip('/'), int(port.rstrip('/')), protocol == 'https'
7272
+

0 commit comments

Comments
 (0)