-
Notifications
You must be signed in to change notification settings - Fork 39
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
Feature request: Add auth pattern #245
Comments
Thanks for the suggestion @stinovlas. This would definitely be a suited argument since Though, I'm not sure what the value/api should look like to be extensible enough, allowing all kind of auth methods. I find myself quite often implementing custom If you have many tests and this becomes repetitive, an other solution would be to have one unit test that asserts that the authorization header is properly sent with your client, e.g. by using |
Of course, or I could write a wrapper to check the headers with each call. To be honest, I don't have much experience with |
I've looked into this now and the only reasonable and doable pattern would be to implement This might be ok, but could also confuse users into believing all httpx auth types is usable as a pattern match, which they can't be. |
It would be nice to have an
auth
pattern. I'm writing an app using a Basic auth protected API and I want to test the calls. Right now, I need to do this:This works, but is quite ugly and I'd prefer to have a direct
auth
pattern:This would mimick the
auth
argument ofhttpx.request()
, similarly tojson
and similar patterns.Note:
httpx
also supports Digest authentication, sorespx
should probably also cover that usecase, if implemented.The text was updated successfully, but these errors were encountered: