corsv3

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: Apache-2.0 Imports: 20 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_envoy_extensions_filters_http_cors_v3_cors_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Cors

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

Cors filter config. Set this in ref:`http_filters <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.http_filters>` to enable the CORS filter.

Please note that the :ref:`CorsPolicy <envoy_v3_api_msg_extensions.filters.http.cors.v3.CorsPolicy>` must be configured in the “RouteConfiguration“ as “typed_per_filter_config“ at some level to make the filter work.

func (*Cors) Descriptor deprecated

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

Deprecated: Use Cors.ProtoReflect.Descriptor instead.

func (*Cors) ProtoMessage

func (*Cors) ProtoMessage()

func (*Cors) ProtoReflect added in v0.9.6

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

func (*Cors) Reset

func (x *Cors) Reset()

func (*Cors) String

func (x *Cors) String() string

func (*Cors) Validate

func (m *Cors) Validate() error

Validate checks the field values on Cors 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 (*Cors) ValidateAll added in v0.10.0

func (m *Cors) ValidateAll() error

ValidateAll checks the field values on Cors 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 CorsMultiError, or nil if none found.

type CorsMultiError added in v0.10.0

type CorsMultiError []error

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

func (CorsMultiError) AllErrors added in v0.10.0

func (m CorsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CorsMultiError) Error added in v0.10.0

func (m CorsMultiError) Error() string

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

type CorsPolicy added in v0.11.0

type CorsPolicy struct {

	// Specifies string patterns that match allowed origins. An origin is allowed if any of the
	// string matchers match.
	AllowOriginStringMatch []*v3.StringMatcher `` /* 131-byte string literal not displayed */
	// Specifies the content for the “access-control-allow-methods“ header.
	AllowMethods string `protobuf:"bytes,2,opt,name=allow_methods,json=allowMethods,proto3" json:"allow_methods,omitempty"`
	// Specifies the content for the “access-control-allow-headers“ header.
	AllowHeaders string `protobuf:"bytes,3,opt,name=allow_headers,json=allowHeaders,proto3" json:"allow_headers,omitempty"`
	// Specifies the content for the “access-control-expose-headers“ header.
	ExposeHeaders string `protobuf:"bytes,4,opt,name=expose_headers,json=exposeHeaders,proto3" json:"expose_headers,omitempty"`
	// Specifies the content for the “access-control-max-age“ header.
	MaxAge string `protobuf:"bytes,5,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"`
	// Specifies whether the resource allows credentials.
	AllowCredentials *wrappers.BoolValue `protobuf:"bytes,6,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allow_credentials,omitempty"`
	// Specifies the % of requests for which the CORS filter is enabled.
	//
	// If neither “filter_enabled“, nor “shadow_enabled“ are specified, the CORS
	// filter will be enabled for 100% of the requests.
	//
	// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is
	// specified, Envoy will lookup the runtime key to get the percentage of requests to filter.
	FilterEnabled *v31.RuntimeFractionalPercent `protobuf:"bytes,7,opt,name=filter_enabled,json=filterEnabled,proto3" json:"filter_enabled,omitempty"`
	// Specifies the % of requests for which the CORS policies will be evaluated and tracked, but not
	// enforced.
	//
	// This field is intended to be used when “filter_enabled“ is off. That field have to explicitly disable
	// the filter in order for this setting to take effect.
	//
	// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is specified,
	// Envoy will lookup the runtime key to get the percentage of requests for which it will evaluate
	// and track the request's “Origin“ to determine if it's valid but will not enforce any policies.
	ShadowEnabled *v31.RuntimeFractionalPercent `protobuf:"bytes,8,opt,name=shadow_enabled,json=shadowEnabled,proto3" json:"shadow_enabled,omitempty"`
	// Specify whether allow requests whose target server's IP address is more private than that from
	// which the request initiator was fetched.
	//
	// More details refer to https://developer.chrome.com/blog/private-network-access-preflight.
	AllowPrivateNetworkAccess *wrappers.BoolValue `` /* 140-byte string literal not displayed */
	// contains filtered or unexported fields
}

