customizations

package
v1.38.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package customizations provides customizations for the Amazon DynamoDB API client.

The DynamoDB API client uses two customizations, response checksum validation, and manual content-encoding: gzip support.

Middleware layering

Checksum validation needs to be performed first in deserialization chain on top of gzip decompression. Since the behavior of Deserialization is in reverse order to the other stack steps its easier to consider that "after" means "before".

HTTP Response -> Checksum ->  gzip decompress -> deserialize

Response checksum validation

DynamoDB responses can include a X-Amz-Crc32 header with the CRC32 checksum value of the response body. If the response body is content-encoding: gzip, the checksum is of the gzipped response content.

If the header is present, the SDK should validate that the response payload computed CRC32 checksum matches the value provided in the header. The checksum header is based on the original payload provided returned by the service. Which means that if the response is gzipped the checksum is of the gzipped response, not the decompressed response bytes.

Customization option:

DisableValidateResponseChecksum (Enabled by Default)

Accept encoding gzip

For customization around accept encoding, dynamodb client uses the middlewares defined at service/internal/accept-encoding. Please refer to the documentation for `accept-encoding` package for more details.

Customization option:

EnableAcceptEncodingGzip (Disabled by Default)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddValidateResponseChecksum

func AddValidateResponseChecksum(stack *middleware.Stack, options AddValidateResponseChecksumOptions) error

AddValidateResponseChecksum adds the Checksum to the middleware stack if checksum is not disabled.

Types

type AddValidateResponseChecksumOptions

type AddValidateResponseChecksumOptions struct {
	Disable bool
}

AddValidateResponseChecksumOptions provides the options for the AddValidateResponseChecksum middleware setup.

type Checksum added in v0.30.0

type Checksum struct{}

Checksum provides a middleware to validate the DynamoDB response body's integrity by comparing the computed CRC32 checksum with the value provided in the HTTP response header.

func (*Checksum) HandleDeserialize added in v0.30.0

func (m *Checksum) HandleDeserialize(
	ctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler,
) (
	output middleware.DeserializeOutput, metadata middleware.Metadata, err error,
)

HandleDeserialize implements the Deserialize middleware handle method.

func (*Checksum) ID added in v0.30.0

func (*Checksum) ID() string

ID returns the middleware ID.

Jump to

Keyboard shortcuts

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