or run

npx @tessl/cli init
Log in

Version

Files

docs

chart-components.mdchart-plugins.mddata-transformation.mdform-data.mdindex.mdquery-building.md
tile.json

task.mdevals/scenario-9/

Authentication Configuration Manager

A Python application that configures Apache Superset's authentication system to support multiple authentication providers.

Requirements

Database Authentication Configuration

Configure database authentication with password policies.

  • Configuring database auth returns a dict with password_scheme set to 'bcrypt' and min_password_length set to 10 @test
  • Configuring database auth with custom values returns a dict with the specified password_scheme and min_password_length @test

LDAP Authentication Configuration

Configure LDAP authentication with server connection settings.

  • Configuring LDAP auth returns a dict containing server, bind_user, bind_password, base_dn, and search_filter keys @test
  • LDAP configuration with server "ldap://example.com" and base_dn "dc=example,dc=com" stores these values correctly @test

OAuth Provider Configuration

Configure OAuth2 authentication providers with client credentials.

  • Configuring OAuth provider returns a dict with provider_name, client_id, client_secret, authorize_url, and token_url @test
  • OAuth configuration for provider "google" with client_id "test123" stores the provider configuration correctly @test

Configuration File Loading

Load authentication settings from a JSON configuration file.

  • Loading from a JSON file with database auth settings populates the authentication configuration @test
  • After loading from file, get_active_auth_type returns the configured authentication type @test

Implementation

@generates

API

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'
        """
        pass

Dependencies { .dependencies }

apache-superset { .dependency }

Provides business intelligence and authentication framework.

@satisfied-by