customizations

package
v1.39.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package customizations provides customizations for the Amazon S3-Control API client.

This package provides support for following S3-Control customizations

BackfillInput Middleware: validates and backfills data from an ARN resource into a copy of operation input.

ProcessOutpostID Middleware: applied on CreateBucket, ListRegionalBuckets operation, triggers a custom endpoint generation flow.

ProcessARN Middleware: processes an ARN if provided as input and updates the endpoint as per the arn type.

UpdateEndpoint Middleware: resolves a custom endpoint as per s3-control config options.

Dualstack support

By default dualstack support for s3-control client is disabled. By enabling `UseDualstack` option on s3-control client, you can enable dualstack endpoint support.

Endpoint customizations

Customizations to lookup ARN, backfill input, process outpost id, process ARN needs to happen before request serialization. UpdateEndpoint middleware which mutates resources based on Options such as UseDualstack for modifying resolved endpoint are executed after request serialization.

Middleware layering:

Initialize : HTTP Request -> ARN Lookup -> BackfillInput -> Input-Validation -> Serialize step

Serialize : HTTP Request -> Process-OutpostID -> Process ARN -> operation serializer -> Update-Endpoint customization -> next middleware

Customization option:

UseARNRegion (Disabled by Default)

UseDualstack (Disabled by Default)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDisableHostPrefixMiddleware added in v1.37.0

func AddDisableHostPrefixMiddleware(s *middleware.Stack) error

AddDisableHostPrefixMiddleware adds the middleware to the stack.

func AddUpdateOutpostARN added in v1.32.0

func AddUpdateOutpostARN(stack *middleware.Stack) error

AddUpdateOutpostARN is used by operation runtimes to add this middleware to their middleware stack.

func UpdateEndpoint

func UpdateEndpoint(stack *middleware.Stack, options UpdateEndpointOptions) (err error)

UpdateEndpoint adds the middleware to the middleware stack based on the UpdateEndpointOptions.

Types

type BackfillInput added in v0.30.0

type BackfillInput struct {

	// CopyInput creates a copy of input to be modified, this ensures the original input is not modified.
	CopyInput func(interface{}) (interface{}, error)

	// BackfillAccountID points to a function that validates the input for accountID. If absent, it populates the
	// accountID and returns a copy. If present, but different than passed in accountID value throws an error
	BackfillAccountID func(interface{}, string) error
}

BackfillInput validates and backfill's values from ARN into request serializable input. This middleware must be executed after `ARNLookup` and before `inputValidationMiddleware`.

func (*BackfillInput) HandleInitialize added in v0.30.0

HandleInitialize handles the middleware behavior in an Initialize step.

func (*BackfillInput) ID added in v0.30.0

func (m *BackfillInput) ID() string

ID representing the middleware

type DisableHostPrefixMiddleware added in v1.37.0

type DisableHostPrefixMiddleware struct{}

DisableHostPrefixMiddleware disables host prefix serialization when v2 endpoint resolution was used.

func (*DisableHostPrefixMiddleware) HandleFinalize added in v1.37.0

HandleFinalize controls whether to serialize modeled host prefixes based on the type of endpoint resolution used.

func (*DisableHostPrefixMiddleware) ID added in v1.37.0

ID identifies the middleware.

type EndpointResolver added in v0.30.0

type EndpointResolver interface {
	ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}

EndpointResolver interface for resolving service endpoints.

type EndpointResolverOptions added in v0.30.0

type EndpointResolverOptions = internalendpoints.Options

EndpointResolverOptions is the service endpoint resolver options

type UpdateEndpointOptions

type UpdateEndpointOptions struct {

	// Accessor are parameter accessors used by the middleware
	Accessor UpdateEndpointParameterAccessor

	// UseARNRegion indicates if region parsed from an ARN should be used.
	UseARNRegion bool

	// EndpointResolver used to resolve endpoints. This may be a custom endpoint resolver
	EndpointResolver EndpointResolver

	// EndpointResolverOptions used by endpoint resolver
	EndpointResolverOptions EndpointResolverOptions
}

UpdateEndpointOptions provides the options for the UpdateEndpoint middleware setup.

type UpdateEndpointParameterAccessor added in v0.30.0

type UpdateEndpointParameterAccessor struct {
	// GetARNInput points to a function that processes an input and returns ARN as string ptr,
	// and bool indicating if ARN is supported or set.
	GetARNInput func(interface{}) (*string, bool)

	// GetOutpostIDInput points to a function that processes an input and returns a outpostID as string ptr,
	// and bool indicating if outpostID is supported or set.
	GetOutpostIDInput func(interface{}) (*string, bool)

	// CopyInput creates a copy of input to be modified, this ensures the original input is not modified.
	CopyInput func(interface{}) (interface{}, error)

	// BackfillAccountID points to a function that validates the input for accountID. If absent, it populates the
	// accountID. If present, but different than passed in accountID value throws an error
	BackfillAccountID func(interface{}, string) error

	// UpdateARNField points to a function that takes in a copy of input, updates the ARN field with
	// the provided value and returns any error
	UpdateARNField func(interface{}, string) error
}

UpdateEndpointParameterAccessor represents accessor functions used by the middleware

Jump to

Keyboard shortcuts

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