MCPcopy Create free account
hub / github.com/TalkingData/owl / parseToken

Function parseToken

api/token.go:63–76  ·  view source on GitHub ↗
(tokenString string)

Source from the content-addressed store, hash-verified

61}
62
63func parseToken(tokenString string) (*jwt.Token, error) {
64 token, err := jwt.ParseWithClaims(tokenString, jwt.MapClaims{}, func(token *jwt.Token) (interface{}, error) {
65 if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {
66 return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"])
67 }
68 return verifyKey, nil
69 })
70
71 if err != nil {
72 return nil, fmt.Errorf("jwt token error %s", err.Error())
73 }
74
75 return token, nil
76}

Callers 1

ValidateTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected