config

package
v0.0.0-...-6ca930f Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_config_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Config

type Config struct {

	// Each incoming http request is matched against the list of filters in the
	// chain, in order, until a matching filter is found. The first matching
	// filter is then applied to the request. After the first match is made, other
	// filters in the chain are ignored. Order of chain declaration is therefore
	// important. At least one `FilterChain` is required in this array.
	Chains []*FilterChain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"`
	// The IP address for the Authservice to listen for incoming requests to
	// process. Required.
	ListenAddress string `protobuf:"bytes,2,opt,name=listen_address,json=listenAddress,proto3" json:"listen_address,omitempty"`
	// The TCP port for the Authservice to listen for incoming requests to
	// process. Required.
	ListenPort int32 `protobuf:"varint,3,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"`
	// The verbosity of logs generated by the Authservice.
	// Must be one of `trace`, `debug`, `info', 'error' or 'critical'.
	// Required.
	LogLevel string `protobuf:"bytes,4,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"`
	// The number of threads in the thread pool to use for processing.
	// The main thread will be used for accepting connections, before sending them
	// to the thread-pool for processing. The total number of running threads,
	// including the main thread, will be N+1. Required.
	Threads uint32 `protobuf:"varint,5,opt,name=threads,proto3" json:"threads,omitempty"`
	// List of trigger rules to decide if the Authservice should be used to
	// authenticate the request. The Authservice authentication happens if any one
	// of the rules matched. If the list is not empty and none of the rules
	// matched, the request will be allowed to proceed without Authservice
	// authentication. The format and semantics of `trigger_rules` are the same as
	// the `triggerRules` setting on the Istio Authentication Policy (see
	// https://istio.io/docs/reference/config/security/istio.authentication.v1alpha1).
	// CAUTION: Be sure that your configured `OIDCConfig.callback` and
	// `OIDCConfig.logout` paths each satisfies at least one of the trigger rules,
	// or else the Authservice will not be able to intercept requests made to
	// those paths to perform the appropriate login/logout behavior. Optional.
	// Leave this empty to always trigger authentication for all paths.
	TriggerRules []*TriggerRule `protobuf:"bytes,9,rep,name=trigger_rules,json=triggerRules,proto3" json:"trigger_rules,omitempty"`
	// Global configuration of OIDC. This value will be applied to all filter
	// definition when it defined as `oidc_override`. Optional.
	DefaultOidcConfig *oidc.OIDCConfig `protobuf:"bytes,10,opt,name=default_oidc_config,json=defaultOidcConfig,proto3" json:"default_oidc_config,omitempty"`
	// If true will allow the the requests even no filter chain match is found.
	// Default false. Optional.
	AllowUnmatchedRequests bool `` /* 131-byte string literal not displayed */
	// contains filtered or unexported fields
}

The top-level configuration object. For a simple example, see the [sample JSON in the bookinfo configmap template](https://github.com/istio-ecosystem/authservice/blob/master/bookinfo-example/config/authservice-configmap-template-for-authn-and-authz.yaml).

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAllowUnmatchedRequests

func (x *Config) GetAllowUnmatchedRequests() bool

func (*Config) GetChains

func (x *Config) GetChains() []*FilterChain

func (*Config) GetDefaultOidcConfig

func (x *Config) GetDefaultOidcConfig() *oidc.OIDCConfig

func (*Config) GetListenAddress

func (x *Config) GetListenAddress() string

func (*Config) GetListenPort

func (x *Config) GetListenPort() int32

func (*Config) GetLogLevel

func (x *Config) GetLogLevel() string

func (*Config) GetThreads

func (x *Config) GetThreads() uint32

func (*Config) GetTriggerRules

func (x *Config) GetTriggerRules() []*TriggerRule

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

func (*Config) Validate

func (m *Config) Validate() error

Validate checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Config) ValidateAll

func (m *Config) ValidateAll() error

ValidateAll checks the field values on Config with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfigMultiError, or nil if none found.

type ConfigMultiError

type ConfigMultiError []error

