Documentation
¶
Overview ¶
Package jwtservice provides a standardized way to generate, verify, and authenticate JWT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service defines the JWT service structure
func (*Service) ApplyMiddleware ¶
func (s *Service) ApplyMiddleware(router *chi.Mux)
ApplyMiddleware append Verifier and Authenticator middleware to the Mux middleware stack
func (*Service) ClaimsFromRequest ¶
ClaimsFromRequest parses token claims from request token
type ServiceOption ¶
type ServiceOption func(*Service)
ServiceOption defines functions for configuring JWT service
func WithCustomAuth ¶
func WithCustomAuth(auth *jwtauth.JWTAuth) ServiceOption
WithCustomAuth this allows overriding the default JWT auth instance
func WithExpiration ¶
func WithExpiration(exp time.Duration) ServiceOption
WithExpiration is an option to set the token expiration using time duration (default: 24 * time.Hour)
Click to show internal directories.
Click to hide internal directories.