Skip to main content

Generate time limited, ephemeral, long term credentials to authenticate usage of a turn server.

Project description

TURN Ephemeral Credentials - v1.0.1

Generate time limited, i.e. ephemeral, long term credentials to authenticate against a TURN server. The default duration for the validity of the credentials is set to one day as recommended in A REST API For Access To TURN Services. The same document describes how to generate the username and password here.

Stack

  • Python 3.8.10 on Ubuntu 20.04.2 LTS

Installation

From PyPI

(venv) $ pip install turn-ephemeral-credentials

From GitHub

(venv) $ pip install git+https://github.com/p4irin/turn_ephemeral_credentials.git

Usage

from turn_ephemeral_credentials import generate


# Generate a username and use the default ttl of one day
credentials = generate(shared_secret='A shared secret with a TURN server')

# Pass a username and use the default ttl
credentials = generate(username='username', shared_secret='A shared secret with a TURN server')

# Generate a username and use a ttl of half a day
credentials = generate(shared_secret='A shared secret with a TURN server', ttl=43200)

Reference

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

turn_ephemeral_credentials-1.0.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

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