MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / ReservedPredicateValueLock

Function ReservedPredicateValueLock

x/keys.go:786–791  ·  view source on GitHub ↗

ReservedPredicateValueLock reports whether pred's value is locked to a trusted writer and, if so, returns the context key (TrustMarker) that authorizes the write. The mutation-value guard rejects a write of a locked predicate when the request context does not carry that marker. pred is matched case

(pred string)

Source from the content-addressed store, hash-verified

784// those lookups it does not ParseAttr: the guard passes the bare predicate (no
785// namespace separator), matching how IsOtherReservedPredicate is consulted.
786func ReservedPredicateValueLock(pred string) (marker any, locked bool) {
787 reservedNsMu.RLock()
788 defer reservedNsMu.RUnlock()
789 marker, locked = reservedNsValueLocked[strings.ToLower(pred)]
790 return marker, locked
791}
792
793// TODO: rename this map to a better suited name as per its properties. It is not just for GraphQL
794// predicates, but for all those which are PreDefined and whose value is not allowed to be mutated

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80