Documentation
¶
Overview ¶
Package opa provides a high-level client for using embedded Rego policies with OPA
Index ¶
- func Modules(modules ...Module) func(r *rego.Rego)
- func NewOptimizedQuery(ctx context.Context, query string, options ...func(r *rego.Rego)) (rego.PartialResult, error)
- func NewPartialEvalQuery(ctx context.Context, query string, unknowns []string, ...) (rego.PreparedPartialQuery, error)
- func ParseExpression(expr *ast.Expr, dbName string) (selection selectionExpression, err error)
- type Client
- func (c *Client) EvalAllow(ctx context.Context, input map[string]interface{}) (allow bool, err error)
- func (c *Client) EvalAllowContextual(ctx context.Context, input map[string]interface{}) (allow bool, remainingQueries []ast.Body, err error)
- func (c *Client) EvalError(ctx context.Context, input map[string]interface{}) (authzErr error, evalErr error)
- type ExistsConjunction
- type ExistsConjunctionDisjunction
- type ExistsDNFStatement
- type ExistsExpression
- type Input
- type Module
- type Operation
- type Resource
- type SQLiteTranspiler
- type SelectionStatement
- type Statement
- type Subject
- type WhereClause
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOptimizedQuery ¶
func NewPartialEvalQuery ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) EvalAllowContextual ¶
type ExistsConjunction ¶
type ExistsConjunction []ExistsExpression
func ParseQuery ¶
func ParseQuery( query ast.Body, dbName string, ) (conjunction ExistsConjunction, err error)
func (ExistsConjunction) NamedParams ¶
func (c ExistsConjunction) NamedParams() map[string]interface{}
func (ExistsConjunction) String ¶
func (c ExistsConjunction) String() string
type ExistsConjunctionDisjunction ¶
type ExistsConjunctionDisjunction []ExistsConjunction
func ParseQueries ¶
func ParseQueries( queries []ast.Body, dbName string, ) (disjunction ExistsConjunctionDisjunction, err error)
func (ExistsConjunctionDisjunction) NamedParams ¶
func (d ExistsConjunctionDisjunction) NamedParams() map[string]interface{}
func (ExistsConjunctionDisjunction) String ¶
func (d ExistsConjunctionDisjunction) String() string
type ExistsDNFStatement ¶
type ExistsDNFStatement struct { // A select statement in disjunctive normal form Disjunction ExistsConjunctionDisjunction ResultName string }
func (ExistsDNFStatement) NamedParams ¶
func (s ExistsDNFStatement) NamedParams() map[string]interface{}
func (ExistsDNFStatement) String ¶
func (s ExistsDNFStatement) String() string
type ExistsExpression ¶
type ExistsExpression struct {
Selection SelectionStatement
}
func (ExistsExpression) NamedParams ¶
func (s ExistsExpression) NamedParams() map[string]interface{}
func (ExistsExpression) String ¶
func (s ExistsExpression) String() string
type Resource ¶
func NewResource ¶
type SQLiteTranspiler ¶
type SQLiteTranspiler struct {
DBName string
}
func NewSQLiteTranspiler ¶
func NewSQLiteTranspiler(dbName string) SQLiteTranspiler
func (SQLiteTranspiler) Parse ¶
func (t SQLiteTranspiler) Parse(queries []ast.Body) (statement ExistsDNFStatement, err error)
type SelectionStatement ¶
type SelectionStatement struct { Table string Columns string WhereConjunction []WhereClause }
func (SelectionStatement) NamedParams ¶
func (s SelectionStatement) NamedParams() map[string]interface{}
func (SelectionStatement) String ¶
func (s SelectionStatement) String() string
type Subject ¶
func NewSubject ¶
type WhereClause ¶
func (WhereClause) NamedParams ¶
func (c WhereClause) NamedParams() map[string]interface{}
func (WhereClause) ParamName ¶
func (c WhereClause) ParamName() string
func (WhereClause) String ¶
func (c WhereClause) String() string
Click to show internal directories.
Click to hide internal directories.