Skip to content

Updated for proxy support#6

Closed
termlen0 wants to merge 1 commit intoultradns:masterfrom
termlen0:master
Closed

Updated for proxy support#6
termlen0 wants to merge 1 commit intoultradns:masterfrom
termlen0:master

Conversation

@termlen0
Copy link

If you are making API calls from behind a proxy and not from within a shell - In my case, a java program, run by root, calls the python client - you need some way to pass the proxy info to the requests library. This pull request, is trying to address that gap.
HTH.

@sbarbett
Copy link
Contributor

Hello,

First off, I sincerely apologize for the long delay in reviewing this PR. It’s unfortunate that it slipped through without feedback, and I truly appreciate the effort you put into contributing to the project.

Due to the significant changes in the codebase over the years, I’m no longer able to merge this request directly. However, I wanted to acknowledge your contribution and let you know that this functionality has now been implemented and will be available in v2.2.5.

Proxy Support & TLS Validation

  • Added support for making requests behind a proxy.

  • Introduced a parameter to explicitly disable TLS validation when needed.

    Example:

    >>> proxy_dict = {
    ...     "http": "http://192.168.1.243:9080",
    ...     "https": "http://192.168.1.243:9080"
    ... }
    >>> from ultra_rest_client import RestApiClient
    >>> client = RestApiClient('username', 'password', proxy=proxy_dict, verify_https=False)
    >>> print(client.get_zones())
    {'queryInfo': {'q': '' ... } }
    

    Proxy Log:

    mitmproxy  | [05:43:22.823][192.168.1.211:47424] client connect
    mitmproxy  | [05:43:22.849][192.168.1.211:47424] server connect api.ultradns.com:443 (3.86.127.106:443)
    mitmproxy  | 192.168.1.211:47424: POST https://api.ultradns.com/v1/authorization/token
    mitmproxy  |                   << 200 OK 304b
    mitmproxy  | [05:43:23.489][192.168.1.211:47424] client disconnect
    mitmproxy  | [05:43:23.490][192.168.1.211:47424] server disconnect api.ultradns.com:443 (3.86.127.106:443)
    mitmproxy  | [05:43:42.830][192.168.1.211:56532] client connect
    mitmproxy  | [05:43:42.857][192.168.1.211:56532] server connect api.ultradns.com:443 (35.175.76.156:443)
    mitmproxy  | 192.168.1.211:56532: GET https://api.ultradns.com/v1/zones
    mitmproxy  |                   << 200 OK 1.7k
    
  • TLS validation warnings are now suppressed by default.

  • The README.md has been updated with relevant details.


I really appreciate your contribution, and I regret that it wasn’t addressed sooner.

@sbarbett sbarbett closed this Feb 25, 2025
Copy link
Contributor

@sbarbett sbarbett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This functionality has been implemented in v2.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants