F http proxy
Summary
Adds support for http proxies (as per https://gitlab.indiscale.com/caosdb/customers/aba/management/-/issues/32).
Focus
- Support for http proxies via the new
https_proxy
andhttp_proxy
parameters and config options and by respecting the widely usedHTTPS_PROXY
andHTTP_PROXY
environment variables. This deprecates thesocket_proxy
option because the functionality is contained in the new options. - The support for http proxies made it necessary to use the
requests
library. This is a long overdue refactoring because the old custom implementation for streaming https connections was from the early days of caosdb-pylib when streaming + https was not supported by any standard library back then. This reduces the complexity and uses a well-tested, regularly updated, yet stable library instead. - Add dependency on
python-dateutil
because it is used inhigh_level_api.py
. - As a nice side-effect, http connections are possible now (Does anyone still use these?)
Test Environment
Manual testing required!
Test with a local socks5 proxy
-
ssh -D 8888 localhost
(mind: if you exit this, the socks proxy is gone...) - configure
pycaosdb.ini
for socks proxy or use the env var - try connecting to demo server
Also try to configure a wrong socks proxy (e.g. wrong port) - this should fail.
Test with a local http proxy
- start dockerized tinyproxy:
docker run --rm --name tinyproxy -p 8888:8888 -e "ALLOWED=255.255.255.255/0" ajoergensen/tinyproxy
- configure
pycaosdb.ini
for http proxy or use the env var - try connecting to demo server
Also try to configure a wrong http proxy.
Check List for the Author
Please, prepare your MR for a review. Be sure to write a summary and a focus and create gitlab comments for the reviewer. They should guide the reviewer through the changes, explain your changes and also point out open questions. For further good practices have a look at our review guidelines
-
All automated tests pass -
Reference related issues -
Up-to-date CHANGELOG.md (or not necessary) -
Annotations in code (Gitlab comments) - Intent of new code
- Problems with old code
- Why this implementation?
Check List for the Reviewer
-
I understand the intent of this MR -
All automated tests pass -
Up-to-date CHANGELOG.md (or not necessary) -
The test environment setup works and the intended behavior is reproducible in the test environment -
In-code documentation and comments are up-to-date. -
Check: Are there specifications? Are they satisfied?
For further good practices have a look at our review guidelines.
Edited by Florian Spreckelsen