auth

package
v0.0.0-...-eeb60d1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptySecretKey = errors.New("Secret key for auth module should not be empty")
View Source
var ErrInvalidUserObjectType = errors.New("Could not cast object to user")
View Source
var ErrNilUserRepo = errors.New("User repository should not be nil for auth module creation")
View Source
var ErrUserObjectNotFound = errors.New("User object not found in gin context")

Functions

func GetUserFromContext

func GetUserFromContext(c *gin.Context) (models.UserWithPassword, error)

Types

type Auth

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

func NewAuth

func NewAuth(userRepository *user.UserRepository, secretKey, identityKey, realm string, timeout, maxRefresh time.Duration) (*Auth, error)

func (*Auth) GetGinAuthMiddleware

func (a *Auth) GetGinAuthMiddleware() *jwt.GinJWTMiddleware

func (*Auth) Middleware

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

func (*Auth) RegisterRoutes

func (a *Auth) RegisterRoutes(group *gin.RouterGroup)

func (*Auth) RegisterUserHandler

func (a *Auth) RegisterUserHandler() gin.HandlerFunc

Jump to

Keyboard shortcuts

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