pybliometrics-dev / pybliometrics

Python-based API-Wrapper to access Scopus
https://pybliometrics.readthedocs.io/en/stable/
Other
410 stars 128 forks source link

Support proxy that requires DigestAuth #233

Closed raffaem closed 2 years ago

raffaem commented 2 years ago

This is a first attempt to support proxies that requires DigestAuth rather than BasicAuth.

It is not perfect but it's the only working solution I could find that supports connection to HTTPS websites (the other solutions don't support connection to HTTP websites)

Michael-E-Rose commented 2 years ago

Are you going to create a new clean PR for the DigestAuth thingy?

raffaem commented 2 years ago

Are you going to create a new clean PR for the DigestAuth thingy?

It was based on some code I found on StackOverflow, with heavy monkey patching of requests and httplib that I don't fully understands.

I raised an issue on toolbelt, without answer, and one on requests, which is not going to implement it in the near future.

I raised a discussion on httpx which eventually escalated into an issue to implement it.

Maybe once it is implemented in httpx, we can re-base pybliometrics on httpx and implement DigestAuth for proxies without monkey patching.

Or otherwise I'll re-submit the PR, it worked but I can't figure quite out all the monkey patching.

Michael-E-Rose commented 2 years ago

Wow, that's a lot of issues that you raised there!

I'm curious what comes out of this. If none of this is too complex nor breaks the current interface, then we should seriously consider switching to DigestAuth.

raffaem commented 2 years ago

Wow, that's a lot of issues that you raised there!

I'm curious what comes out of this. If none of this is too complex nor breaks the current interface, then we should seriously consider switching to DigestAuth.

If you wish you can check the commit of my fork which implements DigestAuth for proxies.

Otherwise just wait for httpx to implement it?

If I'm understanding correctly, all pybliometrics internet communication happens through get_content.py.

Then it should not be too difficult to switch to httpx if one wishes.