Skip to main content

A compact auth client for UltraDNS

Project description

ultra_auth

A compact Python client for managing a connection with the UltraDNS API. For the "official," and much more ambitious client, go here.

Features

  • Support for authenticating with username and password, or directly with a bearer token.
  • Automatic token refreshing when the token expires.
  • Built-in handling of various content types.

Installation

You can easily install ultra_auth using pip:

pip install ultra_auth

Once installed, you can use the ultra_auth module in your Python scripts:

from ultra_auth import UltraApi
client = UltraApi(args)

Usage

Authenticating using Username and Password

client = UltraApi(your_username, your_password)

Authenticating using Bearer Token

client = UltraApi(your_bearer_token, use_token=True)

Authenticating using Bearer Token and Refresh Token

client = UltraApi(your_bearer_token, your_refresh_token, True)

Making API Calls

# Make a GET request
response = client.get("/ultra/api/endpoint")

# Make a POST request
response = client.post("/ultra/api/endpoint", payload={"key": "value"})

# ... similarly for PUT, PATCH, DELETE

Response Handling

The client can return data in the form of dictionaries, strings, or bytes depending on the response content type.

For example:

  1. The zone export endpoint, when requesting more than one zone, will return a zip file
  2. The zone export endpoint, when requesting one zone, returns a plain text response
  3. Most endpoints return JSON

Note

Using a bearer token without a refresh token means the client state will expire in approximately 1 hour (assuming the token was just generated). Be warned.

Contribute

Contributions are always welcome! Please open a pull request with your changes, or open an issue if you encounter any problems or have suggestions.

License

This project is licensed under the MIT License - see the LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ultra_auth-0.1.1.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

ultra_auth-0.1.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file ultra_auth-0.1.1.1.tar.gz.

File metadata

  • Download URL: ultra_auth-0.1.1.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ultra_auth-0.1.1.1.tar.gz
Algorithm Hash digest
SHA256 08151dea2ac2ee90e9a6cc5d4b992be8005773b4d3e5f37a465b5c407d6a53fd
MD5 9568d6c326bd3a7904969ba4a9c2873c
BLAKE2b-256 573db1dc10c0b1837efb76d7267ddcbf1f506e374105fee0aab3bfb5d47f3fd0

See more details on using hashes here.

File details

Details for the file ultra_auth-0.1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ultra_auth-0.1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f18c500e409d6a0b7ff961a4c769eb08a888611ea210ff9f2bd6ea39be841c7b
MD5 799508be032fc66a4ac48c4ccfb5ba6e
BLAKE2b-256 5cee5b21afa46615f0d4cab750006c8b14e9f025881ee9ee6897a15d6360db34

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page