grants.base
BaseGrantProtocol Objects
@runtime_checkable
class BaseGrantProtocol(Protocol)
The base grant protocol
This protocol is implemented by all grants. It can be used to type hint a grant.
afetch_token
async def afetch_token(request: TokenRequest) -> Token
Fetches a token
This function will fetch a token from the grant. This function is async, and should be awaited
Parameters
request : TokenRequest The token request to use
Returns
Token The token
BaseGrant Objects
class BaseGrant(BaseModel)
The base grant class
This class is the base class for all grants. It is a pydantic model, and can be used as such. It also implements the BaseGrantProtocol, which can be used to type hint a grant.
afetch_token
@abstractmethod
async def afetch_token(request: TokenRequest) -> Token
Fetches a token
This function will fetch a token from the grant. This function is async, and should be awaited
Parameters
request : TokenRequest The token request to use
Returns
Token The token
Config Objects
class Config()
Config for the base grant