middlewares

package
v0.0.0-...-3a2f251 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuthenticatedUser

func CheckAuthenticatedUser(config *apiConfig.Config, mongo *database.MongoDB) gin.HandlerFunc

func SSEHeaders

func SSEHeaders() gin.HandlerFunc

func ValidateUser

func ValidateUser(token string, config *apiConfig.Config, mongo *database.MongoDB) (models.User, error)

Types

type AuthStrategy

type AuthStrategy interface {
	ValidateUser(token string, config *apiConfig.Config, mongo *database.MongoDB) (models.User, error)
}

type ExternalAuthStrategy

type ExternalAuthStrategy struct{}

func (*ExternalAuthStrategy) ValidateUser

func (e *ExternalAuthStrategy) ValidateUser(token string, config *apiConfig.Config, _ *database.MongoDB) (models.User,
	error)

type LocalAuthStrategy

type LocalAuthStrategy struct{}

func (*LocalAuthStrategy) ValidateUser

func (l *LocalAuthStrategy) ValidateUser(token string, config *apiConfig.Config, mongo *database.MongoDB) (models.User,
	error)

Jump to

Keyboard shortcuts

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