1/*
2Package customizations provides customizations for the Amazon S3 API client.
3
4This package provides support for following S3 customizations
5
6    ProcessARN Middleware: processes an ARN if provided as input and updates the endpoint as per the arn type
7
8    UpdateEndpoint Middleware: resolves a custom endpoint as per s3 config options
9
10    RemoveBucket Middleware: removes a serialized bucket name from request url path
11
12    processResponseWith200Error Middleware: Deserializing response error with 200 status code
13
14
15Virtual Host style url addressing
16
17Since serializers serialize by default as path style url, we use customization
18to modify the endpoint url when `UsePathStyle` option on S3Client is unset or
19false. This flag will be ignored if `UseAccelerate` option is set to true.
20
21If UseAccelerate is not enabled, and the bucket name is not a valid hostname
22label, they SDK will fallback to forcing the request to be made as if
23UsePathStyle was enabled. This behavior is also used if UseDualStack is enabled.
24
25https://docs.aws.amazon.com/AmazonS3/latest/dev/dual-stack-endpoints.html#dual-stack-endpoints-description
26
27
28Transfer acceleration
29
30By default S3 Transfer acceleration support is disabled. By enabling `UseAccelerate`
31option on S3Client, one can enable s3 transfer acceleration support. Transfer
32acceleration only works with Virtual Host style addressing, and thus `UsePathStyle`
33option if set is ignored. Transfer acceleration is not supported for S3 operations
34DeleteBucket, ListBuckets, and CreateBucket.
35
36
37Dualstack support
38
39By default dualstack support for s3 client is disabled. By enabling `UseDualstack`
40option on s3 client, you can enable dualstack endpoint support.
41
42
43Endpoint customizations
44
45
46Customizations to lookup ARN, process ARN needs to happen before request serialization.
47UpdateEndpoint middleware which mutates resources based on Options such as
48UseDualstack, UseAccelerate for modifying resolved endpoint are executed after
49request serialization. Remove bucket middleware is executed after
50an request is serialized, and removes the serialized bucket name from request path
51
52 Middleware layering:
53
54
55 Initialize : HTTP Request -> ARN Lookup -> Input-Validation -> Serialize step
56
57 Serialize : HTTP Request -> Process ARN -> operation serializer -> Update-Endpoint customization -> Remove-Bucket -> next middleware
58
59
60Customization options:
61 UseARNRegion (Disabled by Default)
62
63 UsePathStyle (Disabled by Default)
64
65 UseAccelerate (Disabled by Default)
66
67 UseDualstack (Disabled by Default)
68
69
70Handle Error response with 200 status code
71
72S3 operations: CopyObject, CompleteMultipartUpload, UploadPartCopy can have an
73error Response with status code 2xx. The processResponseWith200Error middleware
74customizations enables SDK to check for an error within response body prior to
75deserialization.
76
77As the check for 2xx response containing an error needs to be performed earlier
78than response deserialization. Since the behavior of Deserialization is in
79reverse order to the other stack steps its easier to consider that "after" means
80"before".
81
82 Middleware layering:
83
84 HTTP Response -> handle 200 error customization -> deserialize
85
86*/
87package customizations
88