authentication

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package authentication contains the routines a TURN server checks STUNner authentication credentials with; the credentials themselves are generated by the auth policies of the API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTimeWindowedUsername

func CheckTimeWindowedUsername(username string) (string, error)

CheckTimeWindowedUsername checks the validity of an authentication credential. The method mostly follows the "REST API For Access To TURN Services" (https://datatracker.ietf.org/doc/html/draft-uberti-behave-turn-rest-00) spec with the exception that we make more effort to find out which component of the username is the UNIX timestamp: we find the first thing that looks like a UNIX timestamp in the username and use that for checking the time-windowed credential, and reject everything else.

func GenerateAuthKey

func GenerateAuthKey(username, realm, password string) []byte

GenerateAuthKey is a convenience function to easily generate keys in the format used by AuthHandler. Re-exported from `pion/turn` so that our callers will have a single import.

Types

type AuthHandler

type AuthHandler = turn.AuthHandler

AuthHandler specifies type of the TURN authentication handler used in Stunner. Re-exported from pion/turn for completeness.

type PermissionHandler

type PermissionHandler = turn.PermissionHandler

PermissionHandler specifies type of the TURN permission handler used in Stunner. Re-exported from pion/turn for completeness.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL