Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilAuthenticator = errors.New("authenticator cannot be nil") ErrInvalidAuthorizationHeader = gonethttpresponse.NewHeaderError( gojwtnethttp.AuthorizationHeaderKey, "invalid authorization header", http.StatusUnauthorized, ErrCodeInvalidAuthorizationHeader, ) )
View Source
var (
ErrCodeInvalidAuthorizationHeader *string
)
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface { Authenticate( interception gojwtinterception.Interception, ) func(next http.Handler) http.Handler }
Authenticator interface
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware struct
func NewMiddleware ¶
func NewMiddleware( validator gojwtvalidator.Validator, handler gonethttphandler.Handler, jwtValidatorFailHandler gonethttpjwtvalidator.FailHandler, ) (*Middleware, error)
NewMiddleware creates a new authentication middleware
func (*Middleware) Authenticate ¶
func (m *Middleware) Authenticate( interception gojwtinterception.Interception, ) func(next http.Handler) http.Handler
Authenticate return the middleware function that authenticates the request
Click to show internal directories.
Click to hide internal directories.