Codebase list golang-github-go-kit-kit / 492a87e
auth/jwt: minor gofmt fixes hbc 6 years ago
1 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
6969 // Useful in NewParser middleware.
7070 type ClaimsFactory func() jwt.Claims
7171
72 // MapClaimsFactory is a ClaimsFactory that returns
72 // MapClaimsFactory is a ClaimsFactory that returns
7373 // an empty jwt.MapClaims.
7474 func MapClaimsFactory() jwt.Claims {
75 return jwt.MapClaims{}
75 return jwt.MapClaims{}
7676 }
7777
78 // StandardClaimsFactory is a ClaimsFactory that returns
78 // StandardClaimsFactory is a ClaimsFactory that returns
7979 // an empty jwt.StandardClaims.
8080 func StandardClaimsFactory() jwt.Claims {
81 return &jwt.StandardClaims{}
81 return &jwt.StandardClaims{}
8282 }
8383
8484 // NewParser creates a new JWT token parsing middleware, specifying a
8585 // jwt.Keyfunc interface, the signing method and the claims type to be used. NewParser
86 // adds the resulting claims to endpoint context or returns error on invalid token.
86 // adds the resulting claims to endpoint context or returns error on invalid token.
8787 // Particularly useful for servers.
8888 func NewParser(keyFunc jwt.Keyfunc, method jwt.SigningMethod, newClaims ClaimsFactory) endpoint.Middleware {
8989 return func(next endpoint.Endpoint) endpoint.Endpoint {