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

Function WithAuthorizationCredentials

x/x.go:1059–1061  ·  view source on GitHub ↗

WithAuthorizationCredentials adds Authorization: to every GRPC request This is mostly used by Slash GraphQL to authenticate requests

(authToken string)

Source from the content-addressed store, hash-verified

1057// WithAuthorizationCredentials adds Authorization: <api-token> to every GRPC request
1058// This is mostly used by Slash GraphQL to authenticate requests
1059func WithAuthorizationCredentials(authToken string) grpc.DialOption {
1060 return grpc.WithPerRPCCredentials(&authorizationCredentials{authToken})
1061}
1062
1063// GetDgraphClient creates a Dgraph client based on the following options in the configuration:
1064// --slash_grpc_endpoint specifies the grpc endpoint for slash. It takes precedence over --alpha and TLS

Callers 2

setupFunction · 0.92
GetDgraphClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected