authorization

package
v0.0.0-...-97dd610 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const RuleType = "authorization/v1beta1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Key       string   `json:"key,omitempty"`
	Values    []*Match `json:"values,omitempty"`
	NotValues []*Match `json:"notValues,omitempty"`
}

func (*Condition) CopyToClient

func (c *Condition) CopyToClient() *ConditionToClient

type ConditionToClient

type ConditionToClient struct {
	Key       string           `json:"key,omitempty"`
	Values    []*MatchToClient `json:"values,omitempty"`
	NotValues []*MatchToClient `json:"notValues,omitempty"`
}

type Extend

type Extend struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

func (*Extend) CopyToClient

func (e *Extend) CopyToClient() *ExtendToClient

type ExtendToClient

type ExtendToClient struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type Handler

type Handler interface {
	Add(key string, obj *Policy)
	Get(key string) *Policy
	Update(key string, newObj *Policy)
	Delete(key string)
}

type Impl

type Impl struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(storage *connection.Storage) *Impl

func (*Impl) Add

func (i *Impl) Add(key string, obj *Policy)

func (*Impl) Delete

func (i *Impl) Delete(key string)

func (*Impl) Get

func (i *Impl) Get(key string) *Policy

func (*Impl) Notify

func (i *Impl) Notify()

func (*Impl) Update

func (i *Impl) Update(key string, newObj *Policy)

type Match

type Match struct {
	Type  string `json:"type,omitempty"`
	Value string `json:"value,omitempty"`
}

func (*Match) CopyToClient

func (m *Match) CopyToClient() *MatchToClient

type MatchToClient

type MatchToClient struct {
	Type  string `json:"type,omitempty"`
	Value string `json:"value,omitempty"`
}

type Origin

type Origin struct {
	// contains filtered or unexported fields
}

func (*Origin) Exact

func (o *Origin) Exact(endpoint *rule.Endpoint) (rule.ToClient, error)

func (*Origin) Revision

func (o *Origin) Revision() int64

func (*Origin) Type

func (o *Origin) Type() string

type Policy

type Policy struct {
	Name string `json:"name,omitempty"`

	Spec *PolicySpec `json:"spec"`
}

func (*Policy) CopyToClient

func (p *Policy) CopyToClient() *PolicyToClient

type PolicyRule

type PolicyRule struct {
	From *Source    `json:"from,omitempty"`
	To   *Target    `json:"to,omitempty"`
	When *Condition `json:"when,omitempty"`
}

func (*PolicyRule) CopyToClient

func (p *PolicyRule) CopyToClient() *PolicyRuleToClient

type PolicyRuleToClient

type PolicyRuleToClient struct {
	From *SourceToClient    `json:"from,omitempty"`
	When *ConditionToClient `json:"when,omitempty"`
}

type PolicySpec

type PolicySpec struct {
	Action    string        `json:"action,omitempty"`
	Rules     []*PolicyRule `json:"rules,omitempty"`
	Samples   float32       `json:"samples,omitempty"`
	Order     float32       `json:"order,omitempty"`
	MatchType string        `json:"matchType,omitempty"`
}

func (*PolicySpec) CopyToClient

func (p *PolicySpec) CopyToClient() *PolicySpecToClient

type PolicySpecToClient

type PolicySpecToClient struct {
	Action    string                `json:"action,omitempty"`
	Rules     []*PolicyRuleToClient `json:"rules,omitempty"`
	Samples   float32               `json:"samples,omitempty"`
	Order     float32               `json:"order,omitempty"`
	MatchType string                `json:"matchType,omitempty"`
}

type PolicyToClient

type PolicyToClient struct {
	Name string `json:"name,omitempty"`

	Spec *PolicySpecToClient `json:"spec"`
}

type Source

type Source struct {
	Namespaces    []string  `json:"namespaces,omitempty"`
	NotNamespaces []string  `json:"notNamespaces,omitempty"`
	IpBlocks      []string  `json:"ipBlocks,omitempty"`
	NotIpBlocks   []string  `json:"notIpBlocks,omitempty"`
	Principals    []string  `json:"principals,omitempty"`
	NotPrincipals []string  `json:"notPrincipals,omitempty"`
	Extends       []*Extend `json:"sourceExtends,omitempty"`
	NotExtends    []*Extend `json:"sourceNotExtends,omitempty"`
}

func (*Source) CopyToClient

func (s *Source) CopyToClient() *SourceToClient

type SourceToClient

type SourceToClient struct {
	Namespaces    []string          `json:"namespaces,omitempty"`
	NotNamespaces []string          `json:"notNamespaces,omitempty"`
	IpBlocks      []string          `json:"ipBlocks,omitempty"`
	NotIpBlocks   []string          `json:"notIpBlocks,omitempty"`
	Principals    []string          `json:"principals,omitempty"`
	NotPrincipals []string          `json:"notPrincipals,omitempty"`
	Extends       []*ExtendToClient `json:"sourceExtends,omitempty"`
	NotExtends    []*ExtendToClient `json:"sourceNotExtends,omitempty"`
}

type Target

type Target struct {
	Namespaces    []string  `json:"namespaces,omitempty"`
	NotNamespaces []string  `json:"notNamespaces,omitempty"`
	IpBlocks      []string  `json:"ipBlocks,omitempty"`
	NotIpBlocks   []string  `json:"notIpBlocks,omitempty"`
	Principals    []string  `json:"principals,omitempty"`
	NotPrincipals []string  `json:"notPrincipals,omitempty"`
	Extends       []*Extend `json:"targetExtends,omitempty"`
	NotExtends    []*Extend `json:"targetNotExtends,omitempty"`
}

type TargetToClient

type TargetToClient struct {
	Namespaces    []string          `json:"namespaces,omitempty"`
	NotNamespaces []string          `json:"notNamespaces,omitempty"`
	IpBlocks      []string          `json:"ipBlocks,omitempty"`
	NotIpBlocks   []string          `json:"notIpBlocks,omitempty"`
	Principals    []string          `json:"principals,omitempty"`
	NotPrincipals []string          `json:"notPrincipals,omitempty"`
	Extends       []*ExtendToClient `json:"targetExtends,omitempty"`
	NotExtends    []*ExtendToClient `json:"targetNotExtends,omitempty"`
}

type ToClient

type ToClient struct {
	// contains filtered or unexported fields
}

func (*ToClient) Data

func (r *ToClient) Data() string

func (*ToClient) Revision

func (r *ToClient) Revision() int64

func (*ToClient) Type

func (r *ToClient) Type() string

Jump to

Keyboard shortcuts

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