Documentation ¶
Index ¶
- Constants
- type Annotation
- type Clause
- type Edge
- type Lattice
- type Policy
- func (p *Policy) ApplyOn(an Annotation) bool
- func (p *Policy) LatticeName(s string) (string, error)
- func (p *Policy) LatticeValue(s string, name string) (string, error)
- func (p *Policy) ParseAnnotation(str string) (Annotation, error)
- func (p *Policy) ParseClause(str string) (Clause, error)
- func (p *Policy) ParsePolicy(pstr string) error
Constants ¶
const ( Top = "TOP" // the least upper bound (supremum) of a lattice Bottom = "BOTTOM" // the greatest lower bound (infimum) of a lattice )
const ( ALLOW = true DENY = false Allow = "ALLOW" Deny = "DENY" Except = "EXCEPT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation Clause
Annotation is an alias of Clause, which is used as metadata of a program block
type Clause ¶
type Clause []pair
Clause is a slice of pairs. There may be duplicate attributes in a policy clause, e.g. DataType IPAddress DataType AccountID
type Lattice ¶
type Lattice struct { Name string // Edges are the edge collections in lattice structure Edges []Edge // contains filtered or unexported fields }
func NewLattice ¶
NewLattice returns a Lattice instance that is parsed from a string
func NewLattices ¶
NewLattices returns a slice of Lattice instances that are parsed from a string
func (*Lattice) Allow ¶
Allow returns true when annotation attributes are allowed by policy clause T[c].
func (*Lattice) Deny ¶
Deny returns true when annotation attributes are denied by policy clause T[c] (⊥ ∉ Tₓ from paper)
type Policy ¶
Policy is composed of its mode, clause, and exceptions. It is based on some lattices.
func (*Policy) ApplyOn ¶
func (p *Policy) ApplyOn(an Annotation) bool
ApplyOn decides whether a policy can apply on an annotation true means annotation is allowed by the policy false means annotation is denied by the policy Note: refer to inferences rules in page 7
func (*Policy) LatticeName ¶
LatticeName returns a valid lattice name, or returns error
func (*Policy) LatticeValue ¶
LatticeValue returns a valid lattice value from its a dependant lattice, or returns error
func (*Policy) ParseAnnotation ¶
func (p *Policy) ParseAnnotation(str string) (Annotation, error)
ParseAnnotation returns an Annotation instance after parsing a string
func (*Policy) ParseClause ¶
ParseClause returns a Clause instance after parsing a string
func (*Policy) ParsePolicy ¶
ParsePolicy parses a policy string