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

Function authorizeRequest

edgraph/server.go:2018–2031  ·  view source on GitHub ↗
(ctx context.Context, qc *queryContext)

Source from the content-addressed store, hash-verified

2016}
2017
2018func authorizeRequest(ctx context.Context, qc *queryContext) error {
2019 if err := authorizeQuery(ctx, &qc.dqlRes, qc.graphql); err != nil {
2020 return err
2021 }
2022
2023 // TODO(Aman): can be optimized to do the authorization in just one func call
2024 for _, gmu := range qc.gmuList {
2025 if err := authorizeMutation(ctx, gmu); err != nil {
2026 return err
2027 }
2028 }
2029
2030 return nil
2031}
2032
2033func getHash(ns, startTs uint64) string {
2034 h := sha256.New()

Callers 1

doQueryMethod · 0.85

Calls 2

authorizeQueryFunction · 0.85
authorizeMutationFunction · 0.85

Tested by

no test coverage detected