ratelimit

package
v1.17.0-beta35 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 23 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_github_com_solo_io_gloo_projects_gloo_api_v1_enterprise_options_ratelimit_ratelimit_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type GrpcService added in v1.13.36

type GrpcService struct {

	// Set the authority header when calling the gRPC service.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// contains filtered or unexported fields
}

func (*GrpcService) Clone added in v1.13.36

func (m *GrpcService) Clone() proto.Message

Clone function

func (*GrpcService) Descriptor deprecated added in v1.13.36

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

Deprecated: Use GrpcService.ProtoReflect.Descriptor instead.

func (*GrpcService) Equal added in v1.13.36

func (m *GrpcService) Equal(that interface{}) bool

Equal function

func (*GrpcService) GetAuthority added in v1.13.36

func (x *GrpcService) GetAuthority() string

func (*GrpcService) Hash added in v1.13.36

func (m *GrpcService) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*GrpcService) ProtoMessage added in v1.13.36

func (*GrpcService) ProtoMessage()

func (*GrpcService) ProtoReflect added in v1.13.36

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

func (*GrpcService) Reset added in v1.13.36

func (x *GrpcService) Reset()

func (*GrpcService) String added in v1.13.36

func (x *GrpcService) String() string

type IngressRateLimit

type IngressRateLimit struct {
	AuthorizedLimits *v1alpha1.RateLimit `protobuf:"bytes,1,opt,name=authorized_limits,json=authorizedLimits,proto3" json:"authorized_limits,omitempty"`
	AnonymousLimits  *v1alpha1.RateLimit `protobuf:"bytes,2,opt,name=anonymous_limits,json=anonymousLimits,proto3" json:"anonymous_limits,omitempty"`
	// contains filtered or unexported fields
}

Basic rate-limiting API

func (*IngressRateLimit) Clone added in v1.8.24

func (m *IngressRateLimit) Clone() proto.Message

Clone function

func (*IngressRateLimit) Descriptor deprecated

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

Deprecated: Use IngressRateLimit.ProtoReflect.Descriptor instead.

func (*IngressRateLimit) Equal

func (m *IngressRateLimit) Equal(that interface{}) bool

Equal function

func (*IngressRateLimit) GetAnonymousLimits

func (x *IngressRateLimit) GetAnonymousLimits() *v1alpha1.RateLimit

func (*IngressRateLimit) GetAuthorizedLimits

func (x *IngressRateLimit) GetAuthorizedLimits() *v1alpha1.RateLimit

func (*IngressRateLimit) Hash added in v1.2.13

func (m *IngressRateLimit) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*IngressRateLimit) ProtoMessage

func (*IngressRateLimit) ProtoMessage()

func (*IngressRateLimit) ProtoReflect added in v1.6.0

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

func (*IngressRateLimit) Reset

func (x *IngressRateLimit) Reset()

func (*IngressRateLimit) String

func (x *IngressRateLimit) String() string

type RateLimitConfigRef added in v1.5.0

type RateLimitConfigRef struct {
	Name      string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

A reference to a `RateLimitConfig` resource.

func (*RateLimitConfigRef) Clone added in v1.8.24

func (m *RateLimitConfigRef) Clone() proto.Message

Clone function

func (*RateLimitConfigRef) Descriptor deprecated added in v1.5.0

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

Deprecated: Use RateLimitConfigRef.ProtoReflect.Descriptor instead.

func (*RateLimitConfigRef) Equal added in v1.5.0

func (m *RateLimitConfigRef) Equal(that interface{}) bool

Equal function

func (*RateLimitConfigRef) GetName added in v1.5.0

func (x *RateLimitConfigRef) GetName() string

func (*RateLimitConfigRef) GetNamespace added in v1.5.0

func (x *RateLimitConfigRef) GetNamespace() string

func (*RateLimitConfigRef) Hash added in v1.5.0

func (m *RateLimitConfigRef) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*RateLimitConfigRef) ProtoMessage added in v1.5.0

func (*RateLimitConfigRef) ProtoMessage()

func (*RateLimitConfigRef) ProtoReflect added in v1.6.0

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

func (*RateLimitConfigRef) Reset added in v1.5.0

func (x *RateLimitConfigRef) Reset()

func (*RateLimitConfigRef) String added in v1.5.0

func (x *RateLimitConfigRef) String() string

type RateLimitConfigRefs added in v1.5.0

type RateLimitConfigRefs struct {
	Refs []*RateLimitConfigRef `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty"`
	// contains filtered or unexported fields
}

A list of references to `RateLimitConfig` resources. Each resource represents a rate limit policy that will be independently enforced.

func (*RateLimitConfigRefs) Clone added in v1.8.24

func (m *RateLimitConfigRefs) Clone() proto.Message

Clone function

func (*RateLimitConfigRefs) Descriptor deprecated added in v1.5.0

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

Deprecated: Use RateLimitConfigRefs.ProtoReflect.Descriptor instead.

func (*RateLimitConfigRefs) Equal added in v1.5.0

func (m *RateLimitConfigRefs) Equal(that interface{}) bool

Equal function

func (*RateLimitConfigRefs) GetRefs added in v1.5.0

func (x *RateLimitConfigRefs) GetRefs() []*RateLimitConfigRef

func (*RateLimitConfigRefs) Hash added in v1.5.0

func (m *RateLimitConfigRefs) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*RateLimitConfigRefs) ProtoMessage added in v1.5.0

func (*RateLimitConfigRefs) ProtoMessage()

func (*RateLimitConfigRefs) ProtoReflect added in v1.6.0

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

func (*RateLimitConfigRefs) Reset added in v1.5.0

func (x *RateLimitConfigRefs) Reset()

func (*RateLimitConfigRefs) String added in v1.5.0

func (x *RateLimitConfigRefs) String() string

type RateLimitRouteExtension

type RateLimitRouteExtension struct {

	// Whether or not to include rate limits as defined on the VirtualHost in addition to rate limits on the Route.
	IncludeVhRateLimits bool `protobuf:"varint,1,opt,name=include_vh_rate_limits,json=includeVhRateLimits,proto3" json:"include_vh_rate_limits,omitempty"`
	// Define individual rate limits here. Each rate limit will be evaluated, if any rate limit
	// would be throttled, the entire request returns a 429 (gets throttled)
	RateLimits []*v1alpha1.RateLimitActions `protobuf:"bytes,2,rep,name=rate_limits,json=rateLimits,proto3" json:"rate_limits,omitempty"`
	// The token bucket configuration to use for local rate limiting requests.
	// These options provide the ability to locally rate limit the connections in envoy. Each request processed by the filter consumes a single token.
	// If the token is available, the request will be allowed. If no tokens are available, the request will receive the configured rate limit status.
	// This overrides any local rate limit configured on the vHost or gateway and requests to this route do not count against requests to the vHost or gateway's http local rate limit.
	LocalRatelimit *local_ratelimit.TokenBucket `protobuf:"bytes,3,opt,name=local_ratelimit,json=localRatelimit,proto3" json:"local_ratelimit,omitempty"`
	// contains filtered or unexported fields
}

Use this field if you want to inline the Envoy rate limits for this Route. Note that this does not configure the rate limit server. If you are running Gloo Enterprise, you need to specify the server configuration via the appropriate field in the Gloo `Settings` resource. If you are running a custom rate limit server you need to configure it yourself.

func (*RateLimitRouteExtension) Clone added in v1.8.24

Clone function

func (*RateLimitRouteExtension) Descriptor deprecated

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

Deprecated: Use RateLimitRouteExtension.ProtoReflect.Descriptor instead.

func (*RateLimitRouteExtension) Equal

func (m *RateLimitRouteExtension) Equal(that interface{}) bool

Equal function

func (*RateLimitRouteExtension) GetIncludeVhRateLimits

func (x *RateLimitRouteExtension) GetIncludeVhRateLimits() bool

func (*RateLimitRouteExtension) GetLocalRatelimit added in v1.15.12

func (x *RateLimitRouteExtension) GetLocalRatelimit() *local_ratelimit.TokenBucket

func (*RateLimitRouteExtension) GetRateLimits

func (x *RateLimitRouteExtension) GetRateLimits() []*v1alpha1.RateLimitActions

func (*RateLimitRouteExtension) Hash added in v1.2.13

func (m *RateLimitRouteExtension) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*RateLimitRouteExtension) ProtoMessage

func (*RateLimitRouteExtension) ProtoMessage()

func (*RateLimitRouteExtension) ProtoReflect added in v1.6.0

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

func (*RateLimitRouteExtension) Reset

func (x *RateLimitRouteExtension) Reset()

func (*RateLimitRouteExtension) String

func (x *RateLimitRouteExtension) String() string

type RateLimitVhostExtension

type RateLimitVhostExtension struct {

	// Define individual rate limits here. Each rate limit will be evaluated, if any rate limit
	// would be throttled, the entire request returns a 429 (gets throttled)
	RateLimits []*v1alpha1.RateLimitActions `protobuf:"bytes,1,rep,name=rate_limits,json=rateLimits,proto3" json:"rate_limits,omitempty"`
	// The token bucket configuration to use for local rate limiting requests.
	// These options provide the ability to locally rate limit the connections in envoy. Each request processed by the filter consumes a single token.
	// If the token is available, the request will be allowed. If no tokens are available, the request will receive the configured rate limit status.
	// This overrides any local rate limit configured on the gateway and requests to this vHost do not count against requests to the gateway's http local rate limit.
	// All routes that are part of this vHost will share this rate limit unless explicity configured with another limit.
	LocalRatelimit *local_ratelimit.TokenBucket `protobuf:"bytes,2,opt,name=local_ratelimit,json=localRatelimit,proto3" json:"local_ratelimit,omitempty"`
	// contains filtered or unexported fields
}

Use this field if you want to inline the Envoy rate limits for this VirtualHost. Note that this does not configure the rate limit server. If you are running Gloo Enterprise, you need to specify the server configuration via the appropriate field in the Gloo `Settings` resource. If you are running a custom rate limit server you need to configure it yourself.

func (*RateLimitVhostExtension) Clone added in v1.8.24

Clone function

func (*RateLimitVhostExtension) Descriptor deprecated

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

Deprecated: Use RateLimitVhostExtension.ProtoReflect.Descriptor instead.

func (*RateLimitVhostExtension) Equal

func (m *RateLimitVhostExtension) Equal(that interface{}) bool

Equal function

func (*RateLimitVhostExtension) GetLocalRatelimit added in v1.15.12

func (x *RateLimitVhostExtension) GetLocalRatelimit() *local_ratelimit.TokenBucket

func (*RateLimitVhostExtension) GetRateLimits

func (x *RateLimitVhostExtension) GetRateLimits() []*v1alpha1.RateLimitActions

func (*RateLimitVhostExtension) Hash added in v1.2.13

func (m *RateLimitVhostExtension) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*RateLimitVhostExtension) ProtoMessage

func (*RateLimitVhostExtension) ProtoMessage()

func (*RateLimitVhostExtension) ProtoReflect added in v1.6.0

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

func (*RateLimitVhostExtension) Reset

func (x *RateLimitVhostExtension) Reset()

func (*RateLimitVhostExtension) String

func (x *RateLimitVhostExtension) String() string

type ServiceSettings

type ServiceSettings struct {
	Descriptors    []*v1alpha1.Descriptor    `protobuf:"bytes,1,rep,name=descriptors,proto3" json:"descriptors,omitempty"`
	SetDescriptors []*v1alpha1.SetDescriptor `protobuf:"bytes,2,rep,name=set_descriptors,json=setDescriptors,proto3" json:"set_descriptors,omitempty"`
	// contains filtered or unexported fields
}

API based on Envoy's rate-limit service API. (reference here: https://github.com/lyft/ratelimit#configuration) Sample configuration below:

descriptors:

  • key: account_id descriptors:
  • key: plan value: BASIC rateLimit: requestsPerUnit: 1 unit: MINUTE
  • key: plan value: PLUS rateLimit: requestsPerUnit: 20 unit: MINUTE

func (*ServiceSettings) Clone added in v1.8.24

func (m *ServiceSettings) Clone() proto.Message

Clone function

func (*ServiceSettings) Descriptor deprecated

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

