Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDir ¶
func ParseDir(dir string) ([]*ast.Module, []diagnostic.Diagnostic)
ParseDir parses all .rego files in the given directory using opa/ast.
Types ¶
type AllowRule ¶
type AllowRule struct {
Actions []string
Resource string
UsesOwner bool
UsesRole bool
RoleValue string
SourceLine int
}
AllowRule represents an extracted (action, resource) pair from an allow rule.
type OwnershipMapping ¶
type OwnershipMapping struct {
Resource string
Table string
Column string
JoinTable string
JoinFK string
}
OwnershipMapping represents a @ownership annotation.
type Policy ¶
type Policy struct {
File string
Rules []AllowRule
Ownerships []OwnershipMapping
ClaimsRefs []string
}
Policy represents parsed OPA Rego policy information.
func ParsePolicies ¶
func ParsePolicies(dir string) ([]Policy, []diagnostic.Diagnostic)
ParsePolicies parses all .rego files in dir and returns structured policies.
func ParsePolicyFile ¶
func ParsePolicyFile(path string) (*Policy, []diagnostic.Diagnostic)
ParsePolicyFile parses a single .rego file and extracts policy information.
Click to show internal directories.
Click to hide internal directories.