Per route configuration for the CORS filter. This configuration should be configured in the “RouteConfiguration“ as “typed_per_filter_config“ at some level to make the filter work. [#next-free-field: 10]

func (*CorsPolicy) Descriptor deprecated added in v0.11.0

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

Deprecated: Use CorsPolicy.ProtoReflect.Descriptor instead.

func (*CorsPolicy) GetAllowCredentials added in v0.11.0

func (x *CorsPolicy) GetAllowCredentials() *wrappers.BoolValue

func (*CorsPolicy) GetAllowHeaders added in v0.11.0

func (x *CorsPolicy) GetAllowHeaders() string

func (*CorsPolicy) GetAllowMethods added in v0.11.0

func (x *CorsPolicy) GetAllowMethods() string

func (*CorsPolicy) GetAllowOriginStringMatch added in v0.11.0

func (x *CorsPolicy) GetAllowOriginStringMatch() []*v3.StringMatcher

func (*CorsPolicy) GetAllowPrivateNetworkAccess added in v0.11.0

func (x *CorsPolicy) GetAllowPrivateNetworkAccess() *wrappers.BoolValue

func (*CorsPolicy) GetExposeHeaders added in v0.11.0

func (x *CorsPolicy) GetExposeHeaders() string

func (*CorsPolicy) GetFilterEnabled added in v0.11.0

func (x *CorsPolicy) GetFilterEnabled() *v31.RuntimeFractionalPercent

func (*CorsPolicy) GetMaxAge added in v0.11.0

func (x *CorsPolicy) GetMaxAge() string

func (*CorsPolicy) GetShadowEnabled added in v0.11.0

func (x *CorsPolicy) GetShadowEnabled() *v31.RuntimeFractionalPercent

func (*CorsPolicy) ProtoMessage added in v0.11.0

func (*CorsPolicy) ProtoMessage()

func (*CorsPolicy) ProtoReflect added in v0.11.0

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

func (*CorsPolicy) Reset added in v0.11.0

func (x *CorsPolicy) Reset()

func (*CorsPolicy) String added in v0.11.0

func (x *CorsPolicy) String() string

func (*CorsPolicy) Validate added in v0.11.0

func (m *CorsPolicy) Validate() error

Validate checks the field values on CorsPolicy 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 (*CorsPolicy) ValidateAll added in v0.11.0

func (m *CorsPolicy) ValidateAll() error

ValidateAll checks the field values on CorsPolicy 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 CorsPolicyMultiError, or nil if none found.

type CorsPolicyMultiError added in v0.11.0

type CorsPolicyMultiError []error

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

func (CorsPolicyMultiError) AllErrors added in v0.11.0

func (m CorsPolicyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CorsPolicyMultiError) Error added in v0.11.0

func (m CorsPolicyMultiError) Error() string

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

type CorsPolicyValidationError added in v0.11.0

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

CorsPolicyValidationError is the validation error returned by CorsPolicy.Validate if the designated constraints aren't met.

func (CorsPolicyValidationError) Cause added in v0.11.0

func (e CorsPolicyValidationError) Cause() error

Cause function returns cause value.

func (CorsPolicyValidationError) Error added in v0.11.0

Error satisfies the builtin error interface

func (CorsPolicyValidationError) ErrorName added in v0.11.0

func (e CorsPolicyValidationError) ErrorName() string

ErrorName returns error name.

func (CorsPolicyValidationError) Field added in v0.11.0

Field function returns field value.

func (CorsPolicyValidationError) Key added in v0.11.0

Key function returns key value.

func (CorsPolicyValidationError) Reason added in v0.11.0

func (e CorsPolicyValidationError) Reason() string

Reason function returns reason value.

type CorsValidationError

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

CorsValidationError is the validation error returned by Cors.Validate if the designated constraints aren't met.

func (CorsValidationError) Cause

func (e CorsValidationError) Cause() error

Cause function returns cause value.

func (CorsValidationError) Error

func (e CorsValidationError) Error() string

Error satisfies the builtin error interface

func (CorsValidationError) ErrorName

func (e CorsValidationError) ErrorName() string

ErrorName returns error name.

func (CorsValidationError) Field

func (e CorsValidationError) Field() string

Field function returns field value.

func (CorsValidationError) Key

func (e CorsValidationError) Key() bool

Key function returns key value.

func (CorsValidationError) Reason

func (e CorsValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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