MCPcopy
hub / github.com/dgraph-io/dgraph / ExtractJwt

Function ExtractJwt

x/x.go:299–311  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

297}
298
299func 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
313func ExtractTraceContext(ctx context.Context) context.Context {
314 if md, ok := metadata.FromIncomingContext(ctx); ok {

Callers 6

ProcessPersistedQueryFunction · 0.92
extractUserAndGroupsFunction · 0.92
sendWebhookEventFunction · 0.92
GetBodyForLambdaFunction · 0.92
extractNameFunction · 0.92
ExtractNamespaceFromFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected