Documentation
¶
Index ¶
- Constants
- Variables
- func WildcardRelationReference(objectType string) *openfgav1.RelationReference
- type AuthorizationModelGraph
- func (m *AuthorizationModelGraph) CanApplyRecursion(node *authzGraph.WeightedAuthorizationModelNode, userType string, ...) (*authzGraph.WeightedAuthorizationModelEdge, bool)
- func (m *AuthorizationModelGraph) FlattenNode(node *authzGraph.WeightedAuthorizationModelNode, userType string, ...) ([]*authzGraph.WeightedAuthorizationModelEdge, error)
- func (m *AuthorizationModelGraph) GetConditions() map[string]*condition.EvaluableCondition
- func (m *AuthorizationModelGraph) GetDirectEdgeFromNodeForUserType(objectRelation string, userType string) (*authzGraph.WeightedAuthorizationModelEdge, error)
- func (m *AuthorizationModelGraph) GetModelID() string
- type AuthorizationModelGraphResolver
Constants ¶
View Source
const CacheKeyPrefix = "wg|"
View Source
const DELIMITER = "|"
Variables ¶
View Source
var ErrGraphError = errors.New("authorization model graph error")
View Source
var ErrInvalidModel = errors.New("invalid authorization model encountered")
View Source
var ErrModelNotFound = errors.New("authorization model not found")
Functions ¶
func WildcardRelationReference ¶
func WildcardRelationReference(objectType string) *openfgav1.RelationReference
Types ¶
type AuthorizationModelGraph ¶
type AuthorizationModelGraph struct {
*authzGraph.WeightedAuthorizationModelGraph
// contains filtered or unexported fields
}
func New ¶
func New(model *openfgav1.AuthorizationModel) (*AuthorizationModelGraph, error)
func (*AuthorizationModelGraph) CanApplyRecursion ¶
func (m *AuthorizationModelGraph) CanApplyRecursion(node *authzGraph.WeightedAuthorizationModelNode, userType string, newstrategy bool) (*authzGraph.WeightedAuthorizationModelEdge, bool)
func (*AuthorizationModelGraph) FlattenNode ¶
func (m *AuthorizationModelGraph) FlattenNode(node *authzGraph.WeightedAuthorizationModelNode, userType string, hasWildcardRequest bool, recursivePath bool) ([]*authzGraph.WeightedAuthorizationModelEdge, error)
func (*AuthorizationModelGraph) GetConditions ¶
func (m *AuthorizationModelGraph) GetConditions() map[string]*condition.EvaluableCondition
func (*AuthorizationModelGraph) GetDirectEdgeFromNodeForUserType ¶
func (m *AuthorizationModelGraph) GetDirectEdgeFromNodeForUserType(objectRelation string, userType string) (*authzGraph.WeightedAuthorizationModelEdge, error)
func (*AuthorizationModelGraph) GetModelID ¶
func (m *AuthorizationModelGraph) GetModelID() string
type AuthorizationModelGraphResolver ¶
type AuthorizationModelGraphResolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver(datastore storage.AuthorizationModelReadBackend, cache storage.InMemoryCache[any], ttl time.Duration) *AuthorizationModelGraphResolver
func (*AuthorizationModelGraphResolver) Resolve ¶
func (r *AuthorizationModelGraphResolver) Resolve(ctx context.Context, storeID, modelID string) (*AuthorizationModelGraph, error)
Click to show internal directories.
Click to hide internal directories.