"""remem-auth — Shared authentication library for remem Python services."""

from ._config import AuthConfig, create_auth_config_from_env
from ._models import AuthenticatedUser, AuthMethod, ErrorFormat, IdpConfig
from ._token_extraction import extract_token
from ._verifier import AuthenticationError, AuthVerifier

__all__ = [
    "AuthConfig",
    "AuthenticatedUser",
    "AuthenticationError",
    "AuthMethod",
    "AuthVerifier",
    "ErrorFormat",
    "FastAPIAuth",
    "FastMCPAuthProvider",
    "IdpConfig",
    "create_auth_config_from_env",
    "extract_token",
]


def __getattr__(name: str):
    if name == "FastAPIAuth":
        from ._fastapi import FastAPIAuth

        return FastAPIAuth

    if name == "FastMCPAuthProvider":
        from ._fastmcp import FastMCPAuthProvider

        return FastMCPAuthProvider

    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
