Skip to content

F http proxy

Timm Fitschen requested to merge f-http-proxy into dev

Summary

Adds support for http proxies (as per https://gitlab.indiscale.com/caosdb/customers/aba/management/-/issues/32).

Focus

  1. Support for http proxies via the new https_proxy and http_proxy parameters and config options and by respecting the widely used HTTPS_PROXY and HTTP_PROXY environment variables. This deprecates the socket_proxy option because the functionality is contained in the new options.
  2. 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.
  3. Add dependency on python-dateutil because it is used in high_level_api.py.
  4. 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

  1. ssh -D 8888 localhost (mind: if you exit this, the socks proxy is gone...)
  2. configure pycaosdb.ini for socks proxy or use the env var
  3. 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

  1. start dockerized tinyproxy: docker run --rm --name tinyproxy -p 8888:8888 -e "ALLOWED=255.255.255.255/0" ajoergensen/tinyproxy
  2. configure pycaosdb.ini for http proxy or use the env var
  3. 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

Merge request reports

Loading