v3

package
v1.5.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListStringMatcher

type ListStringMatcher struct {
	Patterns             []*StringMatcher `protobuf:"bytes,1,rep,name=patterns,proto3" json:"patterns,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

Specifies a list of ways to match a string.

func (*ListStringMatcher) Descriptor

func (*ListStringMatcher) Descriptor() ([]byte, []int)

func (*ListStringMatcher) Equal

func (this *ListStringMatcher) Equal(that interface{}) bool

func (*ListStringMatcher) GetPatterns

func (m *ListStringMatcher) GetPatterns() []*StringMatcher

func (*ListStringMatcher) ProtoMessage

func (*ListStringMatcher) ProtoMessage()

func (*ListStringMatcher) Reset

func (m *ListStringMatcher) Reset()

func (*ListStringMatcher) String

func (m *ListStringMatcher) String() string

func (*ListStringMatcher) XXX_DiscardUnknown

func (m *ListStringMatcher) XXX_DiscardUnknown()

func (*ListStringMatcher) XXX_Marshal

func (m *ListStringMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListStringMatcher) XXX_Merge

func (m *ListStringMatcher) XXX_Merge(src proto.Message)

func (*ListStringMatcher) XXX_Size

func (m *ListStringMatcher) XXX_Size() int

func (*ListStringMatcher) XXX_Unmarshal

func (m *ListStringMatcher) XXX_Unmarshal(b []byte) error

type RegexMatchAndSubstitute

type RegexMatchAndSubstitute struct {
	// The regular expression used to find portions of a string (hereafter called
	// the "subject string") that should be replaced. When a new string is
	// produced during the substitution operation, the new string is initially
	// the same as the subject string, but then all matches in the subject string
	// are replaced by the substitution string. If replacing all matches isn't
	// desired, regular expression anchors can be used to ensure a single match,
	// so as to replace just one occurrence of a pattern. Capture groups can be
	// used in the pattern to extract portions of the subject string, and then
	// referenced in the substitution string.
	Pattern *RegexMatcher `protobuf:"bytes,1,opt,name=pattern,proto3" json:"pattern,omitempty"`
	// The string that should be substituted into matching portions of the
	// subject string during a substitution operation to produce a new string.
	// Capture groups in the pattern can be referenced in the substitution
	// string. Note, however, that the syntax for referring to capture groups is
	// defined by the chosen regular expression engine. Google's `RE2
	// <https://github.com/google/re2>`_ regular expression engine uses a
	// backslash followed by the capture group number to denote a numbered
	// capture group. E.g., “\1“ refers to capture group 1, and “\2“ refers
	// to capture group 2.
	Substitution         string   `protobuf:"bytes,2,opt,name=substitution,proto3" json:"substitution,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Describes how to match a string and then produce a new string using a regular expression and a substitution string.

func (*RegexMatchAndSubstitute) Descriptor

func (*RegexMatchAndSubstitute) Descriptor() ([]byte, []int)

func (*RegexMatchAndSubstitute) Equal

func (this *RegexMatchAndSubstitute) Equal(that interface{}) bool

func (*RegexMatchAndSubstitute) GetPattern

func (m *RegexMatchAndSubstitute) GetPattern() *RegexMatcher

func (*RegexMatchAndSubstitute) GetSubstitution

func (m *RegexMatchAndSubstitute) GetSubstitution() string

func (*RegexMatchAndSubstitute) ProtoMessage

func (*RegexMatchAndSubstitute) ProtoMessage()

func (*RegexMatchAndSubstitute) Reset

func (m *RegexMatchAndSubstitute) Reset()

func (*RegexMatchAndSubstitute) String

func (m *RegexMatchAndSubstitute) String() string

func (*RegexMatchAndSubstitute) XXX_DiscardUnknown

func (m *RegexMatchAndSubstitute) XXX_DiscardUnknown()

func (*RegexMatchAndSubstitute) XXX_Marshal

func (m *RegexMatchAndSubstitute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RegexMatchAndSubstitute) XXX_Merge

func (m *RegexMatchAndSubstitute) XXX_Merge(src proto.Message)

func (*RegexMatchAndSubstitute) XXX_Size

func (m *RegexMatchAndSubstitute) XXX_Size() int

func (*RegexMatchAndSubstitute) XXX_Unmarshal

func (m *RegexMatchAndSubstitute) XXX_Unmarshal(b []byte) error

type RegexMatcher

type RegexMatcher struct {
	// Types that are valid to be assigned to EngineType:
	//	*RegexMatcher_GoogleRe2
	EngineType isRegexMatcher_EngineType `protobuf_oneof:"engine_type"`
	// The regex match string. The string must be supported by the configured engine.
	Regex                string   `protobuf:"bytes,2,opt,name=regex,proto3" json:"regex,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A regex matcher designed for safety when used with untrusted input.

func (*RegexMatcher) Descriptor

func (*RegexMatcher) Descriptor() ([]byte, []int)

func (*RegexMatcher) Equal

func (this *RegexMatcher) Equal(that interface{}) bool

func (*RegexMatcher) GetEngineType

func (m *RegexMatcher) GetEngineType() isRegexMatcher_EngineType

func (*RegexMatcher) GetGoogleRe2

func (m *RegexMatcher) GetGoogleRe2() *RegexMatcher_GoogleRE2

func (*RegexMatcher) GetRegex

func (m *RegexMatcher) GetRegex() string

func (*RegexMatcher) ProtoMessage

func (*RegexMatcher) ProtoMessage()

func (*RegexMatcher) Reset

func (m *RegexMatcher) Reset()

func (*RegexMatcher) String

func (m *RegexMatcher) String() string

func (*RegexMatcher) XXX_DiscardUnknown

func (m *RegexMatcher) XXX_DiscardUnknown()

func (*RegexMatcher) XXX_Marshal

func (m *RegexMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RegexMatcher) XXX_Merge

func (m *RegexMatcher) XXX_Merge(src proto.Message)

func (*RegexMatcher) XXX_OneofWrappers

func (*RegexMatcher) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*RegexMatcher) XXX_Size

func (m *RegexMatcher) XXX_Size() int

func (*RegexMatcher) XXX_Unmarshal

func (m *RegexMatcher) XXX_Unmarshal(b []byte) error

type RegexMatcher_GoogleRE2

type RegexMatcher_GoogleRE2 struct {
	// This field controls the RE2 "program size" which is a rough estimate of how complex a
	// compiled regex is to evaluate. A regex that has a program size greater than the configured
	// value will fail to compile. In this case, the configured max program size can be increased
	// or the regex can be simplified. If not specified, the default is 100.
	//
	// This field is deprecated; regexp validation should be performed on the management server
	// instead of being done by each individual client.
	MaxProgramSize       *types.UInt32Value `protobuf:"bytes,1,opt,name=max_program_size,json=maxProgramSize,proto3" json:"max_program_size,omitempty"` // Deprecated: Do not use.
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

Google's `RE2 <https://github.com/google/re2>`_ regex engine. The regex string must adhere to the documented `syntax <https://github.com/google/re2/wiki/Syntax>`_. The engine is designed to complete execution in linear time as well as limit the amount of memory used.

Envoy supports program size checking via runtime. The runtime keys `re2.max_program_size.error_level` and `re2.max_program_size.warn_level` can be set to integers as the maximum program size or complexity that a compiled regex can have before an exception is thrown or a warning is logged, respectively. `re2.max_program_size.error_level` defaults to 100, and `re2.max_program_size.warn_level` has no default if unset (will not check/log a warning).

Envoy emits two stats for tracking the program size of regexes: the histogram `re2.program_size`, which records the program size, and the counter `re2.exceeded_warn_level`, which is incremented each time the program size exceeds the warn level threshold.

func (*RegexMatcher_GoogleRE2) Descriptor

func (*RegexMatcher_GoogleRE2) Descriptor() ([]byte, []int)

func (*RegexMatcher_GoogleRE2) Equal

func (this *RegexMatcher_GoogleRE2) Equal(that interface{}) bool

func (*RegexMatcher_GoogleRE2) GetMaxProgramSize deprecated

func (m *RegexMatcher_GoogleRE2) GetMaxProgramSize() *types.UInt32Value

Deprecated: Do not use.

func (*RegexMatcher_GoogleRE2) ProtoMessage

func (*RegexMatcher_GoogleRE2) ProtoMessage()

func (*RegexMatcher_GoogleRE2) Reset

func (m *RegexMatcher_GoogleRE2) Reset()

func (*RegexMatcher_GoogleRE2) String

func (m *RegexMatcher_GoogleRE2) String() string

func (*RegexMatcher_GoogleRE2) XXX_DiscardUnknown

func (m *RegexMatcher_GoogleRE2) XXX_DiscardUnknown()

func (*RegexMatcher_GoogleRE2) XXX_Marshal

func (m *RegexMatcher_GoogleRE2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RegexMatcher_GoogleRE2) XXX_Merge

func (m *RegexMatcher_GoogleRE2) XXX_Merge(src proto.Message)

func (*RegexMatcher_GoogleRE2) XXX_Size

func (m *RegexMatcher_GoogleRE2) XXX_Size() int

func (*RegexMatcher_GoogleRE2) XXX_Unmarshal

func (m *RegexMatcher_GoogleRE2) XXX_Unmarshal(b []byte) error

type RegexMatcher_GoogleRe2

type RegexMatcher_GoogleRe2 struct {
	GoogleRe2 *RegexMatcher_GoogleRE2 `protobuf:"bytes,1,opt,name=google_re2,json=googleRe2,proto3,oneof" json:"google_re2,omitempty"`
}

func (*RegexMatcher_GoogleRe2) Equal

func (this *RegexMatcher_GoogleRe2) Equal(that interface{}) bool

type StringMatcher

type StringMatcher struct {
	// Types that are valid to be assigned to MatchPattern:
	//	*StringMatcher_Exact
	//	*StringMatcher_Prefix
	//	*StringMatcher_Suffix
	//	*StringMatcher_SafeRegex
	MatchPattern isStringMatcher_MatchPattern `protobuf_oneof:"match_pattern"`
	// If true, indicates the exact/prefix/suffix matching should be case insensitive. This has no
	// effect for the safe_regex match.
	// For example, the matcher *data* will match both input string *Data* and *data* if set to true.
	IgnoreCase           bool     `protobuf:"varint,6,opt,name=ignore_case,json=ignoreCase,proto3" json:"ignore_case,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Specifies the way to match a string. [#next-free-field: 7]

func (*StringMatcher) Descriptor

func (*StringMatcher) Descriptor() ([]byte, []int)

func (*StringMatcher) Equal

func (this *StringMatcher) Equal(that interface{}) bool

func (*StringMatcher) GetExact

func (m *StringMatcher) GetExact() string

func (*StringMatcher) GetIgnoreCase

func (m *StringMatcher) GetIgnoreCase() bool

func (*StringMatcher) GetMatchPattern

func (m *StringMatcher) GetMatchPattern() isStringMatcher_MatchPattern

func (*StringMatcher) GetPrefix

func (m *StringMatcher) GetPrefix() string

func (*StringMatcher) GetSafeRegex

func (m *StringMatcher) GetSafeRegex() *RegexMatcher

func (*StringMatcher) GetSuffix

func (m *StringMatcher) GetSuffix() string

func (*StringMatcher) ProtoMessage

func (*StringMatcher) ProtoMessage()

func (*StringMatcher) Reset

func (m *StringMatcher) Reset()

func (*StringMatcher) String

func (m *StringMatcher) String() string

func (*StringMatcher) XXX_DiscardUnknown

func (m *StringMatcher) XXX_DiscardUnknown()

func (*StringMatcher) XXX_Marshal

func (m *StringMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StringMatcher) XXX_Merge

func (m *StringMatcher) XXX_Merge(src proto.Message)

func (*StringMatcher) XXX_OneofWrappers

func (*StringMatcher) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*StringMatcher) XXX_Size

func (m *StringMatcher) XXX_Size() int

func (*StringMatcher) XXX_Unmarshal

func (m *StringMatcher) XXX_Unmarshal(b []byte) error

type StringMatcher_Exact

type StringMatcher_Exact struct {
	Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof" json:"exact,omitempty"`
}

func (*StringMatcher_Exact) Equal

func (this *StringMatcher_Exact) Equal(that interface{}) bool

type StringMatcher_Prefix

type StringMatcher_Prefix struct {
	Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof" json:"prefix,omitempty"`
}

func (*StringMatcher_Prefix) Equal

func (this *StringMatcher_Prefix) Equal(that interface{}) bool

type StringMatcher_SafeRegex

type StringMatcher_SafeRegex struct {
	SafeRegex *RegexMatcher `protobuf:"bytes,5,opt,name=safe_regex,json=safeRegex,proto3,oneof" json:"safe_regex,omitempty"`
}

func (*StringMatcher_SafeRegex) Equal

func (this *StringMatcher_SafeRegex) Equal(that interface{}) bool

type StringMatcher_Suffix

type StringMatcher_Suffix struct {
	Suffix string `protobuf:"bytes,3,opt,name=suffix,proto3,oneof" json:"suffix,omitempty"`
}

func (*StringMatcher_Suffix) Equal

func (this *StringMatcher_Suffix) Equal(that interface{}) bool

Jump to

Keyboard shortcuts

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