from abc import ABC, abstractmethod from dataclasses import dataclass @dataclass class Identity: id: str anonymous: bool = True class AuthProvider(ABC): @abstractmethod async def get_identity(self, authorization: str | None) -> Identity: """Resolve the request identity from the Authorization header value."""