Skip to content

Generate time limited, i.e. ephemeral, long term credentials to authenticate against and use a TURN server

License

Notifications You must be signed in to change notification settings

p4irin/turn_ephemeral_credentials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

turn_username=credentials['turn_username']
turn_password=credentials['turn_password']

Reference

About

Generate time limited, i.e. ephemeral, long term credentials to authenticate against and use a TURN server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages