RenewingTokenAuth
Bearer token auth flow renewing its token through a source on HTTP 401.
Functions
func__init__(self, source) -> NoneInitialize the auth flow.
paramselfparamsourceTokenSourceSource producing and renewing the bearer token.
Returns
Nonefuncasync_auth_flow(self, request) -> AsyncGenerator[httpx.Request, httpx.Response]Attach a bearer token and retry once with a renewed one on HTTP 401.
A request rejected with HTTP 401 is retried once with a renewed token, unless another caller renewed it first, in which case the retry uses theirs.
paramselfparamrequesthttpx.RequestOutgoing HTTP request.
Returns
collections.abc.AsyncGenerator[httpx.httpx.Request, httpx.httpx.Response]funcclose(self) -> NoneClose the token source.
paramselfReturns
None