Codebase list golang-github-go-kit-kit / 8dcdcf9
Merge pull request #395 from go-kit/go-report-card-fixes Go report card fixes Peter Bourgon authored 7 years ago GitHub committed 7 years ago
2 changed file(s) with 10 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1414 // JWTTokenContextKey holds the key used to store a JWT Token in the
1515 // context.
1616 JWTTokenContextKey contextKey = "JWTToken"
17 // JWTClaimsContxtKey holds the key used to store the JWT Claims in the
17
18 // JWTClaimsContextKey holds the key used to store the JWT Claims in the
1819 // context.
1920 JWTClaimsContextKey contextKey = "JWTClaims"
2021 )
2324 // ErrTokenContextMissing denotes a token was not passed into the parsing
2425 // middleware's context.
2526 ErrTokenContextMissing = errors.New("token up for parsing was not passed through the context")
27
2628 // ErrTokenInvalid denotes a token was not able to be validated.
2729 ErrTokenInvalid = errors.New("JWT Token was invalid")
30
2831 // ErrTokenExpired denotes a token's expire header (exp) has since passed.
2932 ErrTokenExpired = errors.New("JWT Token is expired")
33
3034 // ErrTokenMalformed denotes a token was not formatted as a JWT token.
3135 ErrTokenMalformed = errors.New("JWT Token is malformed")
36
3237 // ErrTokenNotActive denotes a token's not before header (nbf) is in the
3338 // future.
3439 ErrTokenNotActive = errors.New("token is not valid yet")
35 // ErrUncesptedSigningMethod denotes a token was signed with an unexpected
40
41 // ErrUnexpectedSigningMethod denotes a token was signed with an unexpected
3642 // signing method.
3743 ErrUnexpectedSigningMethod = errors.New("unexpected signing method")
3844 )
3945
46 // Claims is a map of arbitrary claim data.
4047 type Claims map[string]interface{}
4148
4249 // NewSigner creates a new JWT token generating middleware, specifying key ID,
6666
6767 type mock struct {
6868 through int
69 err error
69 err error
7070 }
7171
7272 func (m *mock) endpoint(context.Context, interface{}) (interface{}, error) {