-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Requests AuthBase #103
Comments
Specifically for signing requests to cryptocurrency exchange apis I need the body to be available in the request object. Edit: The body is generated here, but isn't added as an attribute of the request object.
See - https://www.bitmex.com/app/apiKeysUsage Here is a requests based auth implementation: https://github.com/BitMEX/sample-market-maker/blob/master/market_maker/auth/APIKeyAuthWithExpires.py |
PR #128 adds the body attribute to allow the described use case. |
Currently,
asks
supports extensible authz/authn:https://asks.readthedocs.io/en/latest/overview-of-funcs-and-args.html#authing
https://github.com/theelous3/asks/blob/master/asks/auth.py
It is possible to inherit from
AuthBase
to introduce missing auth methods.Unfortunately,
asks.auth.AuthBase
is not compatible withrequests.auth.AuthBase
:http://docs.python-requests.org/en/master/user/authentication/#new-forms-of-authentication
It would be awesome if existing non-trivial
requests
auth plugins could be used withasks
as well.For example:
https://github.com/lepture/authlib/blob/dee7f003b74252e22d62e11a91ec1b629b6fdeae/authlib/client/oauth2_session.py#L22-L34
The text was updated successfully, but these errors were encountered: