Closed KendallWeihe closed 6 months ago
Created an issue for the additional idea https://github.com/TBD54566975/web5-go/issues/25
@KendallWeihe thoughts on renaming both DecodeJWSHeader
and DecodeJWTClaims
to jws.DecodeHeader
and jwt.DecodeClaims
respectively? the added JWS
and JWT
in function names feels redundant given the namespace provided by the packages
@KendallWeihe thoughts on renaming both
DecodeJWSHeader
andDecodeJWTClaims
tojws.DecodeHeader
andjwt.DecodeClaims
respectively? the addedJWS
andJWT
in function names feels redundant given the namespace provided by the packages
Yeah nice, agreed! Done ✅
Overview
Given the developer has a JWT, and they extract the base64 URL encoded claims, they can call this function to decode into the
Claims
typeUsage
Additional Ideas
I followed the same pattern as we have with
jws.DecodeJWSHeader()
from here. But, we may want to go a add another layer here. Namely, the developer consuming this library (let's call them Alice), will likely have a full signed JWT string (which may originate from ourjwt.Sign()
function). And Alice may want both the headers & the claims (often times specs such as OID4VCI have verification rulesets which include both the header & the claims).Rather than having the developer first do this...
...we may want to embed that in a function, as well as also executing a call to
jwt.Verify()
. I originally had the idea that we could create a function like this...@mistermoe what do you think of that idea ☝️ We can open a ticket & copy/paste this in if we like it.