@jjrawlins/cdk-ami-builder 0.0.48 → 0.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +11 -11
- package/cdk-ami-builder/jsii/jsii.go +2 -2
- package/cdk-ami-builder/version +1 -1
- package/lib/ImagePipeline/ImagePipeline.js +1 -1
- package/lib/Lambdas/CheckStateMachineStatus/CheckStateMachineStatus-function.js +1 -1
- package/lib/Lambdas/StartStateMachine/StartStateMachine-function.js +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js +88090 -87044
- package/node_modules/@aws-sdk/client-ec2/package.json +6 -6
- package/node_modules/@aws-sdk/client-ecs/dist-cjs/index.js +4836 -5148
- package/node_modules/@aws-sdk/client-ecs/package.json +6 -6
- package/node_modules/@aws-sdk/client-kms/dist-cjs/index.js +3963 -4397
- package/node_modules/@aws-sdk/client-kms/package.json +6 -6
- package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +11771 -11916
- package/node_modules/@aws-sdk/client-s3/package.json +10 -10
- package/node_modules/@aws-sdk/client-secrets-manager/dist-cjs/index.js +1582 -1740
- package/node_modules/@aws-sdk/client-secrets-manager/package.json +6 -6
- package/node_modules/@aws-sdk/client-sfn/dist-cjs/index.js +3292 -3664
- package/node_modules/@aws-sdk/client-sfn/package.json +6 -6
- package/node_modules/@aws-sdk/client-sns/dist-cjs/index.js +4326 -4601
- package/node_modules/@aws-sdk/client-sns/package.json +6 -6
- package/node_modules/@aws-sdk/client-sqs/dist-cjs/index.js +2114 -2361
- package/node_modules/@aws-sdk/client-sqs/package.json +6 -6
- package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +12508 -13696
- package/node_modules/@aws-sdk/client-ssm/package.json +6 -6
- package/node_modules/@aws-sdk/client-sso/dist-cjs/index.js +478 -596
- package/node_modules/@aws-sdk/client-sso/package.json +5 -5
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +1969 -6
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +48 -88
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +35 -74
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +273 -365
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +1581 -1863
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-types/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonCodec.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeDeserializer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlCodec.d.ts +1 -1
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +38 -73
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +194 -259
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +72 -132
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +71 -107
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +176 -249
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js +14 -0
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +16 -25
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/index.js +381 -478
- package/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js +511 -641
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +170 -203
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +583 -858
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +795 -928
- package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
- package/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +108 -137
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +147 -222
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-browser/README.md +22 -3
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/createUserAgentStringParsingProvider.js +57 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js +39 -8
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/createUserAgentStringParsingProvider.js +20 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js +37 -6
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/createUserAgentStringParsingProvider.d.ts +14 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.d.ts +14 -4
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.native.d.ts +4 -3
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/createUserAgentStringParsingProvider.d.ts +9 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.d.ts +5 -0
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +1 -1
- package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +50 -94
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/crt-availability.d.ts +1 -2
- package/node_modules/@aws-sdk/util-user-agent-node/dist-types/defaultUserAgent.d.ts +10 -5
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/@smithy/chunked-blob-reader-native/package.json +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +5 -3
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +32 -30
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +133 -202
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +126 -34
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +3 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +19 -17
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js +5 -6
- package/node_modules/@smithy/core/dist-es/submodules/schema/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +82 -176
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +22 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js +110 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +4 -26
- package/node_modules/@smithy/core/dist-types/submodules/schema/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/sentinels.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/translateTraits.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/sentinels.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
- package/node_modules/@smithy/core/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/hash-blob-browser/package.json +2 -2
- package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
- package/node_modules/@smithy/middleware-retry/package.json +2 -2
- package/node_modules/@smithy/smithy-client/package.json +4 -4
- package/node_modules/@smithy/util-base64/dist-cjs/constants.browser.js +9 -32
- package/node_modules/@smithy/util-base64/dist-es/constants.browser.js +9 -28
- package/node_modules/@smithy/util-base64/dist-types/constants.browser.d.ts +5 -6
- package/node_modules/@smithy/util-base64/dist-types/ts3.4/constants.browser.d.ts +5 -6
- package/node_modules/@smithy/util-base64/package.json +1 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +8 -6
- package/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js +8 -6
- package/node_modules/@smithy/util-body-length-node/package.json +1 -1
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +11 -9
- package/node_modules/@smithy/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js +11 -8
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -3
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/node_modules/@smithy/util-stream/dist-cjs/index.js +3 -5
- package/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js +3 -5
- package/node_modules/@smithy/util-stream/dist-types/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
- package/node_modules/@smithy/util-stream/package.json +3 -3
- package/package.json +11 -11
|
@@ -1,700 +1,570 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
20
2
|
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
getCheckContentLengthHeaderPlugin: () => getCheckContentLengthHeaderPlugin,
|
|
32
|
-
getRegionRedirectMiddlewarePlugin: () => getRegionRedirectMiddlewarePlugin,
|
|
33
|
-
getS3ExpiresMiddlewarePlugin: () => getS3ExpiresMiddlewarePlugin,
|
|
34
|
-
getS3ExpressHttpSigningPlugin: () => getS3ExpressHttpSigningPlugin,
|
|
35
|
-
getS3ExpressPlugin: () => getS3ExpressPlugin,
|
|
36
|
-
getThrow200ExceptionsPlugin: () => getThrow200ExceptionsPlugin,
|
|
37
|
-
getValidateBucketNamePlugin: () => getValidateBucketNamePlugin,
|
|
38
|
-
regionRedirectEndpointMiddleware: () => regionRedirectEndpointMiddleware,
|
|
39
|
-
regionRedirectEndpointMiddlewareOptions: () => regionRedirectEndpointMiddlewareOptions,
|
|
40
|
-
regionRedirectMiddleware: () => regionRedirectMiddleware,
|
|
41
|
-
regionRedirectMiddlewareOptions: () => regionRedirectMiddlewareOptions,
|
|
42
|
-
resolveS3Config: () => resolveS3Config,
|
|
43
|
-
s3ExpiresMiddleware: () => s3ExpiresMiddleware,
|
|
44
|
-
s3ExpiresMiddlewareOptions: () => s3ExpiresMiddlewareOptions,
|
|
45
|
-
s3ExpressHttpSigningMiddleware: () => s3ExpressHttpSigningMiddleware,
|
|
46
|
-
s3ExpressHttpSigningMiddlewareOptions: () => s3ExpressHttpSigningMiddlewareOptions,
|
|
47
|
-
s3ExpressMiddleware: () => s3ExpressMiddleware,
|
|
48
|
-
s3ExpressMiddlewareOptions: () => s3ExpressMiddlewareOptions,
|
|
49
|
-
throw200ExceptionsMiddleware: () => throw200ExceptionsMiddleware,
|
|
50
|
-
throw200ExceptionsMiddlewareOptions: () => throw200ExceptionsMiddlewareOptions,
|
|
51
|
-
validateBucketNameMiddleware: () => validateBucketNameMiddleware,
|
|
52
|
-
validateBucketNameMiddlewareOptions: () => validateBucketNameMiddlewareOptions
|
|
53
|
-
});
|
|
54
|
-
module.exports = __toCommonJS(index_exports);
|
|
3
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
4
|
+
var smithyClient = require('@smithy/smithy-client');
|
|
5
|
+
var signatureV4 = require('@smithy/signature-v4');
|
|
6
|
+
var utilConfigProvider = require('@smithy/util-config-provider');
|
|
7
|
+
var core = require('@aws-sdk/core');
|
|
8
|
+
var core$1 = require('@smithy/core');
|
|
9
|
+
require('@smithy/types');
|
|
10
|
+
var utilMiddleware = require('@smithy/util-middleware');
|
|
11
|
+
var utilStream = require('@smithy/util-stream');
|
|
12
|
+
var utilArnParser = require('@aws-sdk/util-arn-parser');
|
|
55
13
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var import_smithy_client = require("@smithy/smithy-client");
|
|
59
|
-
var CONTENT_LENGTH_HEADER = "content-length";
|
|
60
|
-
var DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
|
|
14
|
+
const CONTENT_LENGTH_HEADER = "content-length";
|
|
15
|
+
const DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
|
|
61
16
|
function checkContentLengthHeader() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
17
|
+
return (next, context) => async (args) => {
|
|
18
|
+
const { request } = args;
|
|
19
|
+
if (protocolHttp.HttpRequest.isInstance(request)) {
|
|
20
|
+
if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) {
|
|
21
|
+
const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`;
|
|
22
|
+
if (typeof context?.logger?.warn === "function" && !(context.logger instanceof smithyClient.NoOpLogger)) {
|
|
23
|
+
context.logger.warn(message);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
console.warn(message);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
71
29
|
}
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
return next({ ...args });
|
|
75
|
-
};
|
|
30
|
+
return next({ ...args });
|
|
31
|
+
};
|
|
76
32
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
override: true
|
|
33
|
+
const checkContentLengthHeaderMiddlewareOptions = {
|
|
34
|
+
step: "finalizeRequest",
|
|
35
|
+
tags: ["CHECK_CONTENT_LENGTH_HEADER"],
|
|
36
|
+
name: "getCheckContentLengthHeaderPlugin",
|
|
37
|
+
override: true,
|
|
83
38
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})
|
|
39
|
+
const getCheckContentLengthHeaderPlugin = (unused) => ({
|
|
40
|
+
applyToStack: (clientStack) => {
|
|
41
|
+
clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions);
|
|
42
|
+
},
|
|
43
|
+
});
|
|
89
44
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
value: regionProviderRef
|
|
107
|
-
}), "unlock");
|
|
108
|
-
}
|
|
109
|
-
try {
|
|
110
|
-
const result = await next(args);
|
|
111
|
-
if (context.__s3RegionRedirect) {
|
|
112
|
-
unlock();
|
|
113
|
-
const region = await config.region();
|
|
114
|
-
if (originalRegion !== region) {
|
|
115
|
-
throw new Error("Region was not restored following S3 region redirect.");
|
|
45
|
+
const regionRedirectEndpointMiddleware = (config) => {
|
|
46
|
+
return (next, context) => async (args) => {
|
|
47
|
+
const originalRegion = await config.region();
|
|
48
|
+
const regionProviderRef = config.region;
|
|
49
|
+
let unlock = () => { };
|
|
50
|
+
if (context.__s3RegionRedirect) {
|
|
51
|
+
Object.defineProperty(config, "region", {
|
|
52
|
+
writable: false,
|
|
53
|
+
value: async () => {
|
|
54
|
+
return context.__s3RegionRedirect;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
unlock = () => Object.defineProperty(config, "region", {
|
|
58
|
+
writable: true,
|
|
59
|
+
value: regionProviderRef,
|
|
60
|
+
});
|
|
116
61
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
62
|
+
try {
|
|
63
|
+
const result = await next(args);
|
|
64
|
+
if (context.__s3RegionRedirect) {
|
|
65
|
+
unlock();
|
|
66
|
+
const region = await config.region();
|
|
67
|
+
if (originalRegion !== region) {
|
|
68
|
+
throw new Error("Region was not restored following S3 region redirect.");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
unlock();
|
|
75
|
+
throw e;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const regionRedirectEndpointMiddlewareOptions = {
|
|
80
|
+
tags: ["REGION_REDIRECT", "S3"],
|
|
81
|
+
name: "regionRedirectEndpointMiddleware",
|
|
82
|
+
override: true,
|
|
83
|
+
relation: "before",
|
|
84
|
+
toMiddleware: "endpointV2Middleware",
|
|
131
85
|
};
|
|
132
86
|
|
|
133
|
-
// src/region-redirect-middleware.ts
|
|
134
87
|
function regionRedirectMiddleware(clientConfig) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
88
|
+
return (next, context) => async (args) => {
|
|
89
|
+
try {
|
|
90
|
+
return await next(args);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
if (clientConfig.followRegionRedirects) {
|
|
94
|
+
const statusCode = err?.$metadata?.httpStatusCode;
|
|
95
|
+
const isHeadBucket = context.commandName === "HeadBucketCommand";
|
|
96
|
+
const bucketRegionHeader = err?.$response?.headers?.["x-amz-bucket-region"];
|
|
97
|
+
if (bucketRegionHeader) {
|
|
98
|
+
if (statusCode === 301 ||
|
|
99
|
+
(statusCode === 400 && (err?.name === "IllegalLocationConstraintException" || isHeadBucket))) {
|
|
100
|
+
try {
|
|
101
|
+
const actualRegion = bucketRegionHeader;
|
|
102
|
+
context.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`);
|
|
103
|
+
context.__s3RegionRedirect = actualRegion;
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
throw new Error("Region redirect failed: " + e);
|
|
107
|
+
}
|
|
108
|
+
return next(args);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
151
111
|
}
|
|
152
|
-
|
|
153
|
-
}
|
|
112
|
+
throw err;
|
|
154
113
|
}
|
|
155
|
-
|
|
156
|
-
throw err;
|
|
157
|
-
}
|
|
158
|
-
};
|
|
114
|
+
};
|
|
159
115
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
override: true
|
|
116
|
+
const regionRedirectMiddlewareOptions = {
|
|
117
|
+
step: "initialize",
|
|
118
|
+
tags: ["REGION_REDIRECT", "S3"],
|
|
119
|
+
name: "regionRedirectMiddleware",
|
|
120
|
+
override: true,
|
|
166
121
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
// src/s3-expires-middleware.ts
|
|
175
|
-
|
|
122
|
+
const getRegionRedirectMiddlewarePlugin = (clientConfig) => ({
|
|
123
|
+
applyToStack: (clientStack) => {
|
|
124
|
+
clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions);
|
|
125
|
+
clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions);
|
|
126
|
+
},
|
|
127
|
+
});
|
|
176
128
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
129
|
+
const s3ExpiresMiddleware = (config) => {
|
|
130
|
+
return (next, context) => async (args) => {
|
|
131
|
+
const result = await next(args);
|
|
132
|
+
const { response } = result;
|
|
133
|
+
if (protocolHttp.HttpResponse.isInstance(response)) {
|
|
134
|
+
if (response.headers.expires) {
|
|
135
|
+
response.headers.expiresstring = response.headers.expires;
|
|
136
|
+
try {
|
|
137
|
+
smithyClient.parseRfc7231DateTime(response.headers.expires);
|
|
138
|
+
}
|
|
139
|
+
catch (e) {
|
|
140
|
+
context.logger?.warn(`AWS SDK Warning for ${context.clientName}::${context.commandName} response parsing (${response.headers.expires}): ${e}`);
|
|
141
|
+
delete response.headers.expires;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
191
144
|
}
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
return result;
|
|
195
|
-
};
|
|
196
|
-
}, "s3ExpiresMiddleware");
|
|
197
|
-
var s3ExpiresMiddlewareOptions = {
|
|
198
|
-
tags: ["S3"],
|
|
199
|
-
name: "s3ExpiresMiddleware",
|
|
200
|
-
override: true,
|
|
201
|
-
relation: "after",
|
|
202
|
-
toMiddleware: "deserializerMiddleware"
|
|
145
|
+
return result;
|
|
146
|
+
};
|
|
203
147
|
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
148
|
+
const s3ExpiresMiddlewareOptions = {
|
|
149
|
+
tags: ["S3"],
|
|
150
|
+
name: "s3ExpiresMiddleware",
|
|
151
|
+
override: true,
|
|
152
|
+
relation: "after",
|
|
153
|
+
toMiddleware: "deserializerMiddleware",
|
|
154
|
+
};
|
|
155
|
+
const getS3ExpiresMiddlewarePlugin = (clientConfig) => ({
|
|
156
|
+
applyToStack: (clientStack) => {
|
|
157
|
+
clientStack.addRelativeTo(s3ExpiresMiddleware(), s3ExpiresMiddlewareOptions);
|
|
158
|
+
},
|
|
159
|
+
});
|
|
209
160
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
__name(this, "S3ExpressIdentityCache");
|
|
217
|
-
}
|
|
218
|
-
lastPurgeTime = Date.now();
|
|
219
|
-
static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 3e4;
|
|
220
|
-
get(key) {
|
|
221
|
-
const entry = this.data[key];
|
|
222
|
-
if (!entry) {
|
|
223
|
-
return;
|
|
161
|
+
class S3ExpressIdentityCache {
|
|
162
|
+
data;
|
|
163
|
+
lastPurgeTime = Date.now();
|
|
164
|
+
static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 30_000;
|
|
165
|
+
constructor(data = {}) {
|
|
166
|
+
this.data = data;
|
|
224
167
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
delete(key) {
|
|
232
|
-
delete this.data[key];
|
|
233
|
-
}
|
|
234
|
-
async purgeExpired() {
|
|
235
|
-
const now = Date.now();
|
|
236
|
-
if (this.lastPurgeTime + _S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
|
|
237
|
-
return;
|
|
168
|
+
get(key) {
|
|
169
|
+
const entry = this.data[key];
|
|
170
|
+
if (!entry) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
return entry;
|
|
238
174
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
175
|
+
set(key, entry) {
|
|
176
|
+
this.data[key] = entry;
|
|
177
|
+
return entry;
|
|
178
|
+
}
|
|
179
|
+
delete(key) {
|
|
180
|
+
delete this.data[key];
|
|
181
|
+
}
|
|
182
|
+
async purgeExpired() {
|
|
183
|
+
const now = Date.now();
|
|
184
|
+
if (this.lastPurgeTime + S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
for (const key in this.data) {
|
|
188
|
+
const entry = this.data[key];
|
|
189
|
+
if (!entry.isRefreshing) {
|
|
190
|
+
const credential = await entry.identity;
|
|
191
|
+
if (credential.expiration) {
|
|
192
|
+
if (credential.expiration.getTime() < now) {
|
|
193
|
+
delete this.data[key];
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
247
197
|
}
|
|
248
|
-
}
|
|
249
198
|
}
|
|
250
|
-
|
|
251
|
-
};
|
|
199
|
+
}
|
|
252
200
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
get identity() {
|
|
269
|
-
this.accessed = Date.now();
|
|
270
|
-
return this._identity;
|
|
271
|
-
}
|
|
272
|
-
};
|
|
201
|
+
class S3ExpressIdentityCacheEntry {
|
|
202
|
+
_identity;
|
|
203
|
+
isRefreshing;
|
|
204
|
+
accessed;
|
|
205
|
+
constructor(_identity, isRefreshing = false, accessed = Date.now()) {
|
|
206
|
+
this._identity = _identity;
|
|
207
|
+
this.isRefreshing = isRefreshing;
|
|
208
|
+
this.accessed = accessed;
|
|
209
|
+
}
|
|
210
|
+
get identity() {
|
|
211
|
+
this.accessed = Date.now();
|
|
212
|
+
return this._identity;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
273
215
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
216
|
+
class S3ExpressIdentityProviderImpl {
|
|
217
|
+
createSessionFn;
|
|
218
|
+
cache;
|
|
219
|
+
static REFRESH_WINDOW_MS = 60_000;
|
|
220
|
+
constructor(createSessionFn, cache = new S3ExpressIdentityCache()) {
|
|
221
|
+
this.createSessionFn = createSessionFn;
|
|
222
|
+
this.cache = cache;
|
|
223
|
+
}
|
|
224
|
+
async getS3ExpressIdentity(awsIdentity, identityProperties) {
|
|
225
|
+
const key = identityProperties.Bucket;
|
|
226
|
+
const { cache } = this;
|
|
227
|
+
const entry = cache.get(key);
|
|
228
|
+
if (entry) {
|
|
229
|
+
return entry.identity.then((identity) => {
|
|
230
|
+
const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now();
|
|
231
|
+
if (isExpired) {
|
|
232
|
+
return cache.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
|
|
233
|
+
}
|
|
234
|
+
const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS;
|
|
235
|
+
if (isExpiringSoon && !entry.isRefreshing) {
|
|
236
|
+
entry.isRefreshing = true;
|
|
237
|
+
this.getIdentity(key).then((id) => {
|
|
238
|
+
cache.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id)));
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return identity;
|
|
242
|
+
});
|
|
293
243
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
244
|
+
return cache.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
|
|
245
|
+
}
|
|
246
|
+
async getIdentity(key) {
|
|
247
|
+
await this.cache.purgeExpired().catch((error) => {
|
|
248
|
+
console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error);
|
|
249
|
+
});
|
|
250
|
+
const session = await this.createSessionFn(key);
|
|
251
|
+
if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
|
|
252
|
+
throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
|
|
300
253
|
}
|
|
254
|
+
const identity = {
|
|
255
|
+
accessKeyId: session.Credentials.AccessKeyId,
|
|
256
|
+
secretAccessKey: session.Credentials.SecretAccessKey,
|
|
257
|
+
sessionToken: session.Credentials.SessionToken,
|
|
258
|
+
expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : undefined,
|
|
259
|
+
};
|
|
301
260
|
return identity;
|
|
302
|
-
});
|
|
303
261
|
}
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
async getIdentity(key) {
|
|
307
|
-
await this.cache.purgeExpired().catch((error) => {
|
|
308
|
-
console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error);
|
|
309
|
-
});
|
|
310
|
-
const session = await this.createSessionFn(key);
|
|
311
|
-
if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
|
|
312
|
-
throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
|
|
313
|
-
}
|
|
314
|
-
const identity = {
|
|
315
|
-
accessKeyId: session.Credentials.AccessKeyId,
|
|
316
|
-
secretAccessKey: session.Credentials.SecretAccessKey,
|
|
317
|
-
sessionToken: session.Credentials.SessionToken,
|
|
318
|
-
expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : void 0
|
|
319
|
-
};
|
|
320
|
-
return identity;
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
// src/s3-express/classes/SignatureV4S3Express.ts
|
|
325
|
-
var import_signature_v4 = require("@smithy/signature-v4");
|
|
262
|
+
}
|
|
326
263
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
configFileSelector: /* @__PURE__ */ __name((profile) => (0, import_util_config_provider.booleanSelector)(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, import_util_config_provider.SelectorType.CONFIG), "configFileSelector"),
|
|
339
|
-
default: false
|
|
264
|
+
const S3_EXPRESS_BUCKET_TYPE = "Directory";
|
|
265
|
+
const S3_EXPRESS_BACKEND = "S3Express";
|
|
266
|
+
const S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express";
|
|
267
|
+
const SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
|
|
268
|
+
const SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
|
|
269
|
+
const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH";
|
|
270
|
+
const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth";
|
|
271
|
+
const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = {
|
|
272
|
+
environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, utilConfigProvider.SelectorType.ENV),
|
|
273
|
+
configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, utilConfigProvider.SelectorType.CONFIG),
|
|
274
|
+
default: false,
|
|
340
275
|
};
|
|
341
276
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Similar to {@link SignatureV4S3Express#signWithCredentials} but for presigning.
|
|
363
|
-
*/
|
|
364
|
-
async presignWithCredentials(requestToSign, credentials, options) {
|
|
365
|
-
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
366
|
-
delete requestToSign.headers[SESSION_TOKEN_HEADER];
|
|
367
|
-
requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
368
|
-
requestToSign.query = requestToSign.query ?? {};
|
|
369
|
-
requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
370
|
-
const privateAccess = this;
|
|
371
|
-
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
372
|
-
return this.presign(requestToSign, options);
|
|
373
|
-
}
|
|
374
|
-
};
|
|
277
|
+
class SignatureV4S3Express extends signatureV4.SignatureV4 {
|
|
278
|
+
async signWithCredentials(requestToSign, credentials, options) {
|
|
279
|
+
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
280
|
+
requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
|
|
281
|
+
const privateAccess = this;
|
|
282
|
+
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
283
|
+
return privateAccess.signRequest(requestToSign, options ?? {});
|
|
284
|
+
}
|
|
285
|
+
async presignWithCredentials(requestToSign, credentials, options) {
|
|
286
|
+
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
287
|
+
delete requestToSign.headers[SESSION_TOKEN_HEADER];
|
|
288
|
+
requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
289
|
+
requestToSign.query = requestToSign.query ?? {};
|
|
290
|
+
requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
291
|
+
const privateAccess = this;
|
|
292
|
+
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
293
|
+
return this.presign(requestToSign, options);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
375
296
|
function getCredentialsWithoutSessionToken(credentials) {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
297
|
+
const credentialsWithoutSessionToken = {
|
|
298
|
+
accessKeyId: credentials.accessKeyId,
|
|
299
|
+
secretAccessKey: credentials.secretAccessKey,
|
|
300
|
+
expiration: credentials.expiration,
|
|
301
|
+
};
|
|
302
|
+
return credentialsWithoutSessionToken;
|
|
382
303
|
}
|
|
383
|
-
__name(getCredentialsWithoutSessionToken, "getCredentialsWithoutSessionToken");
|
|
384
304
|
function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
305
|
+
const id = setTimeout(() => {
|
|
306
|
+
throw new Error("SignatureV4S3Express credential override was created but not called.");
|
|
307
|
+
}, 10);
|
|
308
|
+
const currentCredentialProvider = privateAccess.credentialProvider;
|
|
309
|
+
const overrideCredentialsProviderOnce = () => {
|
|
310
|
+
clearTimeout(id);
|
|
311
|
+
privateAccess.credentialProvider = currentCredentialProvider;
|
|
312
|
+
return Promise.resolve(credentialsWithoutSessionToken);
|
|
313
|
+
};
|
|
314
|
+
privateAccess.credentialProvider = overrideCredentialsProviderOnce;
|
|
395
315
|
}
|
|
396
|
-
__name(setSingleOverride, "setSingleOverride");
|
|
397
|
-
|
|
398
|
-
// src/s3-express/functions/s3ExpressMiddleware.ts
|
|
399
|
-
var import_core = require("@aws-sdk/core");
|
|
400
316
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
317
|
+
const s3ExpressMiddleware = (options) => {
|
|
318
|
+
return (next, context) => async (args) => {
|
|
319
|
+
if (context.endpointV2) {
|
|
320
|
+
const endpoint = context.endpointV2;
|
|
321
|
+
const isS3ExpressAuth = endpoint.properties?.authSchemes?.[0]?.name === S3_EXPRESS_AUTH_SCHEME;
|
|
322
|
+
const isS3ExpressBucket = endpoint.properties?.backend === S3_EXPRESS_BACKEND ||
|
|
323
|
+
endpoint.properties?.bucketType === S3_EXPRESS_BUCKET_TYPE;
|
|
324
|
+
if (isS3ExpressBucket) {
|
|
325
|
+
core.setFeature(context, "S3_EXPRESS_BUCKET", "J");
|
|
326
|
+
context.isS3ExpressBucket = true;
|
|
327
|
+
}
|
|
328
|
+
if (isS3ExpressAuth) {
|
|
329
|
+
const requestBucket = args.input.Bucket;
|
|
330
|
+
if (requestBucket) {
|
|
331
|
+
const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), {
|
|
332
|
+
Bucket: requestBucket,
|
|
333
|
+
});
|
|
334
|
+
context.s3ExpressIdentity = s3ExpressIdentity;
|
|
335
|
+
if (protocolHttp.HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) {
|
|
336
|
+
args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
418
339
|
}
|
|
419
|
-
);
|
|
420
|
-
context.s3ExpressIdentity = s3ExpressIdentity;
|
|
421
|
-
if (import_protocol_http.HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) {
|
|
422
|
-
args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken;
|
|
423
|
-
}
|
|
424
340
|
}
|
|
425
|
-
|
|
426
|
-
}
|
|
427
|
-
return next(args);
|
|
428
|
-
};
|
|
429
|
-
}, "s3ExpressMiddleware");
|
|
430
|
-
var s3ExpressMiddlewareOptions = {
|
|
431
|
-
name: "s3ExpressMiddleware",
|
|
432
|
-
step: "build",
|
|
433
|
-
tags: ["S3", "S3_EXPRESS"],
|
|
434
|
-
override: true
|
|
341
|
+
return next(args);
|
|
342
|
+
};
|
|
435
343
|
};
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
// src/s3-express/functions/signS3Express.ts
|
|
448
|
-
var signS3Express = /* @__PURE__ */ __name(async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => {
|
|
449
|
-
const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {});
|
|
450
|
-
if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
|
|
451
|
-
throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
|
|
452
|
-
}
|
|
453
|
-
return signedRequest;
|
|
454
|
-
}, "signS3Express");
|
|
344
|
+
const s3ExpressMiddlewareOptions = {
|
|
345
|
+
name: "s3ExpressMiddleware",
|
|
346
|
+
step: "build",
|
|
347
|
+
tags: ["S3", "S3_EXPRESS"],
|
|
348
|
+
override: true,
|
|
349
|
+
};
|
|
350
|
+
const getS3ExpressPlugin = (options) => ({
|
|
351
|
+
applyToStack: (clientStack) => {
|
|
352
|
+
clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions);
|
|
353
|
+
},
|
|
354
|
+
});
|
|
455
355
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
var s3ExpressHttpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, context) => async (args) => {
|
|
464
|
-
if (!import_protocol_http.HttpRequest.isInstance(args.request)) {
|
|
465
|
-
return next(args);
|
|
466
|
-
}
|
|
467
|
-
const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
|
|
468
|
-
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
469
|
-
if (!scheme) {
|
|
470
|
-
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
471
|
-
}
|
|
472
|
-
const {
|
|
473
|
-
httpAuthOption: { signingProperties = {} },
|
|
474
|
-
identity,
|
|
475
|
-
signer
|
|
476
|
-
} = scheme;
|
|
477
|
-
let request;
|
|
478
|
-
if (context.s3ExpressIdentity) {
|
|
479
|
-
request = await signS3Express(
|
|
480
|
-
context.s3ExpressIdentity,
|
|
481
|
-
signingProperties,
|
|
482
|
-
args.request,
|
|
483
|
-
await config.signer()
|
|
484
|
-
);
|
|
485
|
-
} else {
|
|
486
|
-
request = await signer.sign(args.request, identity, signingProperties);
|
|
487
|
-
}
|
|
488
|
-
const output = await next({
|
|
489
|
-
...args,
|
|
490
|
-
request
|
|
491
|
-
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
|
492
|
-
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
|
493
|
-
return output;
|
|
494
|
-
}, "s3ExpressHttpSigningMiddleware");
|
|
495
|
-
var getS3ExpressHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({
|
|
496
|
-
applyToStack: /* @__PURE__ */ __name((clientStack) => {
|
|
497
|
-
clientStack.addRelativeTo(
|
|
498
|
-
s3ExpressHttpSigningMiddleware(config),
|
|
499
|
-
import_core2.httpSigningMiddlewareOptions
|
|
500
|
-
);
|
|
501
|
-
}, "applyToStack")
|
|
502
|
-
}), "getS3ExpressHttpSigningPlugin");
|
|
356
|
+
const signS3Express = async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => {
|
|
357
|
+
const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {});
|
|
358
|
+
if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
|
|
359
|
+
throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
|
|
360
|
+
}
|
|
361
|
+
return signedRequest;
|
|
362
|
+
};
|
|
503
363
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
364
|
+
const defaultErrorHandler = (signingProperties) => (error) => {
|
|
365
|
+
throw error;
|
|
366
|
+
};
|
|
367
|
+
const defaultSuccessHandler = (httpResponse, signingProperties) => { };
|
|
368
|
+
const s3ExpressHttpSigningMiddlewareOptions = core$1.httpSigningMiddlewareOptions;
|
|
369
|
+
const s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
370
|
+
if (!protocolHttp.HttpRequest.isInstance(args.request)) {
|
|
371
|
+
return next(args);
|
|
372
|
+
}
|
|
373
|
+
const smithyContext = utilMiddleware.getSmithyContext(context);
|
|
374
|
+
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
375
|
+
if (!scheme) {
|
|
376
|
+
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
377
|
+
}
|
|
378
|
+
const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;
|
|
379
|
+
let request;
|
|
380
|
+
if (context.s3ExpressIdentity) {
|
|
381
|
+
request = await signS3Express(context.s3ExpressIdentity, signingProperties, args.request, await config.signer());
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
request = await signer.sign(args.request, identity, signingProperties);
|
|
385
|
+
}
|
|
386
|
+
const output = await next({
|
|
387
|
+
...args,
|
|
388
|
+
request,
|
|
389
|
+
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
|
390
|
+
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
|
391
|
+
return output;
|
|
392
|
+
};
|
|
393
|
+
const getS3ExpressHttpSigningPlugin = (config) => ({
|
|
394
|
+
applyToStack: (clientStack) => {
|
|
395
|
+
clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), core$1.httpSigningMiddlewareOptions);
|
|
396
|
+
},
|
|
397
|
+
});
|
|
532
398
|
|
|
533
|
-
|
|
399
|
+
const resolveS3Config = (input, { session, }) => {
|
|
400
|
+
const [s3ClientProvider, CreateSessionCommandCtor] = session;
|
|
401
|
+
const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, } = input;
|
|
402
|
+
return Object.assign(input, {
|
|
403
|
+
forcePathStyle: forcePathStyle ?? false,
|
|
404
|
+
useAccelerateEndpoint: useAccelerateEndpoint ?? false,
|
|
405
|
+
disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false,
|
|
406
|
+
followRegionRedirects: followRegionRedirects ?? false,
|
|
407
|
+
s3ExpressIdentityProvider: s3ExpressIdentityProvider ??
|
|
408
|
+
new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({
|
|
409
|
+
Bucket: key,
|
|
410
|
+
}))),
|
|
411
|
+
bucketEndpoint: bucketEndpoint ?? false,
|
|
412
|
+
});
|
|
413
|
+
};
|
|
534
414
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
CompleteMultipartUploadCommand: true
|
|
415
|
+
const THROW_IF_EMPTY_BODY = {
|
|
416
|
+
CopyObjectCommand: true,
|
|
417
|
+
UploadPartCopyCommand: true,
|
|
418
|
+
CompleteMultipartUploadCommand: true,
|
|
540
419
|
};
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
420
|
+
const MAX_BYTES_TO_INSPECT = 3000;
|
|
421
|
+
const throw200ExceptionsMiddleware = (config) => (next, context) => async (args) => {
|
|
422
|
+
const result = await next(args);
|
|
423
|
+
const { response } = result;
|
|
424
|
+
if (!protocolHttp.HttpResponse.isInstance(response)) {
|
|
425
|
+
return result;
|
|
426
|
+
}
|
|
427
|
+
const { statusCode, body: sourceBody } = response;
|
|
428
|
+
if (statusCode < 200 || statusCode >= 300) {
|
|
429
|
+
return result;
|
|
430
|
+
}
|
|
431
|
+
const isSplittableStream = typeof sourceBody?.stream === "function" ||
|
|
432
|
+
typeof sourceBody?.pipe === "function" ||
|
|
433
|
+
typeof sourceBody?.tee === "function";
|
|
434
|
+
if (!isSplittableStream) {
|
|
435
|
+
return result;
|
|
436
|
+
}
|
|
437
|
+
let bodyCopy = sourceBody;
|
|
438
|
+
let body = sourceBody;
|
|
439
|
+
if (sourceBody && typeof sourceBody === "object" && !(sourceBody instanceof Uint8Array)) {
|
|
440
|
+
[bodyCopy, body] = await utilStream.splitStream(sourceBody);
|
|
441
|
+
}
|
|
442
|
+
response.body = body;
|
|
443
|
+
const bodyBytes = await collectBody(bodyCopy, {
|
|
444
|
+
streamCollector: async (stream) => {
|
|
445
|
+
return utilStream.headStream(stream, MAX_BYTES_TO_INSPECT);
|
|
446
|
+
},
|
|
447
|
+
});
|
|
448
|
+
if (typeof bodyCopy?.destroy === "function") {
|
|
449
|
+
bodyCopy.destroy();
|
|
450
|
+
}
|
|
451
|
+
const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16));
|
|
452
|
+
if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context.commandName]) {
|
|
453
|
+
const err = new Error("S3 aborted request");
|
|
454
|
+
err.name = "InternalError";
|
|
455
|
+
throw err;
|
|
456
|
+
}
|
|
457
|
+
if (bodyStringTail && bodyStringTail.endsWith("</Error>")) {
|
|
458
|
+
response.statusCode = 400;
|
|
459
|
+
}
|
|
554
460
|
return result;
|
|
555
|
-
}
|
|
556
|
-
let bodyCopy = sourceBody;
|
|
557
|
-
let body = sourceBody;
|
|
558
|
-
if (sourceBody && typeof sourceBody === "object" && !(sourceBody instanceof Uint8Array)) {
|
|
559
|
-
[bodyCopy, body] = await (0, import_util_stream.splitStream)(sourceBody);
|
|
560
|
-
}
|
|
561
|
-
response.body = body;
|
|
562
|
-
const bodyBytes = await collectBody(bodyCopy, {
|
|
563
|
-
streamCollector: /* @__PURE__ */ __name(async (stream) => {
|
|
564
|
-
return (0, import_util_stream.headStream)(stream, MAX_BYTES_TO_INSPECT);
|
|
565
|
-
}, "streamCollector")
|
|
566
|
-
});
|
|
567
|
-
if (typeof bodyCopy?.destroy === "function") {
|
|
568
|
-
bodyCopy.destroy();
|
|
569
|
-
}
|
|
570
|
-
const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16));
|
|
571
|
-
if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context.commandName]) {
|
|
572
|
-
const err = new Error("S3 aborted request");
|
|
573
|
-
err.name = "InternalError";
|
|
574
|
-
throw err;
|
|
575
|
-
}
|
|
576
|
-
if (bodyStringTail && bodyStringTail.endsWith("</Error>")) {
|
|
577
|
-
response.statusCode = 400;
|
|
578
|
-
}
|
|
579
|
-
return result;
|
|
580
|
-
}, "throw200ExceptionsMiddleware");
|
|
581
|
-
var collectBody = /* @__PURE__ */ __name((streamBody = new Uint8Array(), context) => {
|
|
582
|
-
if (streamBody instanceof Uint8Array) {
|
|
583
|
-
return Promise.resolve(streamBody);
|
|
584
|
-
}
|
|
585
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
586
|
-
}, "collectBody");
|
|
587
|
-
var throw200ExceptionsMiddlewareOptions = {
|
|
588
|
-
relation: "after",
|
|
589
|
-
toMiddleware: "deserializerMiddleware",
|
|
590
|
-
tags: ["THROW_200_EXCEPTIONS", "S3"],
|
|
591
|
-
name: "throw200ExceptionsMiddleware",
|
|
592
|
-
override: true
|
|
593
461
|
};
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
462
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
463
|
+
if (streamBody instanceof Uint8Array) {
|
|
464
|
+
return Promise.resolve(streamBody);
|
|
465
|
+
}
|
|
466
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
467
|
+
};
|
|
468
|
+
const throw200ExceptionsMiddlewareOptions = {
|
|
469
|
+
relation: "after",
|
|
470
|
+
toMiddleware: "deserializerMiddleware",
|
|
471
|
+
tags: ["THROW_200_EXCEPTIONS", "S3"],
|
|
472
|
+
name: "throw200ExceptionsMiddleware",
|
|
473
|
+
override: true,
|
|
474
|
+
};
|
|
475
|
+
const getThrow200ExceptionsPlugin = (config) => ({
|
|
476
|
+
applyToStack: (clientStack) => {
|
|
477
|
+
clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions);
|
|
478
|
+
},
|
|
479
|
+
});
|
|
602
480
|
|
|
603
|
-
// src/bucket-endpoint-middleware.ts
|
|
604
481
|
function bucketEndpointMiddleware(options) {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
482
|
+
return (next, context) => async (args) => {
|
|
483
|
+
if (options.bucketEndpoint) {
|
|
484
|
+
const endpoint = context.endpointV2;
|
|
485
|
+
if (endpoint) {
|
|
486
|
+
const bucket = args.input.Bucket;
|
|
487
|
+
if (typeof bucket === "string") {
|
|
488
|
+
try {
|
|
489
|
+
const bucketEndpointUrl = new URL(bucket);
|
|
490
|
+
context.endpointV2 = {
|
|
491
|
+
...endpoint,
|
|
492
|
+
url: bucketEndpointUrl,
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
catch (e) {
|
|
496
|
+
const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`;
|
|
497
|
+
if (context.logger?.constructor?.name === "NoOpLogger") {
|
|
498
|
+
console.warn(warning);
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
context.logger?.warn?.(warning);
|
|
502
|
+
}
|
|
503
|
+
throw e;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
623
506
|
}
|
|
624
|
-
throw e;
|
|
625
|
-
}
|
|
626
507
|
}
|
|
627
|
-
|
|
628
|
-
}
|
|
629
|
-
return next(args);
|
|
630
|
-
};
|
|
508
|
+
return next(args);
|
|
509
|
+
};
|
|
631
510
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
toMiddleware: "endpointV2Middleware"
|
|
511
|
+
const bucketEndpointMiddlewareOptions = {
|
|
512
|
+
name: "bucketEndpointMiddleware",
|
|
513
|
+
override: true,
|
|
514
|
+
relation: "after",
|
|
515
|
+
toMiddleware: "endpointV2Middleware",
|
|
638
516
|
};
|
|
639
517
|
|
|
640
|
-
// src/validate-bucket-name.ts
|
|
641
518
|
function validateBucketNameMiddleware({ bucketEndpoint }) {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
return next({ ...args });
|
|
652
|
-
};
|
|
519
|
+
return (next) => async (args) => {
|
|
520
|
+
const { input: { Bucket }, } = args;
|
|
521
|
+
if (!bucketEndpoint && typeof Bucket === "string" && !utilArnParser.validate(Bucket) && Bucket.indexOf("/") >= 0) {
|
|
522
|
+
const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`);
|
|
523
|
+
err.name = "InvalidBucketName";
|
|
524
|
+
throw err;
|
|
525
|
+
}
|
|
526
|
+
return next({ ...args });
|
|
527
|
+
};
|
|
653
528
|
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
override: true
|
|
529
|
+
const validateBucketNameMiddlewareOptions = {
|
|
530
|
+
step: "initialize",
|
|
531
|
+
tags: ["VALIDATE_BUCKET_NAME"],
|
|
532
|
+
name: "validateBucketNameMiddleware",
|
|
533
|
+
override: true,
|
|
660
534
|
};
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}), "getValidateBucketNamePlugin");
|
|
667
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
668
|
-
|
|
669
|
-
0 && (module.exports = {
|
|
670
|
-
checkContentLengthHeaderMiddlewareOptions,
|
|
671
|
-
getCheckContentLengthHeaderPlugin,
|
|
672
|
-
checkContentLengthHeader,
|
|
673
|
-
regionRedirectEndpointMiddleware,
|
|
674
|
-
regionRedirectEndpointMiddlewareOptions,
|
|
675
|
-
regionRedirectMiddlewareOptions,
|
|
676
|
-
getRegionRedirectMiddlewarePlugin,
|
|
677
|
-
regionRedirectMiddleware,
|
|
678
|
-
s3ExpiresMiddleware,
|
|
679
|
-
s3ExpiresMiddlewareOptions,
|
|
680
|
-
getS3ExpiresMiddlewarePlugin,
|
|
681
|
-
S3ExpressIdentityCache,
|
|
682
|
-
S3ExpressIdentityCacheEntry,
|
|
683
|
-
S3ExpressIdentityProviderImpl,
|
|
684
|
-
SignatureV4S3Express,
|
|
685
|
-
NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS,
|
|
686
|
-
getS3ExpressPlugin,
|
|
687
|
-
s3ExpressMiddleware,
|
|
688
|
-
s3ExpressMiddlewareOptions,
|
|
689
|
-
getS3ExpressHttpSigningPlugin,
|
|
690
|
-
s3ExpressHttpSigningMiddleware,
|
|
691
|
-
s3ExpressHttpSigningMiddlewareOptions,
|
|
692
|
-
resolveS3Config,
|
|
693
|
-
throw200ExceptionsMiddleware,
|
|
694
|
-
throw200ExceptionsMiddlewareOptions,
|
|
695
|
-
getThrow200ExceptionsPlugin,
|
|
696
|
-
validateBucketNameMiddlewareOptions,
|
|
697
|
-
getValidateBucketNamePlugin,
|
|
698
|
-
validateBucketNameMiddleware
|
|
535
|
+
const getValidateBucketNamePlugin = (options) => ({
|
|
536
|
+
applyToStack: (clientStack) => {
|
|
537
|
+
clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions);
|
|
538
|
+
clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
|
|
539
|
+
},
|
|
699
540
|
});
|
|
700
541
|
|
|
542
|
+
exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS;
|
|
543
|
+
exports.S3ExpressIdentityCache = S3ExpressIdentityCache;
|
|
544
|
+
exports.S3ExpressIdentityCacheEntry = S3ExpressIdentityCacheEntry;
|
|
545
|
+
exports.S3ExpressIdentityProviderImpl = S3ExpressIdentityProviderImpl;
|
|
546
|
+
exports.SignatureV4S3Express = SignatureV4S3Express;
|
|
547
|
+
exports.checkContentLengthHeader = checkContentLengthHeader;
|
|
548
|
+
exports.checkContentLengthHeaderMiddlewareOptions = checkContentLengthHeaderMiddlewareOptions;
|
|
549
|
+
exports.getCheckContentLengthHeaderPlugin = getCheckContentLengthHeaderPlugin;
|
|
550
|
+
exports.getRegionRedirectMiddlewarePlugin = getRegionRedirectMiddlewarePlugin;
|
|
551
|
+
exports.getS3ExpiresMiddlewarePlugin = getS3ExpiresMiddlewarePlugin;
|
|
552
|
+
exports.getS3ExpressHttpSigningPlugin = getS3ExpressHttpSigningPlugin;
|
|
553
|
+
exports.getS3ExpressPlugin = getS3ExpressPlugin;
|
|
554
|
+
exports.getThrow200ExceptionsPlugin = getThrow200ExceptionsPlugin;
|
|
555
|
+
exports.getValidateBucketNamePlugin = getValidateBucketNamePlugin;
|
|
556
|
+
exports.regionRedirectEndpointMiddleware = regionRedirectEndpointMiddleware;
|
|
557
|
+
exports.regionRedirectEndpointMiddlewareOptions = regionRedirectEndpointMiddlewareOptions;
|
|
558
|
+
exports.regionRedirectMiddleware = regionRedirectMiddleware;
|
|
559
|
+
exports.regionRedirectMiddlewareOptions = regionRedirectMiddlewareOptions;
|
|
560
|
+
exports.resolveS3Config = resolveS3Config;
|
|
561
|
+
exports.s3ExpiresMiddleware = s3ExpiresMiddleware;
|
|
562
|
+
exports.s3ExpiresMiddlewareOptions = s3ExpiresMiddlewareOptions;
|
|
563
|
+
exports.s3ExpressHttpSigningMiddleware = s3ExpressHttpSigningMiddleware;
|
|
564
|
+
exports.s3ExpressHttpSigningMiddlewareOptions = s3ExpressHttpSigningMiddlewareOptions;
|
|
565
|
+
exports.s3ExpressMiddleware = s3ExpressMiddleware;
|
|
566
|
+
exports.s3ExpressMiddlewareOptions = s3ExpressMiddlewareOptions;
|
|
567
|
+
exports.throw200ExceptionsMiddleware = throw200ExceptionsMiddleware;
|
|
568
|
+
exports.throw200ExceptionsMiddlewareOptions = throw200ExceptionsMiddlewareOptions;
|
|
569
|
+
exports.validateBucketNameMiddleware = validateBucketNameMiddleware;
|
|
570
|
+
exports.validateBucketNameMiddlewareOptions = validateBucketNameMiddlewareOptions;
|