parser

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PR is an abbreviation for 'present'.
	PR CompareOperator = "pr"
	// EQ is an abbreviation for 'equals'.
	EQ CompareOperator = "eq"
	// NE is an abbreviation for 'not equals'.
	NE CompareOperator = "ne"
	// CO is an abbreviation for 'contains'.
	CO CompareOperator = "co"
	// IN is an abbreviation for 'in'.
	IN CompareOperator = "in"
	// SW is an abbreviation for 'starts with'.
	SW CompareOperator = "sw"
	// EW an abbreviation for 'ends with'.
	EW CompareOperator = "ew"
	// GT is an abbreviation for 'greater than'.
	GT CompareOperator = "gt"
	// LT is an abbreviation for 'less than'.
	LT CompareOperator = "lt"
	// GE is an abbreviation for 'greater or equal than'.
	GE CompareOperator = "ge"
	// LE is an abbreviation for 'less or equal than'.
	LE CompareOperator = "le"

	// IS allows comparison of Object/Resource Types - added for Cedar compat
	IS CompareOperator = "is"

	// AND is the logical operation and (&&).
	AND LogicalOperator = "and"
	// OR is the logical operation or (||).
	OR LogicalOperator = "or"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeExpression

type AttributeExpression struct {
	AttributePath types.Value
	Operator      CompareOperator
	CompareValue  types.Value
}

func (AttributeExpression) Dif added in v0.7.0

func (e AttributeExpression) Dif() string

func (AttributeExpression) GetEntityPaths added in v0.8.0

func (e AttributeExpression) GetEntityPaths() []types.Entity

GetEntityPaths checks AttributePath and CompareValue operands to see if an attribute is detected. If detected, the parsed Entity value is returned for the operand

func (AttributeExpression) String

func (e AttributeExpression) String() string

type CompareOperator

type CompareOperator string

type Expression

type Expression interface {
	String() string
	Dif() string
	// contains filtered or unexported methods
}

func NewAttributeExpression added in v0.8.0

func NewAttributeExpression(attributePath string, operator CompareOperator, compareValue string) (Expression, error)

func ParseFilter

func ParseFilter(expression string) (Expression, error)

ParseFilter parses a SCIM-like (RFC7644) filter expression string and returns an AST as an Expression

type LogicalExpression

type LogicalExpression struct {
	Operator    LogicalOperator
	Left, Right Expression
}

func (LogicalExpression) Dif added in v0.7.0

func (e LogicalExpression) Dif() string

func (LogicalExpression) String

func (e LogicalExpression) String() string

type LogicalOperator

type LogicalOperator string

type NotExpression

type NotExpression struct {
	Expression Expression
}

func (NotExpression) Dif added in v0.7.0

func (e NotExpression) Dif() string

func (NotExpression) String

func (e NotExpression) String() string

type PrecedenceExpression

type PrecedenceExpression struct {
	Expression Expression
}

func (PrecedenceExpression) Dif added in v0.7.0

func (PrecedenceExpression) String

func (e PrecedenceExpression) String() string

type ValuePathExpression

type ValuePathExpression struct {
	Attribute    types.Entity
	SubAttr      *string
	VPathFilter  Expression
	Operator     *CompareOperator
	CompareValue types.Value
}

func (ValuePathExpression) Dif added in v0.7.0

func (e ValuePathExpression) Dif() string

func (ValuePathExpression) GetEntityPaths added in v0.8.0

func (e ValuePathExpression) GetEntityPaths() []types.Entity

GetEntityPaths checks AttributePath and CompareValue operands to see if an attribute is detected. If detected, the parsed Entity value is returned for the operand

func (ValuePathExpression) String

func (e ValuePathExpression) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL