-
Notifications
You must be signed in to change notification settings - Fork 6
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
add SessionAuthHandler #599
add SessionAuthHandler #599
Conversation
This reverts commit 7307b81.
Ok, here's the new usage: CLI: weaver processes -aC weaver.cli.CookieAuthHandler -aT 'auth=thecookievaluethattshouldbeincluded' --url https://example.com/weaver Client s = requests.Session()
# add cookies to the session
client = WeaverClient("https://example.com/weaver", auth=CookieAuthHandler(token=s.cookies.get_dict())) |
Note that because I made the changes in the RequestAuthHandler as discussed:
it is possible to send a token to the BearerAuthHandler as well in a similar way (if you have the bearer token already) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new feature (waiting for the tests to run/succeed before merge).
@mishaschwartz You can add yourself to the contributors list in https://github.com/crim-ca/weaver/blob/master/AUTHORS.rst if you desire. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #599 +/- ##
==========================================
+ Coverage 85.65% 85.66% +0.01%
==========================================
Files 79 79
Lines 18559 18580 +21
Branches 2844 2847 +3
==========================================
+ Hits 15896 15917 +21
Misses 1926 1926
Partials 737 737 ☔ View full report in Codecov by Sentry. |
@mishaschwartz Due to a CI issue with https://github.com/crim-ca/weaver/tree/5.1.0, I pushed another https://github.com/crim-ca/weaver/tree/5.1.1. The docker image for it should be ready soon. |
Add
weaver.cli.SessionAuthHandler
class which uses the cookies stored in a pre-existingrequests.Session
instance to authenticate.Alternative to #597 as discussed in #597 (comment)
Closes #597