Deprecated: Use ServiceSettings.ProtoReflect.Descriptor instead.

func (*ServiceSettings) Equal

func (m *ServiceSettings) Equal(that interface{}) bool

Equal function

func (*ServiceSettings) GetDescriptors

func (x *ServiceSettings) GetDescriptors() []*v1alpha1.Descriptor

func (*ServiceSettings) GetSetDescriptors added in v1.6.0

func (x *ServiceSettings) GetSetDescriptors() []*v1alpha1.SetDescriptor

func (*ServiceSettings) Hash added in v1.2.13

func (m *ServiceSettings) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*ServiceSettings) ProtoMessage

func (*ServiceSettings) ProtoMessage()

func (*ServiceSettings) ProtoReflect added in v1.6.0

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

func (*ServiceSettings) Reset

func (x *ServiceSettings) Reset()

func (*ServiceSettings) String

func (x *ServiceSettings) String() string

type Settings

type Settings struct {
	RatelimitServerRef *core.ResourceRef  `protobuf:"bytes,1,opt,name=ratelimit_server_ref,json=ratelimitServerRef,proto3" json:"ratelimit_server_ref,omitempty"`
	RequestTimeout     *duration.Duration `protobuf:"bytes,2,opt,name=request_timeout,json=requestTimeout,proto3" json:"request_timeout,omitempty"`
	DenyOnFail         bool               `protobuf:"varint,3,opt,name=deny_on_fail,json=denyOnFail,proto3" json:"deny_on_fail,omitempty"`
	// Set this to true to return Envoy's X-RateLimit headers to the downstream.
	// reference docs here: https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/ratelimit/v3/rate_limit.proto.html#envoy-v3-api-field-extensions-filters-http-ratelimit-v3-ratelimit-enable-x-ratelimit-headers
	EnableXRatelimitHeaders bool `` /* 135-byte string literal not displayed */
	// Set this is set to true if you would like to rate limit traffic before applying external auth to it.
	// *Note*: When this is true, you will lose some features like being able to rate limit a request based on its auth state
	RateLimitBeforeAuth bool `protobuf:"varint,9,opt,name=rate_limit_before_auth,json=rateLimitBeforeAuth,proto3" json:"rate_limit_before_auth,omitempty"`
	// Types that are assignable to ServiceType:
	//
	//	*Settings_GrpcService
	ServiceType isSettings_ServiceType `protobuf_oneof:"service_type"`
	// contains filtered or unexported fields
}

func (*Settings) Clone added in v1.8.24

func (m *Settings) Clone() proto.Message

Clone function

func (*Settings) Descriptor deprecated

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

Deprecated: Use Settings.ProtoReflect.Descriptor instead.

func (*Settings) Equal

func (m *Settings) Equal(that interface{}) bool

Equal function

func (*Settings) GetDenyOnFail

func (x *Settings) GetDenyOnFail() bool

func (*Settings) GetEnableXRatelimitHeaders added in v1.9.25

func (x *Settings) GetEnableXRatelimitHeaders() bool

func (*Settings) GetGrpcService added in v1.13.36

func (x *Settings) GetGrpcService() *GrpcService

func (*Settings) GetRateLimitBeforeAuth

func (x *Settings) GetRateLimitBeforeAuth() bool

func (*Settings) GetRatelimitServerRef

func (x *Settings) GetRatelimitServerRef() *core.ResourceRef

func (*Settings) GetRequestTimeout

func (x *Settings) GetRequestTimeout() *duration.Duration

func (*Settings) GetServiceType added in v1.13.36

func (m *Settings) GetServiceType() isSettings_ServiceType

func (*Settings) Hash added in v1.2.13

func (m *Settings) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*Settings) ProtoMessage

func (*Settings) ProtoMessage()

func (*Settings) ProtoReflect added in v1.6.0

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

func (*Settings) Reset

func (x *Settings) Reset()

func (*Settings) String

func (x *Settings) String() string

type Settings_GrpcService added in v1.13.36

type Settings_GrpcService struct {
	// Optional gRPC settings used when calling the ratelimit server.
	GrpcService *GrpcService `protobuf:"bytes,10,opt,name=grpc_service,json=grpcService,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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