Skip to content

Commit b3c3d0f

Browse files
committed
Add SecurityManager dynamically
1 parent d502af3 commit b3c3d0f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

rust/crd/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub enum SupersetConfigOptions {
8888
AuthLdapTlsCacertfile,
8989
CustomSecurityManager,
9090
StackableOpaEndpoint,
91-
OpaPackageName,
91+
StackableOpaPackage,
9292
}
9393

9494
impl SupersetConfigOptions {
@@ -138,7 +138,7 @@ impl FlaskAppConfigOptions for SupersetConfigOptions {
138138
SupersetConfigOptions::AuthLdapTlsCacertfile => PythonType::StringLiteral,
139139
SupersetConfigOptions::CustomSecurityManager => PythonType::StringLiteral,
140140
SupersetConfigOptions::StackableOpaEndpoint => PythonType::StringLiteral,
141-
SupersetConfigOptions::OpaPackageName => PythonType::StringLiteral,
141+
SupersetConfigOptions::StackableOpaPackage => PythonType::StringLiteral,
142142
// TODO: Set new options for OpaSecurityManager like:
143143
}
144144
}

rust/operator-binary/src/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pub const PYTHON_IMPORTS: &[&str] = &[
3535
"from log_config import StackableLoggingConfigurator",
3636
];
3737

38-
// TODO: Eihter use or remove this
3938
pub const OPA_IMPORTS: &[&str] =
4039
&["from superset.security.manager import OpaSupersetSecurityManager"];
4140

rust/operator-binary/src/superset_controller.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ fn build_rolegroup_config_map(
559559
vector_aggregator_address: Option<&str>,
560560
) -> Result<ConfigMap, Error> {
561561
let mut config_properties = BTreeMap::new();
562-
let imports = PYTHON_IMPORTS;
562+
let mut imports = PYTHON_IMPORTS.to_vec();
563563
// TODO: this is true per default for versions 3.0.0 and up.
564564
// We deactivate it here to keep existing functionality.
565565
// However this is a security issue and should be configured properly
@@ -577,7 +577,7 @@ fn build_rolegroup_config_map(
577577
}
578578
// If opa role mapping is configured, insert CustomOpaSecurityManager import
579579
for opa_import in OPA_IMPORTS {
580-
imports.to_vec().push(&opa_import);
580+
imports.push(&opa_import);
581581
}
582582
}
583583

@@ -604,7 +604,7 @@ fn build_rolegroup_config_map(
604604
flask_app_config_writer::write::<SupersetConfigOptions, _, _>(
605605
&mut config_file,
606606
config_properties.iter(),
607-
imports,
607+
&imports,
608608
)
609609
.with_context(|_| BuildRoleGroupConfigFileSnafu {
610610
rolegroup: rolegroup.clone(),

0 commit comments

Comments
 (0)