Documentation
¶
Index ¶
- Variables
- func ConvertTokenToJson(tok *jwt.JSONWebToken, options JwtInspectOutputOptions) (string, error)
- func ConvertTokenToSummary(tok *jwt.JSONWebToken, options JwtInspectOutputOptions) (string, error)
- func ConvertTokenToYaml(tok *jwt.JSONWebToken, options JwtInspectOutputOptions) (string, error)
- func DeserializeJwt(serialized string) (*jwt.JSONWebToken, error)
- type JwtInspectOutputOptions
- type JwtInspector
Constants ¶
This section is empty.
Variables ¶
View Source
var AllSignatureAlgorithms = maps.Keys(SignatureAlgorithmDescriptions)
View Source
var FormatMap = map[string]inspect.Formatter[*jwt.JSONWebToken, JwtInspectOutputOptions]{ "json": {Label: "JSON", Lexer: "json", Converter: ConvertTokenToJson}, "yaml": {Label: "YAML", Lexer: "yaml", Converter: ConvertTokenToYaml}, "summary": {Label: "Summary", Lexer: "text", Converter: ConvertTokenToSummary}, }
View Source
var SignatureAlgorithmDescriptions = map[jose.SignatureAlgorithm]string{ jose.ES256: "ECDSA using P-256 curve and SHA-256", jose.ES384: "ECDSA using P-384 curve and SHA-384", jose.ES512: "ECDSA using P-521 curve and SHA-512", jose.RS256: "RSASSA-PKCS1-v1_5 using SHA-256", jose.RS384: "RSASSA-PKCS1-v1_5 using SHA-384", jose.RS512: "RSASSA-PKCS1-v1_5 using SHA-512", jose.PS256: "RSASSA-PSS using SHA-256 and MGF1-SHA-256", jose.PS384: "RSASSA-PSS using SHA-384 and MGF1-SHA-384", jose.PS512: "RSASSA-PSS using SHA-512 and MGF1-SHA-512", jose.EdDSA: "EdDSA using Ed25519", jose.HS256: "HMAC using SHA-256", jose.HS384: "HMAC using SHA-384", jose.HS512: "HMAC using SHA-512", }
This includes that are not supported by JWT-SVID
View Source
var SvidSignatureAlgorithms = []jose.SignatureAlgorithm{ jose.RS256, jose.RS384, jose.RS512, jose.ES256, jose.ES384, jose.ES512, jose.PS256, jose.PS384, jose.PS512, }
Supported as per JWT-SVID spec
Functions ¶
func ConvertTokenToJson ¶
func ConvertTokenToJson(tok *jwt.JSONWebToken, options JwtInspectOutputOptions) (string, error)
func ConvertTokenToSummary ¶
func ConvertTokenToSummary(tok *jwt.JSONWebToken, options JwtInspectOutputOptions) (string, error)
func ConvertTokenToYaml ¶
func ConvertTokenToYaml(tok *jwt.JSONWebToken, options JwtInspectOutputOptions) (string, error)
func DeserializeJwt ¶
func DeserializeJwt(serialized string) (*jwt.JSONWebToken, error)
TODO: At some point we'll want to add support for encrypted JWTs, as well as "none" JWTs. We'd want to detect either of these. For encrypted JWTs the user would have to pass a key.
Types ¶
type JwtInspectOutputOptions ¶
func (JwtInspectOutputOptions) InColor ¶
func (o JwtInspectOutputOptions) InColor() bool
type JwtInspector ¶
type JwtInspector struct {
Filename string
IsSvid bool
OutputFormat string
OutputOptions JwtInspectOutputOptions
}
func (*JwtInspector) Inspect ¶
func (i *JwtInspector) Inspect() (string, error)
Click to show internal directories.
Click to hide internal directories.