Documentation
¶
Index ¶
- Variables
- type RateLimit
- func (x *RateLimit) ClearFailureModeDenyPercent()
- func (x *RateLimit) ClearFilterEnabled()
- func (x *RateLimit) ClearFilterEnforced()
- func (x *RateLimit) ClearRateLimitService()
- func (x *RateLimit) ClearRateLimitedStatus()
- func (x *RateLimit) ClearStatusOnError()
- func (x *RateLimit) ClearTimeout()
- func (x *RateLimit) GetDisableXEnvoyRatelimitedHeader() bool
- func (x *RateLimit) GetDomain() string
- func (x *RateLimit) GetEnableXRatelimitHeaders() RateLimit_XRateLimitHeadersRFCVersion
- func (x *RateLimit) GetFailureModeDeny() bool
- func (x *RateLimit) GetFailureModeDenyPercent() *v32.RuntimeFractionalPercent
- func (x *RateLimit) GetFilterEnabled() *v32.RuntimeFractionalPercent
- func (x *RateLimit) GetFilterEnforced() *v32.RuntimeFractionalPercent
- func (x *RateLimit) GetRateLimitService() *v3.RateLimitServiceConfig
- func (x *RateLimit) GetRateLimitedAsResourceExhausted() bool
- func (x *RateLimit) GetRateLimitedStatus() *v31.HttpStatus
- func (x *RateLimit) GetRateLimits() []*v33.RateLimit
- func (x *RateLimit) GetRequestType() string
- func (x *RateLimit) GetResponseHeadersToAdd() []*v32.HeaderValueOption
- func (x *RateLimit) GetStage() uint32
- func (x *RateLimit) GetStatPrefix() string
- func (x *RateLimit) GetStatusOnError() *v31.HttpStatus
- func (x *RateLimit) GetTimeout() *durationpb.Duration
- func (x *RateLimit) HasFailureModeDenyPercent() bool
- func (x *RateLimit) HasFilterEnabled() bool
- func (x *RateLimit) HasFilterEnforced() bool
- func (x *RateLimit) HasRateLimitService() bool
- func (x *RateLimit) HasRateLimitedStatus() bool
- func (x *RateLimit) HasStatusOnError() bool
- func (x *RateLimit) HasTimeout() bool
- func (*RateLimit) ProtoMessage()
- func (x *RateLimit) ProtoReflect() protoreflect.Message
- func (x *RateLimit) Reset()
- func (x *RateLimit) SetDisableXEnvoyRatelimitedHeader(v bool)
- func (x *RateLimit) SetDomain(v string)
- func (x *RateLimit) SetEnableXRatelimitHeaders(v RateLimit_XRateLimitHeadersRFCVersion)
- func (x *RateLimit) SetFailureModeDeny(v bool)
- func (x *RateLimit) SetFailureModeDenyPercent(v *v32.RuntimeFractionalPercent)
- func (x *RateLimit) SetFilterEnabled(v *v32.RuntimeFractionalPercent)
- func (x *RateLimit) SetFilterEnforced(v *v32.RuntimeFractionalPercent)
- func (x *RateLimit) SetRateLimitService(v *v3.RateLimitServiceConfig)
- func (x *RateLimit) SetRateLimitedAsResourceExhausted(v bool)
- func (x *RateLimit) SetRateLimitedStatus(v *v31.HttpStatus)
- func (x *RateLimit) SetRateLimits(v []*v33.RateLimit)
- func (x *RateLimit) SetRequestType(v string)
- func (x *RateLimit) SetResponseHeadersToAdd(v []*v32.HeaderValueOption)
- func (x *RateLimit) SetStage(v uint32)
- func (x *RateLimit) SetStatPrefix(v string)
- func (x *RateLimit) SetStatusOnError(v *v31.HttpStatus)
- func (x *RateLimit) SetTimeout(v *durationpb.Duration)
- func (x *RateLimit) String() string
- type RateLimitPerRoute
- func (x *RateLimitPerRoute) GetDomain() string
- func (x *RateLimitPerRoute) GetOverrideOption() RateLimitPerRoute_OverrideOptions
- func (x *RateLimitPerRoute) GetRateLimits() []*v33.RateLimit
- func (x *RateLimitPerRoute) GetVhRateLimits() RateLimitPerRoute_VhRateLimitsOptions
- func (*RateLimitPerRoute) ProtoMessage()
- func (x *RateLimitPerRoute) ProtoReflect() protoreflect.Message
- func (x *RateLimitPerRoute) Reset()
- func (x *RateLimitPerRoute) SetDomain(v string)
- func (x *RateLimitPerRoute) SetOverrideOption(v RateLimitPerRoute_OverrideOptions)
- func (x *RateLimitPerRoute) SetRateLimits(v []*v33.RateLimit)
- func (x *RateLimitPerRoute) SetVhRateLimits(v RateLimitPerRoute_VhRateLimitsOptions)
- func (x *RateLimitPerRoute) String() string
- type RateLimitPerRoute_OverrideOptions
- func (RateLimitPerRoute_OverrideOptions) Descriptor() protoreflect.EnumDescriptor
- func (x RateLimitPerRoute_OverrideOptions) Enum() *RateLimitPerRoute_OverrideOptions
- func (x RateLimitPerRoute_OverrideOptions) Number() protoreflect.EnumNumber
- func (x RateLimitPerRoute_OverrideOptions) String() string
- func (RateLimitPerRoute_OverrideOptions) Type() protoreflect.EnumType
- type RateLimitPerRoute_VhRateLimitsOptions
- func (RateLimitPerRoute_VhRateLimitsOptions) Descriptor() protoreflect.EnumDescriptor
- func (x RateLimitPerRoute_VhRateLimitsOptions) Enum() *RateLimitPerRoute_VhRateLimitsOptions
- func (x RateLimitPerRoute_VhRateLimitsOptions) Number() protoreflect.EnumNumber
- func (x RateLimitPerRoute_VhRateLimitsOptions) String() string
- func (RateLimitPerRoute_VhRateLimitsOptions) Type() protoreflect.EnumType
- type RateLimitPerRoute_builder
- type RateLimit_XRateLimitHeadersRFCVersion
- func (RateLimit_XRateLimitHeadersRFCVersion) Descriptor() protoreflect.EnumDescriptor
- func (x RateLimit_XRateLimitHeadersRFCVersion) Enum() *RateLimit_XRateLimitHeadersRFCVersion
- func (x RateLimit_XRateLimitHeadersRFCVersion) Number() protoreflect.EnumNumber
- func (x RateLimit_XRateLimitHeadersRFCVersion) String() string
- func (RateLimit_XRateLimitHeadersRFCVersion) Type() protoreflect.EnumType
- type RateLimit_builder
Constants ¶
This section is empty.
Variables ¶
var ( RateLimit_XRateLimitHeadersRFCVersion_name = map[int32]string{ 0: "OFF", 1: "DRAFT_VERSION_03", } RateLimit_XRateLimitHeadersRFCVersion_value = map[string]int32{ "OFF": 0, "DRAFT_VERSION_03": 1, } )
Enum value maps for RateLimit_XRateLimitHeadersRFCVersion.
var ( RateLimitPerRoute_VhRateLimitsOptions_name = map[int32]string{ 0: "OVERRIDE", 1: "INCLUDE", 2: "IGNORE", } RateLimitPerRoute_VhRateLimitsOptions_value = map[string]int32{ "OVERRIDE": 0, "INCLUDE": 1, "IGNORE": 2, } )
Enum value maps for RateLimitPerRoute_VhRateLimitsOptions.
var ( RateLimitPerRoute_OverrideOptions_name = map[int32]string{ 0: "DEFAULT", 1: "OVERRIDE_POLICY", 2: "INCLUDE_POLICY", 3: "IGNORE_POLICY", } RateLimitPerRoute_OverrideOptions_value = map[string]int32{ "DEFAULT": 0, "OVERRIDE_POLICY": 1, "INCLUDE_POLICY": 2, "IGNORE_POLICY": 3, } )
Enum value maps for RateLimitPerRoute_OverrideOptions.
var File_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type RateLimit ¶
type RateLimit struct {
// The rate limit domain to use when calling the rate limit service.
Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
// Specifies the rate limit configurations to be applied with the same
// stage number. If not set, the default stage number is 0.
//
// .. note::
//
// The filter supports a range of 0 - 10 inclusively for stage numbers.
Stage uint32 `protobuf:"varint,2,opt,name=stage,proto3" json:"stage,omitempty"`
// The type of requests the filter should apply to. The supported
// types are “internal“, “external“ or “both“. A request is considered internal if
// :ref:`x-envoy-internal<config_http_conn_man_headers_x-envoy-internal>` is set to true. If
// :ref:`x-envoy-internal<config_http_conn_man_headers_x-envoy-internal>` is not set or false, a
// request is considered external. The filter defaults to “both“, and it will apply to all request
// types.
RequestType string `protobuf:"bytes,3,opt,name=request_type,json=requestType,proto3" json:"request_type,omitempty"`
// The timeout in milliseconds for the rate limit service RPC. If not
// set, this defaults to 20ms.
Timeout *durationpb.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
// The filter's behaviour in case the rate limiting service does
// not respond back. When it is set to true, Envoy will not allow traffic in case of
// communication failure between rate limiting service and the proxy.
FailureModeDeny bool `protobuf:"varint,5,opt,name=failure_mode_deny,json=failureModeDeny,proto3" json:"failure_mode_deny,omitempty"`
// Specifies whether a “RESOURCE_EXHAUSTED“ gRPC code must be returned instead
// of the default “UNAVAILABLE“ gRPC code for a rate limited gRPC call. The
// HTTP code will be 200 for a gRPC response.
RateLimitedAsResourceExhausted bool `` /* 158-byte string literal not displayed */
// Configuration for an external rate limit service provider. If not
// specified, any calls to the rate limit service will immediately return
// success.
RateLimitService *v3.RateLimitServiceConfig `protobuf:"bytes,7,opt,name=rate_limit_service,json=rateLimitService,proto3" json:"rate_limit_service,omitempty"`
// Defines the standard version to use for X-RateLimit headers emitted by the filter:
//
// - “X-RateLimit-Limit“ - indicates the request-quota associated to the
// client in the current time-window followed by the description of the
// quota policy. The values are returned by the rate limiting service in
// :ref:`current_limit<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.current_limit>`
// field. Example: “10, 10;w=1;name="per-ip", 1000;w=3600“.
// - “X-RateLimit-Remaining“ - indicates the remaining requests in the
// current time-window. The values are returned by the rate limiting service
// in :ref:`limit_remaining<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.limit_remaining>`
// field.
// - “X-RateLimit-Reset“ - indicates the number of seconds until reset of
// the current time-window. The values are returned by the rate limiting service
// in :ref:`duration_until_reset<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.duration_until_reset>`
// field.
//
// In case rate limiting policy specifies more than one time window, the values
// above represent the window that is closest to reaching its limit.
//
// For more information about the headers specification see selected version of
// the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
//
// Disabled by default.
//
// [#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.XRateLimitHeadersRFCVersion instead.]
EnableXRatelimitHeaders RateLimit_XRateLimitHeadersRFCVersion `` /* 221-byte string literal not displayed */
// Disables emitting the :ref:`x-envoy-ratelimited<config_http_filters_router_x-envoy-ratelimited>` header
// in case of rate limiting (i.e. 429 responses).
// Having this header not present potentially makes the request retriable.
DisableXEnvoyRatelimitedHeader bool `` /* 158-byte string literal not displayed */
// This field allows for a custom HTTP response status code to the downstream client when
// the request has been rate limited.
// Defaults to 429 (TooManyRequests).
//
// .. note::
//
// If this is set to < 400, 429 will be used instead.
RateLimitedStatus *v31.HttpStatus `protobuf:"bytes,10,opt,name=rate_limited_status,json=rateLimitedStatus,proto3" json:"rate_limited_status,omitempty"`
// Specifies a list of HTTP headers that should be added to each response for requests that
// have been rate limited.
ResponseHeadersToAdd []*v32.HeaderValueOption `` /* 126-byte string literal not displayed */
// Sets the HTTP status that is returned to the client when the ratelimit server returns an error
// or cannot be reached. The default status is 500.
StatusOnError *v31.HttpStatus `protobuf:"bytes,12,opt,name=status_on_error,json=statusOnError,proto3" json:"status_on_error,omitempty"`
// Optional additional prefix to use when emitting statistics. This allows to distinguish
// emitted statistics between configured “ratelimit“ filters in an HTTP filter chain.
StatPrefix string `protobuf:"bytes,13,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
// If set, this will enable -- but not necessarily enforce -- the rate limit for the given
// fraction of requests.
//
// If not set then “ratelimit.http_filter_enabled“ runtime key will be used to determine
// the fraction of requests to enforce rate limits on. And the default percentage of the
// runtime key is 100% for backwards compatibility.
FilterEnabled *v32.RuntimeFractionalPercent `protobuf:"bytes,14,opt,name=filter_enabled,json=filterEnabled,proto3" json:"filter_enabled,omitempty"`
// If set, this will enforce the rate limit decisions for the given fraction of requests.
//
// Note: this only applies to the fraction of enabled requests.
//
// If not set then “ratelimit.http_filter_enforcing“ runtime key will be used to determine
// the fraction of requests to enforce rate limits on. And the default percentage of the
// runtime key is 100% for backwards compatibility.
FilterEnforced *v32.RuntimeFractionalPercent `protobuf:"bytes,15,opt,name=filter_enforced,json=filterEnforced,proto3" json:"filter_enforced,omitempty"`
// If set, this will override the failure_mode_deny parameter with a runtime fraction.
// If the runtime key is not specified, the value of failure_mode_deny will be used.
//
// Example:
//
// .. code-block:: yaml
//
// failure_mode_deny: true
// failure_mode_deny_percent:
// default_value:
// numerator: 50
// denominator: HUNDRED
// runtime_key: ratelimit.failure_mode_deny_percent
//
// This means that when the rate limit service is unavailable, 50% of requests will be denied
// (fail closed) and 50% will be allowed (fail open).
FailureModeDenyPercent *v32.RuntimeFractionalPercent `` /* 132-byte string literal not displayed */
// Rate limit configuration that is used to generate a list of descriptor entries based on
// the request context. The generated entries will be sent to the rate limit service.
// If this is set, then
// :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
// :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
// will be ignored. However, :ref:`RateLimitPerRoute.rate_limits<envoy_v3_api_field_extensions.filters.http.ratelimit.v3.RateLimitPerRoute.rate_limits>`
// will take precedence over this field.
//
// .. note::
//
// Not all configuration fields of
// :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
// Following fields are not supported:
//
// 1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
// 2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
// 3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
// 4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
RateLimits []*v33.RateLimit `protobuf:"bytes,17,rep,name=rate_limits,json=rateLimits,proto3" json:"rate_limits,omitempty"`
// contains filtered or unexported fields
}
[#next-free-field: 18]
func (*RateLimit) GetDisableXEnvoyRatelimitedHeader ¶
func (*RateLimit) GetEnableXRatelimitHeaders ¶
func (x *RateLimit) GetEnableXRatelimitHeaders() RateLimit_XRateLimitHeadersRFCVersion
func (*RateLimit) GetFailureModeDenyPercent ¶
func (x *RateLimit) GetFailureModeDenyPercent() *v32.RuntimeFractionalPercent
func (*RateLimit) GetFilterEnabled ¶
func (x *RateLimit) GetFilterEnabled() *v32.RuntimeFractionalPercent
func (*RateLimit) GetFilterEnforced ¶
func (x *RateLimit) GetFilterEnforced() *v32.RuntimeFractionalPercent
func (*RateLimit) GetRateLimitService ¶
func (x *RateLimit) GetRateLimitService() *v3.RateLimitServiceConfig
func (*RateLimit) GetRateLimitedAsResourceExhausted ¶
func (*RateLimit) GetRateLimitedStatus ¶
func (x *RateLimit) GetRateLimitedStatus() *v31.HttpStatus
func (*RateLimit) GetResponseHeadersToAdd ¶
func (x *RateLimit) GetResponseHeadersToAdd() []*v32.HeaderValueOption
func (*RateLimit) GetStatusOnError ¶
func (x *RateLimit) GetStatusOnError() *v31.HttpStatus
func (*RateLimit) GetTimeout ¶
func (x *RateLimit) GetTimeout() *durationpb.Duration
func (*RateLimit) ProtoReflect ¶
func (x *RateLimit) ProtoReflect() protoreflect.Message
func (*RateLimit) SetDisableXEnvoyRatelimitedHeader ¶
func (*RateLimit) SetEnableXRatelimitHeaders ¶
func (x *RateLimit) SetEnableXRatelimitHeaders(v RateLimit_XRateLimitHeadersRFCVersion)
func (*RateLimit) SetFailureModeDenyPercent ¶
func (x *RateLimit) SetFailureModeDenyPercent(v *v32.RuntimeFractionalPercent)
func (*RateLimit) SetFilterEnabled ¶
func (x *RateLimit) SetFilterEnabled(v *v32.RuntimeFractionalPercent)
func (*RateLimit) SetFilterEnforced ¶
func (x *RateLimit) SetFilterEnforced(v *v32.RuntimeFractionalPercent)
func (*RateLimit) SetRateLimitService ¶
func (x *RateLimit) SetRateLimitService(v *v3.RateLimitServiceConfig)
func (*RateLimit) SetRateLimitedAsResourceExhausted ¶
func (*RateLimit) SetRateLimitedStatus ¶
func (x *RateLimit) SetRateLimitedStatus(v *v31.HttpStatus)
func (*RateLimit) SetResponseHeadersToAdd ¶
func (x *RateLimit) SetResponseHeadersToAdd(v []*v32.HeaderValueOption)
func (*RateLimit) SetStatusOnError ¶
func (x *RateLimit) SetStatusOnError(v *v31.HttpStatus)
func (*RateLimit) SetTimeout ¶
func (x *RateLimit) SetTimeout(v *durationpb.Duration)
type RateLimitPerRoute ¶
type RateLimitPerRoute struct {
// Specifies if the rate limit filter should include the virtual host rate limits.
// [#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.VhRateLimitsOptions instead.]
VhRateLimits RateLimitPerRoute_VhRateLimitsOptions `` /* 186-byte string literal not displayed */
// Specifies if the rate limit filter should include the lower levels (route level, virtual host level or cluster weight level) rate limits override options.
// [#not-implemented-hide:]
OverrideOption RateLimitPerRoute_OverrideOptions `` /* 186-byte string literal not displayed */
// Rate limit configuration that is used to generate a list of descriptor entries based on
// the request context. The generated entries will be used to find one or multiple matched rate
// limit rule from the “descriptors“.
// If this is set, then
// :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>`,
// :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` and
// :ref:`RateLimit.rate_limits<envoy_v3_api_field_extensions.filters.http.ratelimit.v3.RateLimit.rate_limits>` fields
// will be ignored.
//
// .. note::
//
// Not all configuration fields of
// :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
// Following fields are not supported:
//
// 1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
// 2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
// 3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
// 4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
RateLimits []*v33.RateLimit `protobuf:"bytes,3,rep,name=rate_limits,json=rateLimits,proto3" json:"rate_limits,omitempty"`
// Overrides the domain. If not set, uses the filter-level domain instead.
Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain,omitempty"`
// contains filtered or unexported fields
}
func (*RateLimitPerRoute) GetDomain ¶
func (x *RateLimitPerRoute) GetDomain() string
func (*RateLimitPerRoute) GetOverrideOption ¶
func (x *RateLimitPerRoute) GetOverrideOption() RateLimitPerRoute_OverrideOptions
func (*RateLimitPerRoute) GetRateLimits ¶
func (x *RateLimitPerRoute) GetRateLimits() []*v33.RateLimit
func (*RateLimitPerRoute) GetVhRateLimits ¶
func (x *RateLimitPerRoute) GetVhRateLimits() RateLimitPerRoute_VhRateLimitsOptions
func (*RateLimitPerRoute) ProtoMessage ¶
func (*RateLimitPerRoute) ProtoMessage()
func (*RateLimitPerRoute) ProtoReflect ¶
func (x *RateLimitPerRoute) ProtoReflect() protoreflect.Message
func (*RateLimitPerRoute) Reset ¶
func (x *RateLimitPerRoute) Reset()
func (*RateLimitPerRoute) SetDomain ¶
func (x *RateLimitPerRoute) SetDomain(v string)
func (*RateLimitPerRoute) SetOverrideOption ¶
func (x *RateLimitPerRoute) SetOverrideOption(v RateLimitPerRoute_OverrideOptions)
func (*RateLimitPerRoute) SetRateLimits ¶
func (x *RateLimitPerRoute) SetRateLimits(v []*v33.RateLimit)
func (*RateLimitPerRoute) SetVhRateLimits ¶
func (x *RateLimitPerRoute) SetVhRateLimits(v RateLimitPerRoute_VhRateLimitsOptions)
func (*RateLimitPerRoute) String ¶
func (x *RateLimitPerRoute) String() string
type RateLimitPerRoute_OverrideOptions ¶
type RateLimitPerRoute_OverrideOptions int32
The override option determines how the filter handles the cases where there is an override config at a more specific level than this one (from least to most specific: virtual host, route, cluster weight). [#not-implemented-hide:]
const ( // Client-defined default, typically OVERRIDE_POLICY. If VhRateLimitsOptions is set, that will be used instead. RateLimitPerRoute_DEFAULT RateLimitPerRoute_OverrideOptions = 0 // If there is an override config at a more specific level, use that instead of this one. RateLimitPerRoute_OVERRIDE_POLICY RateLimitPerRoute_OverrideOptions = 1 // If there is an override config at a more specific level, use data from both. RateLimitPerRoute_INCLUDE_POLICY RateLimitPerRoute_OverrideOptions = 2 // If there is an override config at a more specific level, ignore it and use only this one. RateLimitPerRoute_IGNORE_POLICY RateLimitPerRoute_OverrideOptions = 3 )
func (RateLimitPerRoute_OverrideOptions) Descriptor ¶
func (RateLimitPerRoute_OverrideOptions) Descriptor() protoreflect.EnumDescriptor
func (RateLimitPerRoute_OverrideOptions) Enum ¶
func (x RateLimitPerRoute_OverrideOptions) Enum() *RateLimitPerRoute_OverrideOptions
func (RateLimitPerRoute_OverrideOptions) Number ¶
func (x RateLimitPerRoute_OverrideOptions) Number() protoreflect.EnumNumber
func (RateLimitPerRoute_OverrideOptions) String ¶
func (x RateLimitPerRoute_OverrideOptions) String() string
func (RateLimitPerRoute_OverrideOptions) Type ¶
func (RateLimitPerRoute_OverrideOptions) Type() protoreflect.EnumType
type RateLimitPerRoute_VhRateLimitsOptions ¶
type RateLimitPerRoute_VhRateLimitsOptions int32
[#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.VhRateLimitsOptions instead.]
const ( // Use the virtual host rate limits unless the route has a rate limit policy. RateLimitPerRoute_OVERRIDE RateLimitPerRoute_VhRateLimitsOptions = 0 // Use the virtual host rate limits even if the route has a rate limit policy. RateLimitPerRoute_INCLUDE RateLimitPerRoute_VhRateLimitsOptions = 1 // Ignore the virtual host rate limits even if the route does not have a rate limit policy. RateLimitPerRoute_IGNORE RateLimitPerRoute_VhRateLimitsOptions = 2 )
func (RateLimitPerRoute_VhRateLimitsOptions) Descriptor ¶
func (RateLimitPerRoute_VhRateLimitsOptions) Descriptor() protoreflect.EnumDescriptor
func (RateLimitPerRoute_VhRateLimitsOptions) Enum ¶
func (RateLimitPerRoute_VhRateLimitsOptions) Number ¶
func (x RateLimitPerRoute_VhRateLimitsOptions) Number() protoreflect.EnumNumber
func (RateLimitPerRoute_VhRateLimitsOptions) String ¶
func (x RateLimitPerRoute_VhRateLimitsOptions) String() string
func (RateLimitPerRoute_VhRateLimitsOptions) Type ¶
func (RateLimitPerRoute_VhRateLimitsOptions) Type() protoreflect.EnumType
type RateLimitPerRoute_builder ¶
type RateLimitPerRoute_builder struct {
// Specifies if the rate limit filter should include the virtual host rate limits.
// [#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.VhRateLimitsOptions instead.]
VhRateLimits RateLimitPerRoute_VhRateLimitsOptions
// Specifies if the rate limit filter should include the lower levels (route level, virtual host level or cluster weight level) rate limits override options.
// [#not-implemented-hide:]
OverrideOption RateLimitPerRoute_OverrideOptions
// Rate limit configuration that is used to generate a list of descriptor entries based on
// the request context. The generated entries will be used to find one or multiple matched rate
// limit rule from the “descriptors“.
// If this is set, then
// :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>`,
// :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` and
// :ref:`RateLimit.rate_limits<envoy_v3_api_field_extensions.filters.http.ratelimit.v3.RateLimit.rate_limits>` fields
// will be ignored.
//
// .. note::
//
// Not all configuration fields of
// :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
// Following fields are not supported:
//
// 1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
// 2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
// 3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
// 4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
RateLimits []*v33.RateLimit
// Overrides the domain. If not set, uses the filter-level domain instead.
Domain string
// contains filtered or unexported fields
}
func (RateLimitPerRoute_builder) Build ¶
func (b0 RateLimitPerRoute_builder) Build() *RateLimitPerRoute
type RateLimit_XRateLimitHeadersRFCVersion ¶
type RateLimit_XRateLimitHeadersRFCVersion int32
Defines the version of the standard to use for X-RateLimit headers.
[#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.XRateLimitHeadersRFCVersion instead.]
const ( // X-RateLimit headers disabled. RateLimit_OFF RateLimit_XRateLimitHeadersRFCVersion = 0 // Use `draft RFC Version 03 <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_. RateLimit_DRAFT_VERSION_03 RateLimit_XRateLimitHeadersRFCVersion = 1 )
func (RateLimit_XRateLimitHeadersRFCVersion) Descriptor ¶
func (RateLimit_XRateLimitHeadersRFCVersion) Descriptor() protoreflect.EnumDescriptor
func (RateLimit_XRateLimitHeadersRFCVersion) Enum ¶
func (RateLimit_XRateLimitHeadersRFCVersion) Number ¶
func (x RateLimit_XRateLimitHeadersRFCVersion) Number() protoreflect.EnumNumber
func (RateLimit_XRateLimitHeadersRFCVersion) String ¶
func (x RateLimit_XRateLimitHeadersRFCVersion) String() string
func (RateLimit_XRateLimitHeadersRFCVersion) Type ¶
func (RateLimit_XRateLimitHeadersRFCVersion) Type() protoreflect.EnumType
type RateLimit_builder ¶
type RateLimit_builder struct {
// The rate limit domain to use when calling the rate limit service.
Domain string
// Specifies the rate limit configurations to be applied with the same
// stage number. If not set, the default stage number is 0.
//
// .. note::
//
// The filter supports a range of 0 - 10 inclusively for stage numbers.
Stage uint32
// The type of requests the filter should apply to. The supported
// types are “internal“, “external“ or “both“. A request is considered internal if
// :ref:`x-envoy-internal<config_http_conn_man_headers_x-envoy-internal>` is set to true. If
// :ref:`x-envoy-internal<config_http_conn_man_headers_x-envoy-internal>` is not set or false, a
// request is considered external. The filter defaults to “both“, and it will apply to all request
// types.
RequestType string
// The timeout in milliseconds for the rate limit service RPC. If not
// set, this defaults to 20ms.
Timeout *durationpb.Duration
// The filter's behaviour in case the rate limiting service does
// not respond back. When it is set to true, Envoy will not allow traffic in case of
// communication failure between rate limiting service and the proxy.
FailureModeDeny bool
// Specifies whether a “RESOURCE_EXHAUSTED“ gRPC code must be returned instead
// of the default “UNAVAILABLE“ gRPC code for a rate limited gRPC call. The
// HTTP code will be 200 for a gRPC response.
RateLimitedAsResourceExhausted bool
// Configuration for an external rate limit service provider. If not
// specified, any calls to the rate limit service will immediately return
// success.
RateLimitService *v3.RateLimitServiceConfig
// Defines the standard version to use for X-RateLimit headers emitted by the filter:
//
// - “X-RateLimit-Limit“ - indicates the request-quota associated to the
// client in the current time-window followed by the description of the
// quota policy. The values are returned by the rate limiting service in
// :ref:`current_limit<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.current_limit>`
// field. Example: “10, 10;w=1;name="per-ip", 1000;w=3600“.
// - “X-RateLimit-Remaining“ - indicates the remaining requests in the
// current time-window. The values are returned by the rate limiting service
// in :ref:`limit_remaining<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.limit_remaining>`
// field.
// - “X-RateLimit-Reset“ - indicates the number of seconds until reset of
// the current time-window. The values are returned by the rate limiting service
// in :ref:`duration_until_reset<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.duration_until_reset>`
// field.
//
// In case rate limiting policy specifies more than one time window, the values
// above represent the window that is closest to reaching its limit.
//
// For more information about the headers specification see selected version of
// the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
//
// Disabled by default.
//
// [#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.XRateLimitHeadersRFCVersion instead.]
EnableXRatelimitHeaders RateLimit_XRateLimitHeadersRFCVersion
// Disables emitting the :ref:`x-envoy-ratelimited<config_http_filters_router_x-envoy-ratelimited>` header
// in case of rate limiting (i.e. 429 responses).
// Having this header not present potentially makes the request retriable.
DisableXEnvoyRatelimitedHeader bool
// This field allows for a custom HTTP response status code to the downstream client when
// the request has been rate limited.
// Defaults to 429 (TooManyRequests).
//
// .. note::
//
// If this is set to < 400, 429 will be used instead.
RateLimitedStatus *v31.HttpStatus
// Specifies a list of HTTP headers that should be added to each response for requests that
// have been rate limited.
ResponseHeadersToAdd []*v32.HeaderValueOption
// Sets the HTTP status that is returned to the client when the ratelimit server returns an error
// or cannot be reached. The default status is 500.
StatusOnError *v31.HttpStatus
// Optional additional prefix to use when emitting statistics. This allows to distinguish
// emitted statistics between configured “ratelimit“ filters in an HTTP filter chain.
StatPrefix string
// If set, this will enable -- but not necessarily enforce -- the rate limit for the given
// fraction of requests.
//
// If not set then “ratelimit.http_filter_enabled“ runtime key will be used to determine
// the fraction of requests to enforce rate limits on. And the default percentage of the
// runtime key is 100% for backwards compatibility.
FilterEnabled *v32.RuntimeFractionalPercent
// If set, this will enforce the rate limit decisions for the given fraction of requests.
//
// Note: this only applies to the fraction of enabled requests.
//
// If not set then “ratelimit.http_filter_enforcing“ runtime key will be used to determine
// the fraction of requests to enforce rate limits on. And the default percentage of the
// runtime key is 100% for backwards compatibility.
FilterEnforced *v32.RuntimeFractionalPercent
// If set, this will override the failure_mode_deny parameter with a runtime fraction.
// If the runtime key is not specified, the value of failure_mode_deny will be used.
//
// Example:
//
// .. code-block:: yaml
//
// failure_mode_deny: true
// failure_mode_deny_percent:
// default_value:
// numerator: 50
// denominator: HUNDRED
// runtime_key: ratelimit.failure_mode_deny_percent
//
// This means that when the rate limit service is unavailable, 50% of requests will be denied
// (fail closed) and 50% will be allowed (fail open).
FailureModeDenyPercent *v32.RuntimeFractionalPercent
// Rate limit configuration that is used to generate a list of descriptor entries based on
// the request context. The generated entries will be sent to the rate limit service.
// If this is set, then
// :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
// :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
// will be ignored. However, :ref:`RateLimitPerRoute.rate_limits<envoy_v3_api_field_extensions.filters.http.ratelimit.v3.RateLimitPerRoute.rate_limits>`
// will take precedence over this field.
//
// .. note::
//
// Not all configuration fields of
// :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
// Following fields are not supported:
//
// 1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
// 2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
// 3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
// 4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
RateLimits []*v33.RateLimit
// contains filtered or unexported fields
}
func (RateLimit_builder) Build ¶
func (b0 RateLimit_builder) Build() *RateLimit
Source Files
¶
- rate_limit.pb.go