MCPcopy Create free account
hub / github.com/koding/kite / ParseFile

Function ParseFile

kitekey/kitekey.go:94–101  ·  view source on GitHub ↗

ParseFile reads the given kite key file and parses it as a JWT token.

(file string)

Source from the content-addressed store, hash-verified

92
93// ParseFile reads the given kite key file and parses it as a JWT token.
94func ParseFile(file string) (*jwt.Token, error) {
95 kiteKey, err := ioutil.ReadFile(file)
96 if err != nil {
97 return nil, err
98 }
99
100 return jwt.ParseWithClaims(string(bytes.TrimSpace(kiteKey)), &KiteClaims{}, GetKontrolKey)
101}
102
103// Extractor is used to extract kontrol key from JWT token.
104type Extractor struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected