checkutil

package
v1.8.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTupleKeyConditionFilter

func BuildTupleKeyConditionFilter(ctx context.Context, reqCtx *structpb.Struct, typesys *typesystem.TypeSystem) storage.TupleKeyConditionFilterFunc

BuildTupleKeyConditionFilter returns the TupleKeyConditionFilterFunc for which, together with the tuple key, evaluates whether condition is met.

func IteratorReadStartingFromUser

func IteratorReadStartingFromUser(ctx context.Context,
	typesys *typesystem.TypeSystem,
	ds storage.RelationshipTupleReader,
	req resolveCheckRequest,
	objectRel string,
	objectIDs storage.SortedSet,
	sortContextualTuples bool) (storage.TupleKeyIterator, error)

IteratorReadStartingFromUser returns storage iterator for user with request's type and relation with specified objectIDs as filter.

func ObjectIDInSortedSet

func ObjectIDInSortedSet(ctx context.Context, iter storage.TupleKeyIterator, objectIDs storage.SortedSet) (bool, error)

ObjectIDInSortedSet returns whether any of the object IDs in the tuples given by the iterator is in the input set of objectIDs.

Types

type UsersetDetailsFunc

type UsersetDetailsFunc func(*openfgav1.TupleKey) (string, string, error)

func BuildUsersetDetailsTTU

func BuildUsersetDetailsTTU(typesys *typesystem.TypeSystem, computedRelation string) UsersetDetailsFunc

BuildUsersetDetailsTTU given (tuple doc:1#viewer@group:2, member) will return group#member, 2, nil. This util takes into account computed relationships, otherwise it will resolve it from the target UserType. nolint:unused

func BuildUsersetDetailsUserset

func BuildUsersetDetailsUserset(typesys *typesystem.TypeSystem) UsersetDetailsFunc

BuildUsersetDetailsUserset given tuple doc:1#viewer@group:2#member will return group#member, 2, nil.

type V2RelationFunc added in v1.8.3

type V2RelationFunc func(*openfgav1.RelationReference) string

func BuildTTUV2RelationFunc added in v1.8.3

func BuildTTUV2RelationFunc(computedRelation string) V2RelationFunc

BuildTTUV2RelationFunc will always return the computedRelation regardless of the reference.

func BuildUsersetV2RelationFunc added in v1.8.3

func BuildUsersetV2RelationFunc() V2RelationFunc

BuildUsersetV2RelationFunc returns the reference's relation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL