Documentation ¶
Index ¶
- Variables
- type AuthorizationModelEdge
- type AuthorizationModelGraph
- type AuthorizationModelGraphBuilder
- func (g *AuthorizationModelGraphBuilder) AddEdge(from, to graph.Node, edgeType EdgeType, conditionedOn string) *AuthorizationModelEdge
- func (g *AuthorizationModelGraphBuilder) GetNodeFor(uniqueLabel string) *AuthorizationModelNode
- func (g *AuthorizationModelGraphBuilder) GetOrAddNode(uniqueLabel, label string, nodeType NodeType) *AuthorizationModelNode
- func (g *AuthorizationModelGraphBuilder) HasEdge(from, to graph.Node, edgeType EdgeType, conditionedOn string) bool
- type AuthorizationModelNode
- type EdgeType
- type NodeType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBuildingGraph = errors.New("cannot build graph")
Functions ¶
This section is empty.
Types ¶
type AuthorizationModelEdge ¶
func (*AuthorizationModelEdge) Attributes ¶
func (n *AuthorizationModelEdge) Attributes() []encoding.Attribute
type AuthorizationModelGraph ¶
type AuthorizationModelGraph struct {
*multi.DirectedGraph
}
func NewAuthorizationModelGraph ¶
func NewAuthorizationModelGraph(model *openfgav1.AuthorizationModel) (*AuthorizationModelGraph, error)
NewAuthorizationModelGraph builds an authorization model in graph form. For example, types such as `group`, usersets such as `group#member` and wildcards `group:*` are encoded as nodes.
The edges are defined by the assignments, e.g. `define viewer: [group]` defines an edge from group to document#viewer. Conditions are not encoded in the graph, and the two edges in an exclusion are not distinguished.
func (*AuthorizationModelGraph) Attributes ¶
func (g *AuthorizationModelGraph) Attributes() []encoding.Attribute
func (*AuthorizationModelGraph) DOTAttributers ¶
func (g *AuthorizationModelGraph) DOTAttributers() (encoding.Attributer, encoding.Attributer, encoding.Attributer)
func (*AuthorizationModelGraph) GetDOT ¶
func (g *AuthorizationModelGraph) GetDOT() string
GetDOT returns the DOT visualization. The output text is stable. It should only be used for debugging.
type AuthorizationModelGraphBuilder ¶
type AuthorizationModelGraphBuilder struct { graph.DirectedMultigraphBuilder // contains filtered or unexported fields }
func (*AuthorizationModelGraphBuilder) AddEdge ¶
func (g *AuthorizationModelGraphBuilder) AddEdge(from, to graph.Node, edgeType EdgeType, conditionedOn string) *AuthorizationModelEdge
func (*AuthorizationModelGraphBuilder) GetNodeFor ¶
func (g *AuthorizationModelGraphBuilder) GetNodeFor(uniqueLabel string) *AuthorizationModelNode
func (*AuthorizationModelGraphBuilder) GetOrAddNode ¶
func (g *AuthorizationModelGraphBuilder) GetOrAddNode(uniqueLabel, label string, nodeType NodeType) *AuthorizationModelNode
type AuthorizationModelNode ¶
func (*AuthorizationModelNode) Attributes ¶
func (n *AuthorizationModelNode) Attributes() []encoding.Attribute
Click to show internal directories.
Click to hide internal directories.