Skip to main content

url-signer-python

PyPI version Python version Build Status

Overview

url-signer-python is a Python library designed to generate signatures for URLs. These signatures can be used by the IO River service with Signed-URLs enabled to secure access to content. The library generates signatures for all CDN providers associated with the service.


Installation

To install url-signer-python, you can use pip:

pip install url-signer-python

Alternatively, you can clone the repository and install it manually:

git clone https://github.com/ioriver/url-signer-python.git
cd url-signer-python
pip install .

Usage

Below is some example to help you get started:

Step 1: Create URL Signer

from ioriver.url_signer import UrlSigner

private_key = "YourPrivateKey"
encryption_key = "YourEncryptionKey"

# use the provider key information from your service
providers_key_info = {
    "cloudfront_key_id": "1234",
    "fastly_key_id": "5678"
}

signer = UrlSigner(private_key, encryption_key, providers_key_info)

Step 2: Generate Signature

# the policy to be signed
policy = {
    "resources": "https://test.example.com/streams/*",
    "condition": {
        "end_time": 1733356800
    }
}

# generate signature for all CDNs
signature = signer.generate_url_signature(policy)

API Reference

UrlSigner Constructor

Parameters

  • private_key (string): The private key for signing the URL.
  • encryption_key (string): The encryption key for signing the URL.
  • providers_key_info (object): Information about the keys deployed within the CDN providers (copied from your service).

generate_url_signature(policy)

Attributes for policy

  • resources (required): A string specifying the URL or URL pattern the policy applies to.

  • condition (required):
    A dictionary containing conditions for the policy.

    • end_time (required):
      An integer specifying the UNIX timestamp when the signature will expire.

    Additional optional attributes in the condition dictionary include:

    • start_time:
      An integer specifying the UNIX timestamp when the signature becomes valid. Default: None.

Requirements

This library requires:

  • Python 3.7+
  • Dependencies listed in requirements.txt.

To install dependencies manually:

pip install -r requirements.txt

Testing

pytest

Support

If you encounter any issues, please open an issue on GitHub or contact us at support@ioriver.io.

Metadata

Release files for url-signer-python 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for url-signer-python 0.7.0
File Size Uploaded
url_signer_python-0.7.0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for url-signer-python 0.7.0
File Interpreter ABI Platform
url_signer_python-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / url_signer_python-0.7.0.tar.gz

Download URL url_signer_python-0.7.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c96eb04713f69a4acc6f8ba5cf45a685682ea49bcd3108e1282a8d70ec9bd458
BLAKE2b-256 checksum
How to use checksums
5dd60b2dfcce74c4673f5f5a3d04c828e0e077f97266ff8f09f48d11e39d2815
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / url_signer_python-0.7.0-py3-none-any.whl

Download URL url_signer_python-0.7.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc8faba4701ee6dc494946ef3ff6b4ac7a32fb7e406457c640e12dea29e7b94b
BLAKE2b-256 checksum
How to use checksums
bb42c93d9de974ecf730a536184089b14afcc92116c268e380d8ccb6daddc953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page