protect

package
v0.0.0-...-320551d Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrsPattern

type AttrsPattern struct {
	Match *RequestPattern `json:"match,omitempty"`
	Attrs []string        `json:"attrs,omitempty"`
}

func (*AttrsPattern) DeepCopy

func (p *AttrsPattern) DeepCopy() *AttrsPattern

func (*AttrsPattern) DeepCopyInto

func (p *AttrsPattern) DeepCopyInto(p2 *AttrsPattern)

type ProtectionProfile

type ProtectionProfile interface {
	Match(reqFields map[string]string) (bool, *Rule)
	Update(reqFields map[string]string, reason string, matchedRule *Rule)
}

type Request

type Request struct {
	// Scope      string `json:"scope,omitempty"`
	Operation  string `json:"operation,omitempty"`
	Namespace  string `json:"namespace,omitempty"`
	ApiGroup   string `json:"apiGroup,omitempty"`
	ApiVersion string `json:"apiVersion,omitempty"`
	Kind       string `json:"kind,omitempty"`
	Name       string `json:"name,omitempty"`
	UserName   string `json:"userName,omitempty"`
}

func (*Request) String

func (self *Request) String() string

type RequestPattern

type RequestPattern struct {
	Scope      *RulePattern `json:"scope,omitempty"`
	Namespace  *RulePattern `json:"namespace,omitempty"`
	ApiGroup   *RulePattern `json:"apiGroup,omitempty"`
	ApiVersion *RulePattern `json:"apiVersion,omitempty"`
	Kind       *RulePattern `json:"kind,omitempty"`
	Name       *RulePattern `json:"name,omitempty"`
	Operation  *RulePattern `json:"operation,omitempty"`
	UserName   *RulePattern `json:"username,omitempty"`
	UserGroup  *RulePattern `json:"usergroup,omitempty"`
}

func (*RequestPattern) DeepCopy

func (p *RequestPattern) DeepCopy() *RequestPattern

func (*RequestPattern) DeepCopyInto

func (p *RequestPattern) DeepCopyInto(p2 *RequestPattern)

func (*RequestPattern) Match

func (self *RequestPattern) Match(reqFields map[string]string) bool

type Result

type Result struct {
	Request     string `json:"request,omitempty"`
	Reason      string `json:"reason,omitempty"`
	MatchedRule string `json:"matchedRule,omitempty"`
}

func (*Result) DeepCopy

func (p *Result) DeepCopy() *Result

func (*Result) DeepCopyInto

func (p *Result) DeepCopyInto(p2 *Result)

func (*Result) Update

func (self *Result) Update(reqFields map[string]string, reason string, matchedRule *Rule)

type Rule

type Rule struct {
	Match   []*RequestPattern `json:"match,omitempty"`
	Exclude []*RequestPattern `json:"exclude,omitempty"`
}

func (*Rule) DeepCopy

func (p *Rule) DeepCopy() *Rule

func (*Rule) DeepCopyInto

func (p *Rule) DeepCopyInto(p2 *Rule)

func (*Rule) MatchWithRequest

func (self *Rule) MatchWithRequest(reqFields map[string]string) bool

func (*Rule) String

func (self *Rule) String() string

type RulePattern

type RulePattern string

type ServieAccountPattern

type ServieAccountPattern struct {
	Match              *RequestPattern `json:"match,omitempty"`
	ServiceAccountName []string        `json:"serviceAccountName,omitempty"`
}

func (*ServieAccountPattern) DeepCopy

func (*ServieAccountPattern) DeepCopyInto

func (p *ServieAccountPattern) DeepCopyInto(p2 *ServieAccountPattern)

Jump to

Keyboard shortcuts

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