authz

package
v0.0.0-...-7d2a9e7 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewACLAuthorizer

func NewACLAuthorizer(acl ACL) (api.Authorizer, error)

NewACLAuthorizer Creates a new static authorizer with ACL that have been read from the config file

func StringSetIntersection

func StringSetIntersection(a, b []string) []string

func ValidateACL

func ValidateACL(acl ACL) error

Types

type ACL

type ACL []ACLEntry

type ACLEntry

type ACLEntry struct {
	Match   *MatchConditions `yaml:"match"`
	Actions *[]string        `yaml:"actions,flow"`
	Comment *string          `yaml:"comment,omitempty"`
}

func (*ACLEntry) Matches

func (e *ACLEntry) Matches(ai *api.AuthRequestInfo) bool

func (ACLEntry) String

func (e ACLEntry) String() string

type MatchConditions

type MatchConditions struct {
	Account *string           `yaml:"account,omitempty" json:"account,omitempty"`
	Type    *string           `yaml:"type,omitempty" json:"type,omitempty"`
	Name    *string           `yaml:"name,omitempty" json:"name,omitempty"`
	IP      *string           `yaml:"ip,omitempty" json:"ip,omitempty"`
	Service *string           `yaml:"service,omitempty" json:"service,omitempty"`
	Labels  map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
}

func (*MatchConditions) Matches

func (mc *MatchConditions) Matches(ai *api.AuthRequestInfo) bool

type PluginAuthz

type PluginAuthz struct {
	Authz api.Authorizer
}

func NewPluginAuthzAuthorizer

func NewPluginAuthzAuthorizer(cfg *PluginAuthzConfig) (*PluginAuthz, error)

func (*PluginAuthz) Authorize

func (c *PluginAuthz) Authorize(ai *api.AuthRequestInfo) ([]string, error)

func (*PluginAuthz) Name

func (c *PluginAuthz) Name() string

func (*PluginAuthz) Stop

func (c *PluginAuthz) Stop()

type PluginAuthzConfig

type PluginAuthzConfig struct {
	PluginPath string `yaml:"plugin_path"`
}

func (*PluginAuthzConfig) Validate

func (c *PluginAuthzConfig) Validate() error

Jump to

Keyboard shortcuts

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