class documentation

class FunctionAuth(Auth): (source)

View In Hierarchy

Allows the 'auth' argument to be passed as a simple callable function, that takes the request, and returns a new, modified request.

Method __init__ Undocumented
Method auth_flow Execute the authentication flow.
Instance Variable _func Undocumented

Inherited from Auth:

Async Method async_auth_flow Execute the authentication flow asynchronously.
Method sync_auth_flow Execute the authentication flow synchronously.
Class Variable requires_request_body Undocumented
Class Variable requires_response_body Undocumented
def __init__(self, func): (source)

Undocumented

Parameters
func:typing.Callable[[Request], Request]Undocumented
def auth_flow(self, request): (source)

Execute the authentication flow. To dispatch a request, `yield` it: ``` yield request ``` The client will `.send()` the response back into the flow generator. You can access it like so: ``` response = yield request ``` A `return` (or reaching the end of the generator) will result in the client returning the last response obtained from the server. You can dispatch as many requests as is necessary.

Parameters
request:RequestUndocumented
Returns
typing.Generator[Request, Response, None]Undocumented

Undocumented