MCPcopy Index your code
hub / github.com/smallstep/cli / Parse

Function Parse

token/parse.go:139–151  ·  view source on GitHub ↗

Parse parses the given token verifying the signature with the key.

(token string, key interface{})

Source from the content-addressed store, hash-verified

137
138// Parse parses the given token verifying the signature with the key.
139func Parse(token string, key interface{}) (*JSONWebToken, error) {
140 jwt, err := jose.ParseSigned(token)
141 if err != nil {
142 return nil, errors.Wrap(err, "error parsing token")
143 }
144
145 var p Payload
146 if err := jwt.Claims(key, &p); err != nil {
147 return nil, errors.Wrap(err, "error parsing token claims")
148 }
149
150 return parseResponse(jwt, p)
151}
152
153// ParseInsecure parses the given token.
154func ParseInsecure(token string) (*JSONWebToken, error) {

Callers 1

TestParseFunction · 0.85

Calls 1

parseResponseFunction · 0.85

Tested by 1

TestParseFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…