Documentation ¶
Index ¶
- Variables
- type Middleware
- func (m *Middleware) AuthMiddleware(handler http.Handler) http.Handler
- func (m *Middleware) GetTokenFromRequest(tokenAuthValue string) (*mgmtv1.Token, error)
- func (m *Middleware) GetUserByName(username string) (*mgmtv1.User, error)
- func (m *Middleware) GetUserInfoFromToken(tokenStr string) (authUser.Info, error)
- func (m *Middleware) TokenIndexByTokenKey(tokenKey string) (*mgmtv1.Token, error)
- func (m *Middleware) UserIndexByUserName(name string) (*mgmtv1.User, error)
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)
Click to show internal directories.
Click to hide internal directories.