ConfigMultiError is an error wrapping multiple validation errors returned by Config.ValidateAll() if the designated constraints aren't met.

func (ConfigMultiError) AllErrors

func (m ConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConfigMultiError) Error

func (m ConfigMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ConfigValidationError

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

ConfigValidationError is the validation error returned by Config.Validate if the designated constraints aren't met.

func (ConfigValidationError) Cause

func (e ConfigValidationError) Cause() error

Cause function returns cause value.

func (ConfigValidationError) Error

func (e ConfigValidationError) Error() string

Error satisfies the builtin error interface

func (ConfigValidationError) ErrorName

func (e ConfigValidationError) ErrorName() string

ErrorName returns error name.

func (ConfigValidationError) Field

func (e ConfigValidationError) Field() string

Field function returns field value.

func (ConfigValidationError) Key

func (e ConfigValidationError) Key() bool

Key function returns key value.

func (ConfigValidationError) Reason

func (e ConfigValidationError) Reason() string

Reason function returns reason value.

type Filter

type Filter struct {

	// The type of filter. Currently, the only valid types are `oidc`
	// and `mock`. Required.
	//
	// Types that are assignable to Type:
	//	*Filter_Oidc
	//	*Filter_OidcOverride
	//	*Filter_Mock
	Type isFilter_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

A filter configuration.

func (*Filter) Descriptor deprecated

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

Deprecated: Use Filter.ProtoReflect.Descriptor instead.

func (*Filter) GetMock

func (x *Filter) GetMock() *mock.MockConfig

func (*Filter) GetOidc

func (x *Filter) GetOidc() *oidc.OIDCConfig

func (*Filter) GetOidcOverride

func (x *Filter) GetOidcOverride() *oidc.OIDCConfig

func (*Filter) GetType

func (m *Filter) GetType() isFilter_Type

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) ProtoReflect

func (x *Filter) ProtoReflect() protoreflect.Message

func (*Filter) Reset

func (x *Filter) Reset()

func (*Filter) String

func (x *Filter) String() string

func (*Filter) Validate

func (m *Filter) Validate() error

Validate checks the field values on Filter with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Filter) ValidateAll

func (m *Filter) ValidateAll() error

ValidateAll checks the field values on Filter with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FilterMultiError, or nil if none found.

type FilterChain

type FilterChain struct {

	// A user-defined identifier for the processing chain used in log messages.
	// Required.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// A rule to determine whether an HTTP request should be processed by the
	// filter chain. If not defined, the filter chain will match every request.
	// Optional.
	Match *Match `protobuf:"bytes,2,opt,name=match,proto3" json:"match,omitempty"`
	// The configuration of one of more filters in the filter chain. When the
	// filter chain matches an incoming request, then this list of filters will be
	// applied to the request in the order that they are declared. All filters are
	// evaluated until one of them returns a non-OK response. If all filters
	// return OK, the envoy proxy is notified that the request may continue. The
	// first filter that returns a non-OK response causes the request to be
	// rejected with the filter's returned status and any remaining filters are
	// skipped. At least one `Filter` is required in this array.
	Filters []*Filter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"`
	// contains filtered or unexported fields
}

A chain of one or more filters that will sequentially process an HTTP request.

func (*FilterChain) Descriptor deprecated

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

Deprecated: Use FilterChain.ProtoReflect.Descriptor instead.

func (*FilterChain) GetFilters

func (x *FilterChain) GetFilters() []*Filter

func (*FilterChain) GetMatch

func (x *FilterChain) GetMatch() *Match

func (*FilterChain) GetName

func (x *FilterChain) GetName() string

func (*FilterChain) ProtoMessage

func (*FilterChain) ProtoMessage()

func (*FilterChain) ProtoReflect

func (x *FilterChain) ProtoReflect() protoreflect.Message

func (*FilterChain) Reset

func (x *FilterChain) Reset()

func (*FilterChain) String

func (x *FilterChain) String() string

func (*FilterChain) Validate

func (m *FilterChain) Validate() error

Validate checks the field values on FilterChain with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FilterChain) ValidateAll

func (m *FilterChain) ValidateAll() error

ValidateAll checks the field values on FilterChain with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FilterChainMultiError, or nil if none found.

type FilterChainMultiError

type FilterChainMultiError []error

FilterChainMultiError is an error wrapping multiple validation errors returned by FilterChain.ValidateAll() if the designated constraints aren't met.

func (FilterChainMultiError) AllErrors

func (m FilterChainMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FilterChainMultiError) Error

func (m FilterChainMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type FilterChainValidationError

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

FilterChainValidationError is the validation error returned by FilterChain.Validate if the designated constraints aren't met.

func (FilterChainValidationError) Cause

Cause function returns cause value.

func (FilterChainValidationError) Error

Error satisfies the builtin error interface

func (FilterChainValidationError) ErrorName

func (e FilterChainValidationError) ErrorName() string

ErrorName returns error name.

func (FilterChainValidationError) Field

Field function returns field value.

func (FilterChainValidationError) Key

Key function returns key value.

func (FilterChainValidationError) Reason

Reason function returns reason value.

type FilterMultiError

type FilterMultiError []error

FilterMultiError is an error wrapping multiple validation errors returned by Filter.ValidateAll() if the designated constraints aren't met.

func (FilterMultiError) AllErrors

func (m FilterMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FilterMultiError) Error

func (m FilterMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type FilterValidationError

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

FilterValidationError is the validation error returned by Filter.Validate if the designated constraints aren't met.

func (FilterValidationError) Cause

func (e FilterValidationError) Cause() error

Cause function returns cause value.

func (FilterValidationError) Error

func (e FilterValidationError) Error() string

Error satisfies the builtin error interface

func (FilterValidationError) ErrorName

func (e FilterValidationError) ErrorName() string

ErrorName returns error name.

func (FilterValidationError) Field

func (e FilterValidationError) Field() string

Field function returns field value.

func (FilterValidationError) Key

func (e FilterValidationError) Key() bool

Key function returns key value.

func (FilterValidationError) Reason

func (e FilterValidationError) Reason() string

Reason function returns reason value.

type Filter_Mock

type Filter_Mock struct {
	// Mock filter configuration for testing and letting
	// AuthService run even if no OIDC providers are configured.
	Mock *mock.MockConfig `protobuf:"bytes,3,opt,name=mock,proto3,oneof"`
}

type Filter_Oidc

type Filter_Oidc struct {
	// An OpenID Connect filter configuration.
	Oidc *oidc.OIDCConfig `protobuf:"bytes,1,opt,name=oidc,proto3,oneof"`
}

type Filter_OidcOverride

type Filter_OidcOverride struct {
	// This value will be used when `default_oidc_config` exists.
	// It will override values of them. If that doesn't exist,
	// this configuration will be rejected.
	OidcOverride *oidc.OIDCConfig `protobuf:"bytes,2,opt,name=oidc_override,json=oidcOverride,proto3,oneof"`
}

type Match

type Match struct {

	// The name of the http header used to match against.
	// Required.
	Header string `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// The criteria by which to match.
	// Must be one of `prefix` or `equality`.
	// Required.
	//
	// Types that are assignable to Criteria:
	//	*Match_Prefix
	//	*Match_Equality
	Criteria isMatch_Criteria `protobuf_oneof:"criteria"`
	// contains filtered or unexported fields
}

Specifies how a request can be matched to a filter chain.

func (*Match) Descriptor deprecated

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

Deprecated: Use Match.ProtoReflect.Descriptor instead.

func (*Match) GetCriteria

func (m *Match) GetCriteria() isMatch_Criteria

func (*Match) GetEquality

func (x *Match) GetEquality() string

func (*Match) GetHeader

func (x *Match) GetHeader() string

func (*Match) GetPrefix

func (x *Match) GetPrefix() string

func (*Match) ProtoMessage

func (*Match) ProtoMessage()

func (*Match) ProtoReflect

func (x *Match) ProtoReflect() protoreflect.Message

func (*Match) Reset

func (x *Match) Reset()

func (*Match) String

func (x *Match) String() string

func (*Match) Validate

func (m *Match) Validate() error

Validate checks the field values on Match with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Match) ValidateAll

func (m *Match) ValidateAll() error

ValidateAll checks the field values on Match with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in MatchMultiError, or nil if none found.

type MatchMultiError

type MatchMultiError []error

MatchMultiError is an error wrapping multiple validation errors returned by Match.ValidateAll() if the designated constraints aren't met.

func (MatchMultiError) AllErrors

func (m MatchMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MatchMultiError) Error

func (m MatchMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type MatchValidationError

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

MatchValidationError is the validation error returned by Match.Validate if the designated constraints aren't met.

func (MatchValidationError) Cause

func (e MatchValidationError) Cause() error

Cause function returns cause value.

func (MatchValidationError) Error

func (e MatchValidationError) Error() string

Error satisfies the builtin error interface

func (MatchValidationError) ErrorName

func (e MatchValidationError) ErrorName() string

ErrorName returns error name.

func (MatchValidationError) Field

func (e MatchValidationError) Field() string

Field function returns field value.

func (MatchValidationError) Key

func (e MatchValidationError) Key() bool

Key function returns key value.

func (MatchValidationError) Reason

func (e MatchValidationError) Reason() string

Reason function returns reason value.

type Match_Equality

type Match_Equality struct {
	// The expected value. If the actual value of the header exactly equals this
	// value, then it will be considered a match.
	Equality string `protobuf:"bytes,3,opt,name=equality,proto3,oneof"`
}

type Match_Prefix

type Match_Prefix struct {
	// The expected prefix. If the actual value of the header starts with this
	// prefix, then it will be considered a match.
	Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof"`
}

type StringMatch

type StringMatch struct {

	// Types that are assignable to MatchType:
	//	*StringMatch_Exact
	//	*StringMatch_Prefix
	//	*StringMatch_Suffix
	//	*StringMatch_Regex
	MatchType isStringMatch_MatchType `protobuf_oneof:"match_type"`
	// contains filtered or unexported fields
}

Describes how to match a given string. Match is case-sensitive.

func (*StringMatch) Descriptor deprecated

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

Deprecated: Use StringMatch.ProtoReflect.Descriptor instead.

func (*StringMatch) GetExact

func (x *StringMatch) GetExact() string

func (*StringMatch) GetMatchType

func (m *StringMatch) GetMatchType() isStringMatch_MatchType

func (*StringMatch) GetPrefix

func (x *StringMatch) GetPrefix() string

func (*StringMatch) GetRegex

func (x *StringMatch) GetRegex() string

func (*StringMatch) GetSuffix

func (x *StringMatch) GetSuffix() string

func (*StringMatch) ProtoMessage

func (*StringMatch) ProtoMessage()

func (*StringMatch) ProtoReflect

func (x *StringMatch) ProtoReflect() protoreflect.Message

func (*StringMatch) Reset

func (x *StringMatch) Reset()

func (*StringMatch) String

func (x *StringMatch) String() string

func (*StringMatch) Validate

func (m *StringMatch) Validate() error

Validate checks the field values on StringMatch with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*StringMatch) ValidateAll

func (m *StringMatch) ValidateAll() error

ValidateAll checks the field values on StringMatch with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in StringMatchMultiError, or nil if none found.

type StringMatchMultiError

type StringMatchMultiError []error

StringMatchMultiError is an error wrapping multiple validation errors returned by StringMatch.ValidateAll() if the designated constraints aren't met.

func (StringMatchMultiError) AllErrors

func (m StringMatchMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (StringMatchMultiError) Error

func (m StringMatchMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type StringMatchValidationError

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

StringMatchValidationError is the validation error returned by StringMatch.Validate if the designated constraints aren't met.

func (StringMatchValidationError) Cause

Cause function returns cause value.

func (StringMatchValidationError) Error

Error satisfies the builtin error interface

func (StringMatchValidationError) ErrorName

func (e StringMatchValidationError) ErrorName() string

ErrorName returns error name.

func (StringMatchValidationError) Field

Field function returns field value.

func (StringMatchValidationError) Key

Key function returns key value.

func (StringMatchValidationError) Reason

Reason function returns reason value.

type StringMatch_Exact

type StringMatch_Exact struct {
	// exact string match.
	Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof"`
}

type StringMatch_Prefix

type StringMatch_Prefix struct {
	// prefix-based match.
	Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof"`
}

type StringMatch_Regex

type StringMatch_Regex struct {
	// ECMAscript style regex-based match as defined by
	// [EDCA-262](http://en.cppreference.com/w/cpp/regex/ecmascript). Example:
	// "^/pets/(.*?)?"
	Regex string `protobuf:"bytes,4,opt,name=regex,proto3,oneof"`
}

type StringMatch_Suffix

type StringMatch_Suffix struct {
	// suffix-based match.
	Suffix string `protobuf:"bytes,3,opt,name=suffix,proto3,oneof"`
}

type TriggerRule

type TriggerRule struct {

	// List of paths to be excluded from the request. The rule is satisfied if
	// request path does not match to any of the path in this list.
	// Optional.
	ExcludedPaths []*StringMatch `protobuf:"bytes,1,rep,name=excluded_paths,json=excludedPaths,proto3" json:"excluded_paths,omitempty"`
	// List of paths that the request must include. If the list is not empty, the
	// rule is satisfied if request path matches at least one of the path in the
	// list. If the list is empty, the rule is ignored, in other words the rule is
	// always satisfied. Optional.
	IncludedPaths []*StringMatch `protobuf:"bytes,2,rep,name=included_paths,json=includedPaths,proto3" json:"included_paths,omitempty"`
	// contains filtered or unexported fields
}

Trigger rule to match against a request. The trigger rule is satisfied if and only if both rules, excluded_paths and include_paths are satisfied.

func (*TriggerRule) Descriptor deprecated

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

Deprecated: Use TriggerRule.ProtoReflect.Descriptor instead.

func (*TriggerRule) GetExcludedPaths

func (x *TriggerRule) GetExcludedPaths() []*StringMatch

func (*TriggerRule) GetIncludedPaths

func (x *TriggerRule) GetIncludedPaths() []*StringMatch

func (*TriggerRule) ProtoMessage

func (*TriggerRule) ProtoMessage()

func (*TriggerRule) ProtoReflect

func (x *TriggerRule) ProtoReflect() protoreflect.Message

func (*TriggerRule) Reset

func (x *TriggerRule) Reset()

func (*TriggerRule) String

func (x *TriggerRule) String() string

func (*TriggerRule) Validate

func (m *TriggerRule) Validate() error

Validate checks the field values on TriggerRule with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*TriggerRule) ValidateAll

func (m *TriggerRule) ValidateAll() error

ValidateAll checks the field values on TriggerRule with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TriggerRuleMultiError, or nil if none found.

type TriggerRuleMultiError

type TriggerRuleMultiError []error

TriggerRuleMultiError is an error wrapping multiple validation errors returned by TriggerRule.ValidateAll() if the designated constraints aren't met.

func (TriggerRuleMultiError) AllErrors

func (m TriggerRuleMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TriggerRuleMultiError) Error

func (m TriggerRuleMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type TriggerRuleValidationError

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

TriggerRuleValidationError is the validation error returned by TriggerRule.Validate if the designated constraints aren't met.

func (TriggerRuleValidationError) Cause

Cause function returns cause value.

func (TriggerRuleValidationError) Error

Error satisfies the builtin error interface

func (TriggerRuleValidationError) ErrorName

func (e TriggerRuleValidationError) ErrorName() string

ErrorName returns error name.

func (TriggerRuleValidationError) Field

Field function returns field value.

func (TriggerRuleValidationError) Key

Key function returns key value.

func (TriggerRuleValidationError) Reason

Reason function returns reason value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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