(ctx context.Context)
| 297 | } |
| 298 | |
| 299 | func ExtractJwt(ctx context.Context) (string, error) { |
| 300 | // extract the jwt and unmarshal the jwt to get the list of groups |
| 301 | md, ok := metadata.FromIncomingContext(ctx) |
| 302 | if !ok { |
| 303 | return "", ErrNoJwt |
| 304 | } |
| 305 | accessJwt := md.Get("accessJwt") |
| 306 | if len(accessJwt) == 0 { |
| 307 | return "", ErrNoJwt |
| 308 | } |
| 309 | |
| 310 | return accessJwt[0], nil |
| 311 | } |
| 312 | |
| 313 | func ExtractTraceContext(ctx context.Context) context.Context { |
| 314 | if md, ok := metadata.FromIncomingContext(ctx); ok { |
no test coverage detected