Documentation ¶
Index ¶
- func GetFieldDataType(s string) (string, string)
- func MatchPathBasedACL(pattern, uri string) bool
- type AccessList
- func (acl *AccessList) AddRule(ctx context.Context, cfg *RuleConfiguration) error
- func (acl *AccessList) AddRules(ctx context.Context, cfgs []*RuleConfiguration) error
- func (acl *AccessList) Allow(ctx context.Context, data map[string]interface{}) bool
- func (acl *AccessList) GetRules() []*RuleConfiguration
- func (acl *AccessList) SetDefaultAllowAction()
- func (acl *AccessList) SetLogger(logger *zap.Logger)
- type RuleConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFieldDataType ¶
GetFieldDataType return data type for a particular data field.
func MatchPathBasedACL ¶
MatchPathBasedACL matches pattern in a URI.
Types ¶
type AccessList ¶
type AccessList struct {
// contains filtered or unexported fields
}
AccessList is a collection of access list rules.
func NewAccessList ¶
func NewAccessList() *AccessList
NewAccessList returns an instance of AccessList.
func (*AccessList) AddRule ¶
func (acl *AccessList) AddRule(ctx context.Context, cfg *RuleConfiguration) error
AddRule adds a rule to AccessList.
func (*AccessList) AddRules ¶
func (acl *AccessList) AddRules(ctx context.Context, cfgs []*RuleConfiguration) error
AddRules adds multiple rules to AccessList.
func (*AccessList) Allow ¶
func (acl *AccessList) Allow(ctx context.Context, data map[string]interface{}) bool
Allow takes in client identity and metadata and returns an error when denied access.
func (*AccessList) GetRules ¶
func (acl *AccessList) GetRules() []*RuleConfiguration
GetRules returns configured ACL rules.
func (*AccessList) SetDefaultAllowAction ¶
func (acl *AccessList) SetDefaultAllowAction()
SetDefaultAllowAction sets default allow for the AccessList, i.e. the AccessList fails open.
func (*AccessList) SetLogger ¶
func (acl *AccessList) SetLogger(logger *zap.Logger)
SetLogger adds a logger to AccessList.
type RuleConfiguration ¶
type RuleConfiguration struct { Comment string `json:"comment,omitempty" xml:"comment,omitempty" yaml:"comment,omitempty"` Conditions []string `json:"conditions,omitempty" xml:"conditions,omitempty" yaml:"conditions,omitempty"` Action string `json:"action,omitempty" xml:"action,omitempty" yaml:"action,omitempty"` }
RuleConfiguration consists of a list of conditions and and actions
Click to show internal directories.
Click to hide internal directories.