Documentation
¶
Index ¶
- func AuthHeaderTokenExtractor(r *http.Request) (string, error)
- func CORSOptionsHandleFunc(methods string, headers string) func(http.ResponseWriter, *http.Request)
- func Serve(path []string, method []string, ...)
- func ServeJWT(path []string, method []string, ...)
- func Vars(r *http.Request) map[string]string
- type JWTClaims
- type JWTContextKey
- type JWTValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthHeaderTokenExtractor ¶ added in v0.0.6
AuthHeaderTokenExtractor is a TokenExtractor that takes a request and extracts the token from the Authorization header.
func CORSOptionsHandleFunc ¶ added in v0.0.8
CORSOptionsHandleFunc set CORS headers for the preflight request CORSEnabledFunction is an example of setting CORS headers. For more information about CORS and CORS preflight requests, see https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request.
func Serve ¶
func Serve(path []string, method []string, handle []func(http.ResponseWriter, *http.Request), mwf ...mux.MiddlewareFunc)
Types ¶
type JWTClaims ¶ added in v0.0.6
func NewJWTClaims ¶ added in v0.0.6
type JWTContextKey ¶ added in v0.0.7
type JWTContextKey struct{}
ContextKey is the key used in the request context where the information from a validated JWT will be stored.
type JWTValidator ¶ added in v0.0.6
type JWTValidator struct {
// contains filtered or unexported fields
}
func GetJWTValidator ¶ added in v0.0.6
func GetJWTValidator() *JWTValidator
func (*JWTValidator) CheckJWT ¶ added in v0.0.6
func (v *JWTValidator) CheckJWT(next http.Handler) http.Handler
func (*JWTValidator) VerifyToken ¶ added in v0.0.6
func (v *JWTValidator) VerifyToken(token string) (*JWTClaims, error)
Click to show internal directories.
Click to hide internal directories.