-
-
Save ericlagergren/1f5f4283ec212d0f4c8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// package jwt | |
type Claims map[string]interface{} | |
type JWT interface{ | |
GetClaims() Claims | |
} | |
func Parse(b []byte) JWT { | |
// heuristics | |
if isJWE { | |
return jwe.New() | |
} | |
return jws.New() | |
} | |
// package jwe | |
type JWE struct {} | |
func (j *JWE) GetClaims() jwt.Claims { ... } | |
// package jws | |
type JWS struct {} | |
func (j *JWS) GetClaims() jwt.Claims { ... } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment