You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's have a go at simplifying our custom authentication API.
We have an existing API using generators and an "auth_flow". (Fantastic at the time, tho now the codebase has matured, I think? can be simplified.)
I assume the following base API would be sufficient for almost all authentication use-cases...
classAuth:
defauthenticate_request(request: Request) ->Request:
# Most authentication schemes only need to override this method.returnrequestdefauthenticate_response(response: Response) ->Request|None:
# Challenge-response authentication schemes may override this method,# Allows a second request to optionally be made, once a server challenge is received.returnNone
It's feasible that there are might(???) be some exceptional cases where this might not be sufficient, but we have a "Transport API" that allows completely customising the entire request/response implementation. That'd be adequate for anyone needing to implement an oddball multi-stage authentication scheme.
Moderately involved, tho likely still suitable for a new contributor to deal with.
Checklist...
Update the base Auth class as above.
Update the BasicAuth, DigestAuth and NetRCAuth classes to use the new API.
Update the auth handling in _client.py.
Update the documentation.
Update tests as required.
Simplicity ftw.
The text was updated successfully, but these errors were encountered:
Let's have a go at simplifying our custom authentication API.
We have an existing API using generators and an "auth_flow". (Fantastic at the time, tho now the codebase has matured, I think? can be simplified.)
I assume the following base API would be sufficient for almost all authentication use-cases...
It's feasible that there are might(???) be some exceptional cases where this might not be sufficient, but we have a "Transport API" that allows completely customising the entire request/response implementation. That'd be adequate for anyone needing to implement an oddball multi-stage authentication scheme.
Moderately involved, tho likely still suitable for a new contributor to deal with.
Checklist...
Auth
class as above.BasicAuth
,DigestAuth
andNetRCAuth
classes to use the new API._client.py
.Simplicity ftw.
The text was updated successfully, but these errors were encountered: