Skip to content

Commit e237a7a

Browse files
committed
Updating some approaches
1 parent 1e17009 commit e237a7a

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

deploy/helm/superset-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
apiVersion: v2
33
name: superset-operator
4-
version: "0.0.0-dev"
5-
appVersion: "0.0.0-dev"
4+
version: ""
5+
appVersion: ""
66
description: The Stackable Operator for Apache Superset
77
home: https://github.com/stackabletech/superset-operator
88
maintainers:

rust/crd/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ impl FlaskAppConfigOptions for SupersetConfigOptions {
119119
SupersetConfigOptions::LoggingConfigurator => PythonType::Expression,
120120
SupersetConfigOptions::AuthType => PythonType::Expression,
121121
SupersetConfigOptions::AuthUserRegistration => PythonType::BoolLiteral,
122-
SupersetConfigOptions::AuthUserRegistrationRole => PythonType::StringLiteral,
122+
// Going to be an expression as we default it from env, if and only if opa is used
123+
SupersetConfigOptions::AuthUserRegistrationRole => PythonType::Expression,
123124
SupersetConfigOptions::AuthRolesSyncAtLogin => PythonType::BoolLiteral,
124125
SupersetConfigOptions::AuthLdapServer => PythonType::StringLiteral,
125126
SupersetConfigOptions::AuthLdapBindUser => PythonType::Expression,

rust/operator-binary/src/authorization/opa.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ impl SupersetOpaConfig {
2020
// Get opa_base_url for later use in CustomOpaSecurityManager
2121
let opa_endpoint = opa_config
2222
.full_document_url_from_config_map(client, superset, None, OpaApiVersion::V1)
23-
.await?;
23+
.await?
24+
// Not pretty.
25+
// Need to remove the resource name. Appended by default.
26+
// TODO: Decide where to handle this
27+
// could be better in security manager!
28+
.replace("/v1/data/superset", "");
2429

2530
let opa_package = opa_config.package.clone();
31+
2632
Ok(SupersetOpaConfig {
2733
opa_endpoint,
2834
opa_package,
@@ -39,7 +45,9 @@ impl SupersetOpaConfig {
3945
"CUSTOM_SECURITY_MANAGER".to_string(),
4046
Some("OpaSupersetSecurityManager".to_string()),
4147
),
42-
// TODO: Make this more smart.
48+
// This is now a PythonType::Expression. Makes it easy to find a default.
49+
// only necessary when opa role mapping is activated, as the user
50+
// has to have a role to be valid.
4351
(
4452
"AUTH_USER_REGISTRATION_ROLE".to_string(),
4553
Some("os.getenv('AUTH_USER_REGISTRATION_ROLE', 'Public')".to_string()),

0 commit comments

Comments
 (0)