Authorizer Base
Authorizer Base
class AuthorizedRequestBase:
"""
Interface for protobufs with the ``RequestAuthInfo auth`` field. Used for type annotations only.
"""
auth: RequestAuthInfo
class AuthorizedResponseBase:
"""
Interface for protobufs with the ``ResponseAuthInfo auth`` field. Used for type annotations only.
"""
auth: ResponseAuthInfo
class AuthorizerBase(ABC):
@abstractmethod
async def sign_request(
self, request: AuthorizedRequestBase, service_public_key: Optional[RSAPublicKey]
) -> None: ...
@abstractmethod
async def validate_request(self, request: AuthorizedRequestBase) -> bool: ...
@abstractmethod
async def sign_response(self, response: AuthorizedResponseBase, request: AuthorizedRequestBase) -> None: ...
@abstractmethod
async def validate_response(self, response: AuthorizedResponseBase, request: AuthorizedRequestBase) -> bool: ...
Last updated