Fix comments for middlewares.
Cameron Stitt
6 years ago
44 | 44 | ) |
45 | 45 | |
46 | 46 | // NewSigner creates a new JWT token generating middleware, specifying key ID, |
47 | // signing string, signing method and the jwt.Claims you would like it to contain. | |
47 | // signing string, signing method and the claims you would like it to contain. | |
48 | 48 | // Tokens are signed with a Key ID header (kid) which is useful for determining |
49 | 49 | // the key to use for parsing. Particularly useful for clients. |
50 | 50 | func NewSigner(kid string, key []byte, method jwt.SigningMethod, claims jwt.Claims) endpoint.Middleware { |
66 | 66 | } |
67 | 67 | |
68 | 68 | // NewParser creates a new JWT token parsing middleware, specifying a |
69 | // jwt.Keyfunc interface, the signing method as well as the claims to parse into. | |
70 | // NewParserWithClaims adds the resulting claims to endpoint context or returns error on invalid token. | |
69 | // jwt.Keyfunc interface, the signing method and the claims type to be used. NewParser | |
70 | // adds the resulting claims to endpoint context or returns error on invalid token. | |
71 | 71 | // Particularly useful for servers. |
72 | 72 | func NewParser(keyFunc jwt.Keyfunc, method jwt.SigningMethod, claims jwt.Claims) endpoint.Middleware { |
73 | 73 | return func(next endpoint.Endpoint) endpoint.Endpoint { |