You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered jwt claim parsing/validation code very frequently. Just an idea, but maybe we create a generic way to declaratively "validate" tokens by ensuring a set of claims/values. I kinda want a function I can call like:
var (
ErrorClaimMissing=...ErrorClaimMatchFailure=...ErrorClaimCheckInvalidType=......
)
typeClaimCheckstruct {
namestringvalueinterface{} // must be a supported claim type
}
wantClaims:= []ClaimCheck{
// no value, just checks for existenceClaimCheck {
name: "email",
},
// existence & equality checkClaimCheck {
name: "aud",
value: "some-clien-id",
},
}
valid, err:=jwt.HasExpected(wantClaims)
...
Thoughts?
The text was updated successfully, but these errors were encountered:
Issue by sym3tri
Tuesday Jun 30, 2015 at 19:45 GMT
Originally opened as https://github.com/coreos-inc/auth/issues/281
I've encountered jwt claim parsing/validation code very frequently. Just an idea, but maybe we create a generic way to declaratively "validate" tokens by ensuring a set of claims/values. I kinda want a function I can call like:
Thoughts?
The text was updated successfully, but these errors were encountered: