"""vikdata-auth exceptions."""


class VikdataAuthError(Exception):
    """Base exception for vikdata-auth."""

    pass


class AuthenticationError(VikdataAuthError):
    """Invalid or missing credentials."""

    pass


class AuthorizationError(VikdataAuthError):
    """Permission denied."""

    def __init__(self, message: str, required_permission: str | None = None):
        super().__init__(message)
        self.required_permission = required_permission


class JWKSError(VikdataAuthError):
    """Error fetching or parsing JWKS."""

    pass
