"""Base protocol for authentication providers."""

from __future__ import annotations

from typing import Protocol

from waft_client.config import AuthConfig
from waft_client.models import ProviderInfo
from waft_client.store import AuthStore


class AuthProvider(Protocol):
    """Interface that all authentication providers implement."""

    @property
    def info(self) -> ProviderInfo:
        """Provider metadata for the UI."""
        ...

    def handle_route(
        self,
        path: str,
        method: str,
        event: dict,
        store: AuthStore,
        config: AuthConfig,
    ) -> dict | None:
        """Handle a request for this provider's routes.

        Returns a Lambda response dict if the route was handled, None otherwise.
        """
        ...
