auth

package
v0.0.0-...-177ec65 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package auth contains the authentication system.

Index

Constants

View Source
const (
	// PauseAfterError is the pause to apply after an authentication failure.
	PauseAfterError = 2 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string
}

Error is a authentication error.

func (Error) Error

func (e Error) Error() string

Error implements the error interface.

type Manager

type Manager struct {
	Method          conf.AuthMethod
	InternalUsers   []conf.AuthInternalUser
	HTTPAddress     string
	HTTPExclude     []conf.AuthInternalUserPermission
	JWTJWKS         string
	ReadTimeout     time.Duration
	RTSPAuthMethods []auth.ValidateMethod
	// contains filtered or unexported fields
}

Manager is the authentication manager.

func (*Manager) Authenticate

func (m *Manager) Authenticate(req *Request) error

Authenticate authenticates a request.

func (*Manager) ReloadInternalUsers

func (m *Manager) ReloadInternalUsers(u []conf.AuthInternalUser)

ReloadInternalUsers reloads InternalUsers.

type Protocol

type Protocol string

Protocol is a protocol.

const (
	ProtocolRTSP   Protocol = "rtsp"
	ProtocolRTMP   Protocol = "rtmp"
	ProtocolHLS    Protocol = "hls"
	ProtocolWebRTC Protocol = "webrtc"
	ProtocolSRT    Protocol = "srt"
)

protocols.

type Request

type Request struct {
	User   string
	Pass   string
	IP     net.IP
	Action conf.AuthAction

	// only for ActionPublish, ActionRead, ActionPlayback
	Path        string
	Protocol    Protocol
	ID          *uuid.UUID
	Query       string
	RTSPRequest *base.Request
	RTSPNonce   string
}

Request is an authentication request.

Jump to

Keyboard shortcuts

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