-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Support callback-based authentication for HTTP and HTTP proxies #822
Comments
It's currently just raised for a 401, not for a 407. We could possibly raise a different exception for HTTPProxyUnauthorized. I've updated the exception in trunk to include the URL. |
Actually, I meant the realm not the scheme, but the URL is nice too, sorry! Rather than adding another specific HTTP exception class, perhaps it would be better to add a general subclass of Also, it seemed a bit odd to me that as a client of this library, I had to parse the Anyway, the current support for authentication is mostly fine, and I managed to make it work in |
I've now added a HTTPProxyUnauthorized exception as well. I'm not sure if Dulwich should get in the business of parsing WWW-Authenticate in this particular code path. One of the intentions here is to provide flexibility for consumers like hg-git and bzr-git, and the ability to plug in other HTTP libraries or authentication (e.g. on Windows you may want to support Negotiate and GSSAPI). (still trying to navigate this, open to suggestions on what you think works best for hg-git) The dulwich porcelain should provide an out of the box authentication experience that e.g. uses the git credentials helpers. |
Well, what'd be really nice for hg-git is using |
For dulwich itself, yes - migrating to urllib3 was painful enough and I don't want to make library users go through that again. However, we could provide an abstract base class where you can just bring your own http_request(method, url, data) function? |
Because Poetry relies on Dulwich, I kind of have the same issue. I need to clone a This is a critical part because HTTPS over HTTP proxy requires tunneling (see urllib3 implementation ... and when using tunneling, the proxy credentials should be in Suggestion: when proxy_url contains a username+password => populate the |
@raphaeljoie please file a separate issue, that's different from this one. edit: Actually nevermind - I've just opened #1227, since github makes splitting quite easy now. |
I've managed to get HTTP authentication working in
hg-git
by interceptingdulwich.client.HTTPUnauthorized
, but this has some issues. First of all, it doesn't distinguish between the HTTP call itself and the proxy, and it doesn't reveal the scheme — which is used by Mercurial's password manager.The text was updated successfully, but these errors were encountered: