auth

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireRole added in v1.4.0

func RequireRole(allowedRoles ...models.Role) gin.HandlerFunc

RequireRole checks if the authenticated user has one of the allowed roles

Types

type LocalAuthenticator

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

func NewLocalAuthenticator

func NewLocalAuthenticator(cfg *config.Config) *LocalAuthenticator

func (*LocalAuthenticator) GenerateStreamToken added in v1.3.1

func (a *LocalAuthenticator) GenerateStreamToken(cameraID string) (string, error)

GenerateStreamToken создает короткоживущий токен для доступа к потоку камеры

func (*LocalAuthenticator) Login

func (a *LocalAuthenticator) Login(c *gin.Context)

func (*LocalAuthenticator) Middleware

func (a *LocalAuthenticator) Middleware() gin.HandlerFunc

func (*LocalAuthenticator) StreamMiddleware added in v1.3.1

func (a *LocalAuthenticator) StreamMiddleware() gin.HandlerFunc

StreamMiddleware проверяет короткоживущие токены для видео-потоков

type Request

type Request struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Request модель запроса логина

Jump to

Keyboard shortcuts

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