auth

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package auth implements authentication for gortcd.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrStaleNonce means that the nonce value should be refresh.
	ErrStaleNonce = errors.New("stale nonce")
)

Functions

This section is empty.

Types

type NonceAuth added in v0.15.0

type NonceAuth struct {
	// contains filtered or unexported fields
}

NonceAuth is nonce check and rotate implementation.

func NewNonceAuth added in v0.15.0

func NewNonceAuth(duration time.Duration) *NonceAuth

NewNonceAuth initializes new nonce manager.

TODO: Run timer that removes old nonces

func (*NonceAuth) Check added in v0.15.0

func (n *NonceAuth) Check(tuple turn.FiveTuple, value stun.Nonce, at time.Time) (stun.Nonce, error)

Check implements NonceManager.

type Static

type Static struct {
	// contains filtered or unexported fields
}

Static implements authentication with pre-defined static list of long-term credentials.

func NewStatic

func NewStatic(credentials []StaticCredential) *Static

NewStatic initializes new static authenticator with list of long-term credentials.

func (*Static) Auth

func (s *Static) Auth(m *stun.Message) (stun.MessageIntegrity, error)

Auth perform authentication of m and returns integrity that can be used to construct response to m.

type StaticCredential

type StaticCredential struct {
	Username string
	Password string
	Realm    string
	Key      []byte
}

StaticCredential wraps plain Username, Password and Realm, representing a long-term credential.

Jump to

Keyboard shortcuts

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