@aws-sdk/middleware-sdk-s3-control 3.53.0 → 3.55.0
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/CHANGELOG.md +24 -0
- package/dist-cjs/process-arnables-plugin/parse-outpost-arnables.js +9 -9
- package/dist-cjs/process-arnables-plugin/plugin.js +2 -2
- package/dist-cjs/process-arnables-plugin/update-arnables-request.js +1 -1
- package/dist-cjs/redirect-from-postid.js +2 -2
- package/dist-es/process-arnables-plugin/getOutpostEndpoint.js +2 -2
- package/dist-es/process-arnables-plugin/parse-outpost-arnables.js +3 -3
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/middleware-sdk-s3-control
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.54.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.0...v3.54.1) (2022-03-15)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/middleware-sdk-s3-control
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.54.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.53.1...v3.54.0) (2022-03-11)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @aws-sdk/middleware-sdk-s3-control
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [3.53.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.52.0...v3.53.0) (2022-02-24)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @aws-sdk/middleware-sdk-s3-control
|
|
@@ -6,7 +6,7 @@ const util_arn_parser_1 = require("@aws-sdk/util-arn-parser");
|
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
7
|
const parseOutpostArnablesMiddleaware = (options) => (next, context) => async (args) => {
|
|
8
8
|
const { input } = args;
|
|
9
|
-
const parameter = input.Name && util_arn_parser_1.validate(input.Name) ? "Name" : input.Bucket && util_arn_parser_1.validate(input.Bucket) ? "Bucket" : undefined;
|
|
9
|
+
const parameter = input.Name && (0, util_arn_parser_1.validate)(input.Name) ? "Name" : input.Bucket && (0, util_arn_parser_1.validate)(input.Bucket) ? "Bucket" : undefined;
|
|
10
10
|
if (!parameter)
|
|
11
11
|
return next(args);
|
|
12
12
|
const clientRegion = await options.region();
|
|
@@ -28,14 +28,14 @@ const parseOutpostArnablesMiddleaware = (options) => (next, context) => async (a
|
|
|
28
28
|
};
|
|
29
29
|
let arn;
|
|
30
30
|
if (parameter === "Name") {
|
|
31
|
-
arn = util_arn_parser_1.parse(input.Name);
|
|
31
|
+
arn = (0, util_arn_parser_1.parse)(input.Name);
|
|
32
32
|
validateOutpostsArn(arn, validatorOptions);
|
|
33
33
|
const { outpostId, accesspointName } = parseOutpostsAccessPointArnResource(arn.resource);
|
|
34
34
|
input.Name = accesspointName;
|
|
35
35
|
context[constants_1.CONTEXT_OUTPOST_ID] = outpostId;
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
arn = util_arn_parser_1.parse(input.Bucket);
|
|
38
|
+
arn = (0, util_arn_parser_1.parse)(input.Bucket);
|
|
39
39
|
validateOutpostsArn(arn, validatorOptions);
|
|
40
40
|
const { outpostId, bucketName } = parseOutpostBucketArnResource(arn.resource);
|
|
41
41
|
input.Bucket = bucketName;
|
|
@@ -61,20 +61,20 @@ exports.parseOutpostArnablesMiddleawareOptions = {
|
|
|
61
61
|
};
|
|
62
62
|
const validateOutpostsArn = (arn, { clientRegion, signingRegion, clientPartition, useArnRegion, useFipsEndpoint, useDualstackEndpoint, }) => {
|
|
63
63
|
const { service, partition, accountId, region } = arn;
|
|
64
|
-
middleware_bucket_endpoint_1.validateOutpostService(service);
|
|
65
|
-
middleware_bucket_endpoint_1.validatePartition(partition, { clientPartition });
|
|
66
|
-
middleware_bucket_endpoint_1.validateAccountId(accountId);
|
|
67
|
-
middleware_bucket_endpoint_1.validateRegion(region, {
|
|
64
|
+
(0, middleware_bucket_endpoint_1.validateOutpostService)(service);
|
|
65
|
+
(0, middleware_bucket_endpoint_1.validatePartition)(partition, { clientPartition });
|
|
66
|
+
(0, middleware_bucket_endpoint_1.validateAccountId)(accountId);
|
|
67
|
+
(0, middleware_bucket_endpoint_1.validateRegion)(region, {
|
|
68
68
|
useArnRegion,
|
|
69
69
|
clientRegion,
|
|
70
70
|
clientSigningRegion: signingRegion,
|
|
71
71
|
useFipsEndpoint,
|
|
72
72
|
allowFipsRegion: true,
|
|
73
73
|
});
|
|
74
|
-
middleware_bucket_endpoint_1.validateNoDualstack(useDualstackEndpoint);
|
|
74
|
+
(0, middleware_bucket_endpoint_1.validateNoDualstack)(useDualstackEndpoint);
|
|
75
75
|
};
|
|
76
76
|
const parseOutpostsAccessPointArnResource = (resource) => {
|
|
77
|
-
const { outpostId, accesspointName } = middleware_bucket_endpoint_1.getArnResources(resource);
|
|
77
|
+
const { outpostId, accesspointName } = (0, middleware_bucket_endpoint_1.getArnResources)(resource);
|
|
78
78
|
if (!outpostId) {
|
|
79
79
|
throw new Error("ARN resource should begin with 'outpost'");
|
|
80
80
|
}
|
|
@@ -5,8 +5,8 @@ const parse_outpost_arnables_1 = require("./parse-outpost-arnables");
|
|
|
5
5
|
const update_arnables_request_1 = require("./update-arnables-request");
|
|
6
6
|
const getProcessArnablesPlugin = (options) => ({
|
|
7
7
|
applyToStack: (clientStack) => {
|
|
8
|
-
clientStack.add(parse_outpost_arnables_1.parseOutpostArnablesMiddleaware(options), parse_outpost_arnables_1.parseOutpostArnablesMiddleawareOptions);
|
|
9
|
-
clientStack.add(update_arnables_request_1.updateArnablesRequestMiddleware(options), update_arnables_request_1.updateArnablesRequestMiddlewareOptions);
|
|
8
|
+
clientStack.add((0, parse_outpost_arnables_1.parseOutpostArnablesMiddleaware)(options), parse_outpost_arnables_1.parseOutpostArnablesMiddleawareOptions);
|
|
9
|
+
clientStack.add((0, update_arnables_request_1.updateArnablesRequestMiddleware)(options), update_arnables_request_1.updateArnablesRequestMiddlewareOptions);
|
|
10
10
|
},
|
|
11
11
|
});
|
|
12
12
|
exports.getProcessArnablesPlugin = getProcessArnablesPlugin;
|
|
@@ -16,7 +16,7 @@ const updateArnablesRequestMiddleware = (config) => (next, context) => async (ar
|
|
|
16
16
|
const { isCustomEndpoint } = config;
|
|
17
17
|
const useFipsEndpoint = await config.useFipsEndpoint();
|
|
18
18
|
request.headers[OUTPOST_ID_HEADER] = context[constants_1.CONTEXT_OUTPOST_ID];
|
|
19
|
-
request.hostname = getOutpostEndpoint_1.getOutpostEndpoint(request.hostname, {
|
|
19
|
+
request.hostname = (0, getOutpostEndpoint_1.getOutpostEndpoint)(request.hostname, {
|
|
20
20
|
isCustomEndpoint,
|
|
21
21
|
regionOverride: context[constants_1.CONTEXT_ARN_REGION],
|
|
22
22
|
useFipsEndpoint,
|
|
@@ -11,7 +11,7 @@ const redirectFromPostIdMiddleware = (config) => (next, context) => async (args)
|
|
|
11
11
|
if (input.OutpostId) {
|
|
12
12
|
const { isCustomEndpoint } = config;
|
|
13
13
|
const useFipsEndpoint = await config.useFipsEndpoint();
|
|
14
|
-
request.hostname = process_arnables_plugin_1.getOutpostEndpoint(request.hostname, { isCustomEndpoint, useFipsEndpoint });
|
|
14
|
+
request.hostname = (0, process_arnables_plugin_1.getOutpostEndpoint)(request.hostname, { isCustomEndpoint, useFipsEndpoint });
|
|
15
15
|
context[constants_1.CONTEXT_SIGNING_SERVICE] = "s3-outposts";
|
|
16
16
|
}
|
|
17
17
|
return next(args);
|
|
@@ -25,7 +25,7 @@ exports.redirectFromPostIdMiddlewareOptions = {
|
|
|
25
25
|
};
|
|
26
26
|
const getRedirectFromPostIdPlugin = (options) => ({
|
|
27
27
|
applyToStack: (clientStack) => {
|
|
28
|
-
clientStack.add(exports.redirectFromPostIdMiddleware(options), exports.redirectFromPostIdMiddlewareOptions);
|
|
28
|
+
clientStack.add((0, exports.redirectFromPostIdMiddleware)(options), exports.redirectFromPostIdMiddlewareOptions);
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
31
|
exports.getRedirectFromPostIdPlugin = getRedirectFromPostIdPlugin;
|
|
@@ -7,9 +7,9 @@ export var getOutpostEndpoint = function (hostname, _a) {
|
|
|
7
7
|
}
|
|
8
8
|
var _b = __read(hostname.match(REGEX_S3CONTROL_HOSTNAME), 4), matched = _b[0], prefix = _b[1], fips = _b[2], region = _b[3];
|
|
9
9
|
return [
|
|
10
|
-
"s3-outposts"
|
|
10
|
+
"s3-outposts".concat(useFipsEndpoint ? "-fips" : ""),
|
|
11
11
|
regionOverride || region,
|
|
12
|
-
hostname.replace(new RegExp("^"
|
|
12
|
+
hostname.replace(new RegExp("^".concat(matched)), ""),
|
|
13
13
|
]
|
|
14
14
|
.filter(function (part) { return part !== undefined; })
|
|
15
15
|
.join(".");
|
|
@@ -60,7 +60,7 @@ export var parseOutpostArnablesMiddleaware = function (options) {
|
|
|
60
60
|
input.AccountId = arn.accountId;
|
|
61
61
|
}
|
|
62
62
|
else if (input.AccountId !== arn.accountId) {
|
|
63
|
-
throw new Error("AccountId is incompatible with account id inferred from "
|
|
63
|
+
throw new Error("AccountId is incompatible with account id inferred from ".concat(parameter));
|
|
64
64
|
}
|
|
65
65
|
if (useArnRegion)
|
|
66
66
|
context[CONTEXT_ARN_REGION] = arn.region;
|
|
@@ -105,12 +105,12 @@ var parseOutpostBucketArnResource = function (resource) {
|
|
|
105
105
|
var _a = __read(resource.split(delimiter)), resourceType = _a[0], rest = _a.slice(1);
|
|
106
106
|
if (resourceType === "outpost") {
|
|
107
107
|
if (!rest[0] || rest[1] !== "bucket" || !rest[2] || rest.length !== 3) {
|
|
108
|
-
throw new Error("Outpost Bucket ARN should have resource outpost"
|
|
108
|
+
throw new Error("Outpost Bucket ARN should have resource outpost".concat(delimiter, "{outpostId}").concat(delimiter, "bucket").concat(delimiter, "{bucketName}"));
|
|
109
109
|
}
|
|
110
110
|
var _b = __read(rest, 3), outpostId = _b[0], _1 = _b[1], bucketName = _b[2];
|
|
111
111
|
return { outpostId: outpostId, bucketName: bucketName };
|
|
112
112
|
}
|
|
113
113
|
else {
|
|
114
|
-
throw new Error("ARN resource should begin with 'outpost"
|
|
114
|
+
throw new Error("ARN resource should begin with 'outpost".concat(delimiter, "'"));
|
|
115
115
|
}
|
|
116
116
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-s3-control",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.55.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@aws-sdk/middleware-bucket-endpoint": "3.
|
|
23
|
-
"@aws-sdk/protocol-http": "3.
|
|
24
|
-
"@aws-sdk/types": "3.
|
|
25
|
-
"@aws-sdk/util-arn-parser": "3.
|
|
26
|
-
"tslib": "^2.3.
|
|
22
|
+
"@aws-sdk/middleware-bucket-endpoint": "3.55.0",
|
|
23
|
+
"@aws-sdk/protocol-http": "3.55.0",
|
|
24
|
+
"@aws-sdk/types": "3.55.0",
|
|
25
|
+
"@aws-sdk/util-arn-parser": "3.55.0",
|
|
26
|
+
"tslib": "^2.3.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@aws-sdk/middleware-stack": "3.
|
|
29
|
+
"@aws-sdk/middleware-stack": "3.55.0",
|
|
30
30
|
"@tsconfig/recommended": "1.0.1",
|
|
31
31
|
"concurrently": "7.0.0",
|
|
32
32
|
"downlevel-dts": "0.7.0",
|
|
33
33
|
"rimraf": "3.0.2",
|
|
34
34
|
"typedoc": "0.19.2",
|
|
35
|
-
"typescript": "~4.
|
|
35
|
+
"typescript": "~4.6.2"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">= 12.0.0"
|