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

Function ExtractNamespaceHTTP

x/x.go:253–258  ·  view source on GitHub ↗

ExtractNamespaceHTTP parses the namespace value from the incoming HTTP request.

(r *http.Request)

Source from the content-addressed store, hash-verified

251
252// ExtractNamespaceHTTP parses the namespace value from the incoming HTTP request.
253func ExtractNamespaceHTTP(r *http.Request) uint64 {
254 ctx := AttachAccessJwt(context.Background(), r)
255 // Ignoring error because the default value is zero anyways.
256 namespace, _ := ExtractNamespaceFrom(ctx)
257 return namespace
258}
259
260// ExtractNamespace parses the namespace value from the incoming gRPC context. For the non-ACL mode,
261// it is caller's responsibility to set the galaxy namespace.

Callers 4

graphqlProbeHandlerFunction · 0.92
setupServerFunction · 0.92
auditHttpFunction · 0.92
SubscribeMethod · 0.92

Calls 2

AttachAccessJwtFunction · 0.85
ExtractNamespaceFromFunction · 0.85

Tested by

no test coverage detected