Skip to content

Commit 8614577

Browse files
committed
Adding more rules, more sophisticated handling of stuff
1 parent e237a7a commit 8614577

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

rust/crd/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pub enum SupersetConfigOptions {
8989
CustomSecurityManager,
9090
StackableOpaEndpoint,
9191
StackableOpaPackage,
92+
StackableOpaRule,
9293
}
9394

9495
impl SupersetConfigOptions {
@@ -140,6 +141,7 @@ impl FlaskAppConfigOptions for SupersetConfigOptions {
140141
SupersetConfigOptions::CustomSecurityManager => PythonType::Expression,
141142
SupersetConfigOptions::StackableOpaEndpoint => PythonType::StringLiteral,
142143
SupersetConfigOptions::StackableOpaPackage => PythonType::StringLiteral,
144+
SupersetConfigOptions::StackableOpaRule => PythonType::Expression,
143145
// TODO: Set new options for OpaSecurityManager like:
144146
}
145147
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ impl SupersetOpaConfig {
5252
"AUTH_USER_REGISTRATION_ROLE".to_string(),
5353
Some("os.getenv('AUTH_USER_REGISTRATION_ROLE', 'Public')".to_string()),
5454
),
55-
// TODO: Figure out how to tell a what are the
56-
// rule names used.
55+
// There is no proper way to interfere this without changing e.g. CRD's.
56+
// Thus, we go for an default and make it accessible through envoverrides.
5757
(
5858
"STACKABLE_OPA_RULE".to_string(),
59-
Some("os.getenv('STACKABLE_OPA_RULE', 'user_roles')".to_string()),
59+
Some("os.getenv('OPA_RULE', 'user_roles')".to_string()),
6060
),
6161
(
6262
"STACKABLE_OPA_ENDPOINT".to_string(),

0 commit comments

Comments
 (0)