(jwtToken string)
| 53 | } |
| 54 | |
| 55 | func ExtractUserName(jwtToken string) (string, error) { |
| 56 | claims, err := ParseJWT(jwtToken) |
| 57 | if err != nil { |
| 58 | return "", err |
| 59 | } |
| 60 | userId, ok := claims["userid"].(string) |
| 61 | if !ok { |
| 62 | return "", errors.Errorf("userid in claims is not a string:%v", userId) |
| 63 | } |
| 64 | |
| 65 | return userId, nil |
| 66 | } |
| 67 | |
| 68 | func ExtractNamespaceFromJwt(jwtToken string) (uint64, error) { |
| 69 | claims, err := ParseJWT(jwtToken) |
no test coverage detected