Skip to content
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

Functionalities from PR backlog - PRs# 6, 7, 8 - Proxy support, resign zones, RD pool support #30

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

sbarbett
Copy link
Contributor

@sbarbett sbarbett commented Feb 25, 2025

New Feature(s)

Proxy Support & TLS Validation (PR#6)

  • Added support for making requests through a proxy.

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

    >>> 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': '' ... } }
    
    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.

  • Updated README.md with details on proxy usage and TLS validation options.

Resign Zone Method (PR#8)

  • Added a method to resign DNSSEC-signed zones in the client wrapper.

Support for RD Pools (PR#7)

  • Added a method for creating RD pools.

    Example Usage:

    # Demonstration of creating an A record RD pool
    client.create_rd_pool(
        "example.com", # Zone name
        "foo", # Hostname (owner)
        300, # TTL
        [
            "1.1.1.1", # List of rdata 
            "2.2.2.2", 
            "3.3.3.3"
        ]
    )
    
    # Demonstration of creating an AAAA pool
    client.create_rd_pool(
        "example.com", 
        "bar", 
        300, 
        [
            "2001:db8::1",
            "2001:db8::2", 
            "2001:db8::3"
        ], 
        ipv6=True, # Set AAAA to True
        order="RANDOM", # (Optional) Order of record distribution
        description="lorem ipsum" # (Optional) Description of pool
    )
  • Added a method for replacing existing RD pools (PUT).

    Example Usage:

    client.edit_rd_pool(
        "example.com", 
        "bar", 
        600, 
        [
            "2001:db8::2", 
            "2001:db8::3"
        ], 
        ipv6=True, 
        order="FIXED", 
        description="ipsum"
    )
  • Added a method for retrieving all RD pools.

    Example Usage:

    client.get_rd_pools("example.com")
  • Added a delete method for removing an RD pool.

    Example Usage:

    client.delete_rd_pool("example.com", "foo")
    client.delete_rd_pool("example.com", "bar", ipv6=True)
  • Updated README.md with RD pool example.

@sbarbett sbarbett requested a review from stevedejong February 25, 2025 23:50
@sbarbett sbarbett self-assigned this Feb 25, 2025
@stevedejong stevedejong merged commit b133a94 into ultradns:master Feb 27, 2025
1 check passed
@sbarbett sbarbett deleted the pr-backlog branch February 27, 2025 23:53
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.

2 participants