auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMustAuthenticate = errors.New("must authenticate")
	ErrMsgEmptyList     = errors.New("empty list")
)

Functions

This section is empty.

Types

type Middleware

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

func NewMiddleware

func NewMiddleware(scaled *config.Scaled) *Middleware

func (*Middleware) AuthMiddleware

func (m *Middleware) AuthMiddleware(handler http.Handler) http.Handler

func (*Middleware) GetTokenFromRequest

func (m *Middleware) GetTokenFromRequest(tokenAuthValue string) (*mgmtv1.Token, error)

func (*Middleware) GetUserByName

func (m *Middleware) GetUserByName(username string) (*mgmtv1.User, error)

func (*Middleware) GetUserInfoFromToken

func (m *Middleware) GetUserInfoFromToken(tokenStr string) (authUser.Info, error)

func (*Middleware) TokenIndexByTokenKey

func (m *Middleware) TokenIndexByTokenKey(tokenKey string) (*mgmtv1.Token, error)

func (*Middleware) UserIndexByUserName

func (m *Middleware) UserIndexByUserName(name string) (*mgmtv1.User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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