ratelimit

package
v1.17.0-beta34 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ExtensionName = "rate_limit"
	CustomDomain  = "custom"
	RequestType   = "both"

	CustomStage           = uint32(1)
	CustomStageBeforeAuth = uint32(3)
)
View Source
const SetDescriptorValue = "solo.setDescriptor.uniqueValue"

special value for generic keys that signals the enterprise rate limit server to treat those descriptors differently (for the set-style rate-limit API)

Variables

View Source
var (
	// rate limiting should happen after auth
	DefaultFilterStage = plugins.DuringStage(plugins.RateLimitStage)

	// we may want to rate limit before executing the AuthN and AuthZ stages
	// notably, AuthZ still needs to occur after AuthN
	BeforeAuthStage = plugins.BeforeStage(plugins.AuthNStage)

	DefaultTimeout = prototime.DurationToProto(100 * time.Millisecond)

	ServerNotFound = func(usRef *core.ResourceRef) error {
		return eris.Errorf("ratelimit server upstream not found %s", usRef.String())
	}
)

Functions

func ConvertActions

func ConvertActions(ctx context.Context, actions []*solo_rl.Action) ([]*envoy_config_route_v3.RateLimit_Action, error)

ConvertActions generates Envoy RateLimit_Actions from the solo-apis API. It checks that all required fields are set.

func GenerateEnvoyConfigForFilterWith

func GenerateEnvoyConfigForFilterWith(
	upstreamRef *core.ResourceRef,
	grpcService *ratelimit.GrpcService,
	domain string,
	stage uint32,
	timeout *duration.Duration,
	denyOnFail bool,
	enableXRatelimitHeaders bool,
) *envoyratelimit.RateLimit

func GenerateEnvoyHttpFilterConfig added in v1.9.25

func GenerateEnvoyHttpFilterConfig(serverSettings *ratelimit.Settings) *envoy_extensions_filters_http_ratelimit_v3.RateLimit

func GetFilterStageForRateLimitStage added in v1.9.25

func GetFilterStageForRateLimitStage(rateLimitStage uint32) plugins.FilterStage

func GetRateLimitStageForServerSettings added in v1.9.25

func GetRateLimitStageForServerSettings(serverSettings *ratelimit.Settings) uint32

func NewPlugin

func NewPlugin() *plugin

Types

This section is empty.

Jump to

Keyboard shortcuts

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