File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed 
deploy/helm/superset-operator 
operator-binary/src/authorization Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 11---
22apiVersion : v2 
33name : superset-operator 
4- version : " 0.0.0-dev " 
5- appVersion : " 0.0.0-dev " 
4+ version : " " 
5+ appVersion : " " 
66description : The Stackable Operator for Apache Superset 
77home : https://github.com/stackabletech/superset-operator 
88maintainers :
Original file line number Diff line number Diff 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 , 
Original file line number Diff line number Diff 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 ( ) ) , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments