Commit 12342149 authored by Joe Bowers's avatar Joe Bowers

fixup: document parseAndVerifyTokenClaims behavior

parent 39ee1871
...@@ -448,6 +448,11 @@ type TokenClaims struct { ...@@ -448,6 +448,11 @@ type TokenClaims struct {
Claims jose.Claims Claims jose.Claims
} }
// Returns TokenClaims if and only if
// - the given token string is an appropriately formatted JWT
// - the JWT contains nonempty "aud" and "sub" claims
// - the JWT can be verified for the client associated with the "aud" claim
// using the given keys
func parseAndVerifyTokenClaims(token string, issuer url.URL, keys []key.PublicKey) (TokenClaims, error) { func parseAndVerifyTokenClaims(token string, issuer url.URL, keys []key.PublicKey) (TokenClaims, error) {
jwt, err := jose.ParseJWT(token) jwt, err := jose.ParseJWT(token)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment