Documentation ¶
Index ¶
- func DoFilter(handler http.Handler) http.Handler
- func Generate(signingMethod string, claims jwt.Claims, tokenKey []byte) (token string, err error)
- func GenerateWithDefault(claims jwt.Claims) (token string, err error)
- func IsValid(token string, tokenKey []byte) bool
- func IsValidDefault(token string) bool
- func ParseToken(headerValue string, tokenKey []byte) (claims jwt.Claims, err error)
- func ParseTokenDefault(headerValue string) (claims jwt.Claims, err error)
- func ParseTokenWithClaims(headerValue string, claims jwt.Claims, tokenKey []byte) (err error)
- func ParseTokenWithClaimsDefault(headerValue string, claims jwt.Claims) (err error)
- func RefreshToken(token string, tokenKey []byte) (newToken string, err error)
- func RefreshWithDefault(token string) (newToken string, err error)
- type MiniClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateWithDefault ¶
GenerateWithDefault generate with the signing method and key that was set in the os environment variables, refer to init(...) above on what and how the environment variables are set.
func IsValidDefault ¶
IsValidDefault checks if the given token is a valid token with the key in os env.
func ParseToken ¶
ParseToken parse the given header value to a claim using the given key
func ParseTokenDefault ¶
ParseTokenDefault parse the given header value to a claim using the key in the os env.
func ParseTokenWithClaims ¶
ParseTokenWithClaims parse the given header value to the given claim using the given key
func ParseTokenWithClaimsDefault ¶
ParseTokenWithClaimsDefault parse the given header value to the given claim using the key in the os env.
func RefreshToken ¶
RefreshToken reset the given token expiration time for the given key to future time
func RefreshWithDefault ¶
RefreshWithDefault reset the given token expiration time for the given key to future time
Types ¶
type MiniClaims ¶
type MiniClaims struct { Data jwt.MapClaims jwt.StandardClaims }
MiniClaims as claim for jwt