evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A Python application that configures Apache Superset's authentication system to support multiple authentication providers.
Configure database authentication with password policies.
Configure LDAP authentication with server connection settings.
Configure OAuth2 authentication providers with client credentials.
Load authentication settings from a JSON configuration file.
from typing import Dict, Optional, Any
class AuthenticationConfig:
"""
Manages authentication configuration for Apache Superset.
"""
def __init__(self, config_file: Optional[str] = None):
"""
Initialize the authentication configuration manager.
Args:
config_file: Optional path to JSON configuration file
"""
pass
def configure_database_auth(self, password_scheme: str = "bcrypt",
min_password_length: int = 10) -> Dict[str, Any]:
"""
Configure database authentication settings.
Args:
password_scheme: Password hashing scheme to use (default: "bcrypt")
min_password_length: Minimum password length requirement (default: 10)
Returns:
Dictionary containing database authentication configuration with keys:
'password_scheme' and 'min_password_length'
"""
pass
def configure_ldap_auth(self, server: str, bind_user: str,
bind_password: str, base_dn: str,
search_filter: str = "(uid={0})") -> Dict[str, Any]:
"""
Configure LDAP authentication settings.
Args:
server: LDAP server URL (e.g., "ldap://example.com")
bind_user: LDAP bind user DN
bind_password: LDAP bind password
base_dn: Base DN for user searches (e.g., "dc=example,dc=com")
search_filter: LDAP search filter template (default: "(uid={0})")
Returns:
Dictionary containing LDAP authentication configuration with keys:
'server', 'bind_user', 'bind_password', 'base_dn', 'search_filter'
"""
pass
def configure_oauth_provider(self, provider_name: str, client_id: str,
client_secret: str, authorize_url: str,
token_url: str) -> Dict[str, Any]:
"""
Configure an OAuth2 authentication provider.
Args:
provider_name: Name of the OAuth provider (e.g., "google", "github")
client_id: OAuth client ID
client_secret: OAuth client secret
authorize_url: OAuth authorization endpoint URL
token_url: OAuth token endpoint URL
Returns:
Dictionary containing OAuth provider configuration with keys:
'provider_name', 'client_id', 'client_secret', 'authorize_url', 'token_url'
"""
pass
def load_from_file(self, config_file: str) -> None:
"""
Load authentication configuration from a JSON file.
The JSON file should contain an 'auth_type' key and configuration
parameters for the specified authentication method.
Args:
config_file: Path to the configuration JSON file
"""
pass
def get_active_auth_type(self) -> str:
"""
Get the currently active authentication type.
Returns:
String indicating authentication type: 'database', 'ldap', or 'oauth'
"""
passProvides business intelligence and authentication framework.