middleware

package
v0.0.0-...-422268b Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthHeaderEmpty           = errors.New("authorization header is not provided")
	ErrAuthHeaderInvalidFormat   = errors.New("invalid authorization header format")
	ErrAuthHeaderUnsupportedType = errors.New("unsupported authorization type")
	ErrUserDeletedOrBanned       = errors.New("user has been deleted or banned")
)

Functions

func RequireAuth

func RequireAuth(repo AuthRepository, tokenMaker core.TokenMakerComponent) gin.HandlerFunc

Types

type AuthRepository

type AuthRepository interface {
	GetUserByID(ctx context.Context, id int) (*entity.User, error)
}

Jump to

Keyboard shortcuts

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