Documentation
¶
Index ¶
- Constants
- Variables
- func Compare(valueType, operator string, originValue, compareValue interface{}) (bool, error)
- func MatchStrPatterns(patterns []string, subj string, compareFunc StrComparable) bool
- func StrEqual(pattern, subj string) bool
- func StrGlob(pattern, subj string) bool
- func StrRegex(pattern, subj string) bool
- type Attribute
- type Attributes
- type Condition
- type Conditions
- type Identity
- type Permission
- type Policies
- type Policy
- type Resource
- type Resources
- type Statement
- type StrComparable
Constants ¶
View Source
const ( AttributeTypeSubject = "AttributeTypeSubject" AttributeTypeResource = "AttributeTypeResource" AttributeTypeEnv = "AttributeTypeEnv" )
View Source
const ( OperatorEQ = "eq" OperatorLT = "lt" OperatorLTE = "lte" OperatorGT = "gt" OperatorGTE = "gte" OperatorNEQ = "neq" OperatorGlobMatch = "glob_match" OperatorRegexMatch = "regex_match" )
View Source
const ( Allow = "allow" Deny = "deny" )
Variables ¶
View Source
var ( ErrDeniedByStatement = errors.New("action denied as statement declared") ErrStatementNotMatch = errors.New("statement does not match the action") )
Functions ¶
func MatchStrPatterns ¶
func MatchStrPatterns(patterns []string, subj string, compareFunc StrComparable) bool
Types ¶
type Attributes ¶
type Attributes []Attribute
type Conditions ¶
func (Conditions) Judge ¶
func (cs Conditions) Judge(attributes Attributes) (bool, error)
type Permission ¶
type Policy ¶
type Resources ¶
type Resources struct { ResourceType string ResourceNames []string CompareFunc StrComparable }
type Statement ¶
type Statement struct { Resources Effect string Actions []string Conditions Conditions }
type StrComparable ¶
Click to show internal directories.
Click to hide internal directories.