Skip to content

Commit 2549452

Browse files
committed
Updating manager, leaving todos
1 parent eb18ffe commit 2549452

File tree

2 files changed

+27
-22
lines changed

2 files changed

+27
-22
lines changed

superset-opa-integration/superset-custom-opa.yaml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,38 @@ metadata:
88
}
99
spec:
1010
image:
11-
custom: docker.stackable.tech/stackable/superset:4.0.2-stackable0.0.0-dev-opaV6
11+
custom: docker.stackable.tech/sandbox/superset:4.0.2-stackable0.0.0-dev-opaV7
1212
productVersion: 4.0.2
1313
pullPolicy: Never
1414
clusterConfig:
1515
credentialsSecret: simple-superset-credentials
1616
listenerClass: external-unstable
17+
authorization:
18+
opa:
19+
configMapName: simple-opa
20+
package: superset
1721
nodes:
1822
roleGroups:
1923
default:
2024
config:
2125
rowLimit: 10000
2226
webserverTimeout: 300
23-
podOverrides:
24-
spec:
25-
containers:
26-
- name: superset
27-
env:
28-
- name: STACKABLE_OPA_ENDPOINT
29-
valueFrom:
30-
configMapKeyRef:
31-
key: OPA
32-
name: simple-opa
33-
envOverrides:
34-
AUTH_USER_REGISTRATION_ROLE: Gamma
27+
# podOverrides:
28+
# spec:
29+
# containers:
30+
# - name: superset
31+
# env:
32+
# - name: STACKABLE_OPA_ENDPOINT
33+
# valueFrom:
34+
# configMapKeyRef:
35+
# key: OPA
36+
# name: simple-opa
37+
#envOverrides:
38+
#AUTH_USER_REGISTRATION_ROLE: Gamma
3539
configOverrides:
3640
superset_config.py:
37-
EXPERIMENTAL_FILE_HEADER: |
38-
from superset.security.manager import OpaSupersetSecurityManager
41+
# EXPERIMENTAL_FILE_HEADER: |
42+
# from superset.security.manager import OpaSupersetSecurityManager
3943
# Maybe also ENABLE_TEMPLATE_PROCESSING
4044
FEATURE_FLAGS: |-
4145
{
@@ -69,9 +73,9 @@ spec:
6973
False
7074
}
7175
# TODO: Add these line with superset operator
72-
CUSTOM_SECURITY_MANAGER: OpaSupersetSecurityManager
73-
AUTH_USER_REGISTRATION_ROLE: os.getenv('AUTH_USER_REGISTRATION_ROLE', 'Public')
74-
STACKABLE_OPA_ENDPOINT: os.getenv('STACKABLE_OPA_ENDPOINT')
75-
STACKABLE_OPA_PACKAGE: |-
76-
"superset"
77-
STACKABLE_OPA_RULE: os.getenv('STACKABLE_OPA_RULE', 'user_roles')
76+
# CUSTOM_SECURITY_MANAGER: OpaSupersetSecurityManager
77+
# AUTH_USER_REGISTRATION_ROLE: os.getenv('AUTH_USER_REGISTRATION_ROLE', 'Public')
78+
# STACKABLE_OPA_ENDPOINT: os.getenv('STACKABLE_OPA_ENDPOINT')
79+
# STACKABLE_OPA_PACKAGE: |-
80+
# "superset"
81+
# STACKABLE_OPA_RULE: os.getenv('STACKABLE_OPA_RULE', 'user_roles')

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ index 0000000000..56fe61c917
2727
+ logging.info(f'OPA returned roles: {opa_role_names}')
2828
+
2929
+ opa_roles = set(map(self.resolve_role, opa_role_names))
30-
+ # Ensure that in case of a bad or no reponse from OPA each user will have at least one role.
30+
+ # Ensure that in case of a bad or no response from OPA each user will have at least one role.
31+
+ # I'm not toooo happy with that. Everybody get's public, even administrators. We should change that.
3132
+ opa_roles.add(default_role)
3233
+
3334
+ if set(user.roles) != opa_roles:

0 commit comments

Comments
 (0)