extapigateway

package
v2.4.26 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type ApiGatewayThrottleAttackState

type ApiGatewayThrottleAttackState struct {
	ApiId            string
	StageName        string
	Account          string
	Region           string
	ProtocolType     string // "REST" or "HTTP"
	DiscoveredByRole *string

	// Target values (apply to both REST and HTTP).
	TargetRateLimit  float64
	TargetBurstLimit int32

	// REST snapshot pulled from Stage.MethodSettings["*/*"]. Three cases drive the Stop restore:
	//   - HadOriginalThrottleSettings=true → replace throttle fields with the captured values.
	//   - HadOriginalThrottleSettings=false && RestStageHadMethodSetting=true → reset throttle to
	//     account defaults via op=replace value=-1, preserving other MethodSetting fields (caching,
	//     metrics, logging).
	//   - RestStageHadMethodSetting=false → op=remove path=/*/* to delete the MethodSetting our Start
	//     implicitly created. AWS does not support op=remove on individual property paths under a
	//     MethodSetting, so the per-field remove that was here previously erroneously failed.
	OriginalRateLimit           float64
	OriginalBurstLimit          int32
	HadOriginalThrottleSettings bool
	RestStageHadMethodSetting   bool

	// HTTP snapshot: full Stage.DefaultRouteSettings serialised as JSON so we can restore non-throttle
	// fields (DataTraceEnabled, DetailedMetricsEnabled, LoggingLevel) verbatim. Empty string means
	// DefaultRouteSettings was nil; on Stop we send an empty RouteSettings to clear what we set.
	HttpOrigDefaultRouteSettings string
}

ApiGatewayThrottleAttackState captures the throttle config of an API Gateway stage so we can restore it on stop. The same state struct serves both REST (v1) and HTTP (v2) stages — ProtocolType drives the branching in Prepare/Start/Stop.

type HttpApiGatewayApi

type HttpApiGatewayApi interface {
	GetApis(ctx context.Context, params *apigatewayv2.GetApisInput, optFns ...func(*apigatewayv2.Options)) (*apigatewayv2.GetApisOutput, error)
	GetStages(ctx context.Context, params *apigatewayv2.GetStagesInput, optFns ...func(*apigatewayv2.Options)) (*apigatewayv2.GetStagesOutput, error)
	GetStage(ctx context.Context, params *apigatewayv2.GetStageInput, optFns ...func(*apigatewayv2.Options)) (*apigatewayv2.GetStageOutput, error)
	UpdateStage(ctx context.Context, params *apigatewayv2.UpdateStageInput, optFns ...func(*apigatewayv2.Options)) (*apigatewayv2.UpdateStageOutput, error)
}

type RestApiGatewayApi

type RestApiGatewayApi interface {
	GetRestApis(ctx context.Context, params *apigateway.GetRestApisInput, optFns ...func(*apigateway.Options)) (*apigateway.GetRestApisOutput, error)
	GetStages(ctx context.Context, params *apigateway.GetStagesInput, optFns ...func(*apigateway.Options)) (*apigateway.GetStagesOutput, error)
	GetStage(ctx context.Context, params *apigateway.GetStageInput, optFns ...func(*apigateway.Options)) (*apigateway.GetStageOutput, error)
	UpdateStage(ctx context.Context, params *apigateway.UpdateStageInput, optFns ...func(*apigateway.Options)) (*apigateway.UpdateStageOutput, error)
}

Jump to

Keyboard shortcuts

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