@aws-sdk/middleware-sdk-s3-control 3.37.0 → 3.40.1

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 CHANGED
@@ -3,6 +3,41 @@
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.40.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.40.0...v3.40.1) (2021-11-08)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/middleware-sdk-s3-control
9
+
10
+
11
+
12
+
13
+
14
+ # [3.40.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.39.0...v3.40.0) (2021-11-05)
15
+
16
+
17
+ ### Features
18
+
19
+ * **client-s3-control:** support FIPS in S3 Outposts Control Plane ([#2985](https://github.com/aws/aws-sdk-js-v3/issues/2985)) ([41d3762](https://github.com/aws/aws-sdk-js-v3/commit/41d376238d2f6c011e7ddbb383367d2393a14c71))
20
+
21
+
22
+
23
+
24
+
25
+ # [3.39.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.38.0...v3.39.0) (2021-10-29)
26
+
27
+ **Note:** Version bump only for package @aws-sdk/middleware-sdk-s3-control
28
+
29
+
30
+
31
+
32
+
33
+ # [3.38.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.37.0...v3.38.0) (2021-10-22)
34
+
35
+ **Note:** Version bump only for package @aws-sdk/middleware-sdk-s3-control
36
+
37
+
38
+
39
+
40
+
6
41
  # [3.37.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.1...v3.37.0) (2021-10-15)
7
42
 
8
43
  **Note:** Version bump only for package @aws-sdk/middleware-sdk-s3-control
@@ -4,10 +4,9 @@ exports.resolveS3ControlConfig = exports.NODE_USE_ARN_REGION_CONFIG_OPTIONS = vo
4
4
  var middleware_bucket_endpoint_1 = require("@aws-sdk/middleware-bucket-endpoint");
5
5
  Object.defineProperty(exports, "NODE_USE_ARN_REGION_CONFIG_OPTIONS", { enumerable: true, get: function () { return middleware_bucket_endpoint_1.NODE_USE_ARN_REGION_CONFIG_OPTIONS; } });
6
6
  function resolveS3ControlConfig(input) {
7
- const { useDualstackEndpoint = false, useArnRegion = false } = input;
7
+ const { useArnRegion = false } = input;
8
8
  return {
9
9
  ...input,
10
- useDualstackEndpoint,
11
10
  useArnRegion: typeof useArnRegion === "function" ? useArnRegion : () => Promise.resolve(useArnRegion),
12
11
  };
13
12
  }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOutpostEndpoint = void 0;
4
+ const REGEX_S3CONTROL_HOSTNAME = /^(.+\.)?s3-control[.-]([a-z0-9-]+)\./;
5
+ const getOutpostEndpoint = (hostname, { isCustomEndpoint, regionOverride, useFipsEndpoint }) => {
6
+ const [matched, prefix, region] = hostname.match(REGEX_S3CONTROL_HOSTNAME);
7
+ return isCustomEndpoint
8
+ ? hostname
9
+ : [
10
+ `s3-outposts${useFipsEndpoint ? "-fips" : ""}`,
11
+ regionOverride || region,
12
+ hostname.replace(new RegExp(`^${matched}`), ""),
13
+ ]
14
+ .filter((part) => part !== undefined)
15
+ .join(".");
16
+ };
17
+ exports.getOutpostEndpoint = getOutpostEndpoint;
@@ -9,4 +9,5 @@ Object.defineProperty(exports, "parseOutpostArnablesMiddleawareOptions", { enume
9
9
  var update_arnables_request_1 = require("./update-arnables-request");
10
10
  Object.defineProperty(exports, "updateArnablesRequestMiddleware", { enumerable: true, get: function () { return update_arnables_request_1.updateArnablesRequestMiddleware; } });
11
11
  Object.defineProperty(exports, "updateArnablesRequestMiddlewareOptions", { enumerable: true, get: function () { return update_arnables_request_1.updateArnablesRequestMiddlewareOptions; } });
12
- Object.defineProperty(exports, "getOutpostEndpoint", { enumerable: true, get: function () { return update_arnables_request_1.getOutpostEndpoint; } });
12
+ var getOutpostEndpoint_1 = require("./getOutpostEndpoint");
13
+ Object.defineProperty(exports, "getOutpostEndpoint", { enumerable: true, get: function () { return getOutpostEndpoint_1.getOutpostEndpoint; } });
@@ -10,12 +10,17 @@ const parseOutpostArnablesMiddleaware = (options) => (next, context) => async (a
10
10
  if (!parameter)
11
11
  return next(args);
12
12
  const clientRegion = await options.region();
13
- const { regionInfoProvider } = options;
14
13
  const useArnRegion = await options.useArnRegion();
15
- const baseRegion = middleware_bucket_endpoint_1.getPseudoRegion(clientRegion);
16
- const { partition: clientPartition, signingRegion = baseRegion } = (await regionInfoProvider(baseRegion));
14
+ const useFipsEndpoint = await options.useFipsEndpoint();
15
+ const useDualstackEndpoint = await options.useDualstackEndpoint();
16
+ const baseRegion = clientRegion;
17
+ const { partition: clientPartition, signingRegion = baseRegion } = (await options.regionInfoProvider(baseRegion, {
18
+ useFipsEndpoint,
19
+ useDualstackEndpoint,
20
+ }));
17
21
  const validatorOptions = {
18
- useDualstackEndpoint: options.useDualstackEndpoint,
22
+ useFipsEndpoint,
23
+ useDualstackEndpoint,
19
24
  clientRegion,
20
25
  clientPartition,
21
26
  signingRegion,
@@ -54,7 +59,7 @@ exports.parseOutpostArnablesMiddleawareOptions = {
54
59
  tags: ["CONVERT_ARN", "OUTPOST_BUCKET_ARN", "OUTPOST_ACCESS_POINT_ARN", "OUTPOST"],
55
60
  name: "parseOutpostArnablesMiddleaware",
56
61
  };
57
- const validateOutpostsArn = (arn, { clientRegion, signingRegion, clientPartition, useArnRegion, useDualstackEndpoint }) => {
62
+ const validateOutpostsArn = (arn, { clientRegion, signingRegion, clientPartition, useArnRegion, useFipsEndpoint, useDualstackEndpoint, }) => {
58
63
  const { service, partition, accountId, region } = arn;
59
64
  middleware_bucket_endpoint_1.validateOutpostService(service);
60
65
  middleware_bucket_endpoint_1.validatePartition(partition, { clientPartition });
@@ -63,10 +68,9 @@ const validateOutpostsArn = (arn, { clientRegion, signingRegion, clientPartition
63
68
  useArnRegion,
64
69
  clientRegion,
65
70
  clientSigningRegion: signingRegion,
71
+ useFipsEndpoint,
66
72
  });
67
73
  middleware_bucket_endpoint_1.validateNoDualstack(useDualstackEndpoint);
68
- if (!useArnRegion)
69
- middleware_bucket_endpoint_1.validateNoFIPS(clientRegion);
70
74
  };
71
75
  const parseOutpostsAccessPointArnResource = (resource) => {
72
76
  const { outpostId, accesspointName } = middleware_bucket_endpoint_1.getArnResources(resource);
@@ -1,36 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateArnablesRequestMiddlewareOptions = exports.getOutpostEndpoint = exports.updateArnablesRequestMiddleware = void 0;
3
+ exports.updateArnablesRequestMiddlewareOptions = exports.updateArnablesRequestMiddleware = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const constants_1 = require("../constants");
6
+ const getOutpostEndpoint_1 = require("./getOutpostEndpoint");
6
7
  const ACCOUNT_ID_HEADER = "x-amz-account-id";
7
8
  const OUTPOST_ID_HEADER = "x-amz-outpost-id";
8
- const REGEX_S3CONTROL_HOSTNAME = /^(.+\.)?s3-control[.-]([a-z0-9-]+)\./;
9
- const updateArnablesRequestMiddleware = ({ isCustomEndpoint }) => (next, context) => (args) => {
9
+ const updateArnablesRequestMiddleware = (config) => (next, context) => async (args) => {
10
10
  const { request } = args;
11
11
  if (!protocol_http_1.HttpRequest.isInstance(request))
12
12
  return next(args);
13
13
  if (context[constants_1.CONTEXT_ACCOUNT_ID])
14
14
  request.headers[ACCOUNT_ID_HEADER] = context[constants_1.CONTEXT_ACCOUNT_ID];
15
15
  if (context[constants_1.CONTEXT_OUTPOST_ID]) {
16
+ const { isCustomEndpoint } = config;
17
+ const useFipsEndpoint = await config.useFipsEndpoint();
16
18
  request.headers[OUTPOST_ID_HEADER] = context[constants_1.CONTEXT_OUTPOST_ID];
17
- request.hostname = exports.getOutpostEndpoint(request.hostname, {
19
+ request.hostname = getOutpostEndpoint_1.getOutpostEndpoint(request.hostname, {
18
20
  isCustomEndpoint,
19
21
  regionOverride: context[constants_1.CONTEXT_ARN_REGION],
22
+ useFipsEndpoint,
20
23
  });
21
24
  }
22
25
  return next(args);
23
26
  };
24
27
  exports.updateArnablesRequestMiddleware = updateArnablesRequestMiddleware;
25
- const getOutpostEndpoint = (hostname, { isCustomEndpoint, regionOverride } = {}) => {
26
- const [matched, prefix, region] = hostname.match(REGEX_S3CONTROL_HOSTNAME);
27
- return isCustomEndpoint
28
- ? hostname
29
- : ["s3-outposts", regionOverride || region, hostname.replace(new RegExp(`^${matched}`), "")]
30
- .filter((part) => part !== undefined)
31
- .join(".");
32
- };
33
- exports.getOutpostEndpoint = getOutpostEndpoint;
34
28
  exports.updateArnablesRequestMiddlewareOptions = {
35
29
  step: "build",
36
30
  name: "updateArnablesRequestMiddleware",
@@ -4,12 +4,14 @@ exports.getRedirectFromPostIdPlugin = exports.redirectFromPostIdMiddlewareOption
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const constants_1 = require("./constants");
6
6
  const process_arnables_plugin_1 = require("./process-arnables-plugin");
7
- const redirectFromPostIdMiddleware = ({ isCustomEndpoint }) => (next, context) => (args) => {
7
+ const redirectFromPostIdMiddleware = (config) => (next, context) => async (args) => {
8
8
  const { input, request } = args;
9
9
  if (!protocol_http_1.HttpRequest.isInstance(request))
10
10
  return next(args);
11
11
  if (input.OutpostId) {
12
- request.hostname = process_arnables_plugin_1.getOutpostEndpoint(request.hostname, { isCustomEndpoint });
12
+ const { isCustomEndpoint } = config;
13
+ const useFipsEndpoint = await config.useFipsEndpoint();
14
+ request.hostname = process_arnables_plugin_1.getOutpostEndpoint(request.hostname, { isCustomEndpoint, useFipsEndpoint });
13
15
  context[constants_1.CONTEXT_SIGNING_SERVICE] = "s3-outposts";
14
16
  }
15
17
  return next(args);
@@ -1,6 +1,6 @@
1
1
  import { __assign } from "tslib";
2
2
  export { NODE_USE_ARN_REGION_CONFIG_OPTIONS } from "@aws-sdk/middleware-bucket-endpoint";
3
3
  export function resolveS3ControlConfig(input) {
4
- var _a = input.useDualstackEndpoint, useDualstackEndpoint = _a === void 0 ? false : _a, _b = input.useArnRegion, useArnRegion = _b === void 0 ? false : _b;
5
- return __assign(__assign({}, input), { useDualstackEndpoint: useDualstackEndpoint, useArnRegion: typeof useArnRegion === "function" ? useArnRegion : function () { return Promise.resolve(useArnRegion); } });
4
+ var _a = input.useArnRegion, useArnRegion = _a === void 0 ? false : _a;
5
+ return __assign(__assign({}, input), { useArnRegion: typeof useArnRegion === "function" ? useArnRegion : function () { return Promise.resolve(useArnRegion); } });
6
6
  }
@@ -0,0 +1,15 @@
1
+ import { __read } from "tslib";
2
+ var REGEX_S3CONTROL_HOSTNAME = /^(.+\.)?s3-control[.-]([a-z0-9-]+)\./;
3
+ export var getOutpostEndpoint = function (hostname, _a) {
4
+ var isCustomEndpoint = _a.isCustomEndpoint, regionOverride = _a.regionOverride, useFipsEndpoint = _a.useFipsEndpoint;
5
+ var _b = __read(hostname.match(REGEX_S3CONTROL_HOSTNAME), 3), matched = _b[0], prefix = _b[1], region = _b[2];
6
+ return isCustomEndpoint
7
+ ? hostname
8
+ : [
9
+ "s3-outposts" + (useFipsEndpoint ? "-fips" : ""),
10
+ regionOverride || region,
11
+ hostname.replace(new RegExp("^" + matched), ""),
12
+ ]
13
+ .filter(function (part) { return part !== undefined; })
14
+ .join(".");
15
+ };
@@ -1,3 +1,4 @@
1
1
  export { getProcessArnablesPlugin } from "./plugin";
2
2
  export { parseOutpostArnablesMiddleaware, parseOutpostArnablesMiddleawareOptions } from "./parse-outpost-arnables";
3
- export { updateArnablesRequestMiddleware, updateArnablesRequestMiddlewareOptions, getOutpostEndpoint, } from "./update-arnables-request";
3
+ export { updateArnablesRequestMiddleware, updateArnablesRequestMiddlewareOptions } from "./update-arnables-request";
4
+ export { getOutpostEndpoint } from "./getOutpostEndpoint";
@@ -1,11 +1,11 @@
1
1
  import { __awaiter, __generator, __read } from "tslib";
2
- import { getArnResources as getS3AccesspointArnResources, getPseudoRegion, validateAccountId, validateNoDualstack, validateNoFIPS, validateOutpostService, validatePartition, validateRegion, } from "@aws-sdk/middleware-bucket-endpoint";
2
+ import { getArnResources as getS3AccesspointArnResources, validateAccountId, validateNoDualstack, validateOutpostService, validatePartition, validateRegion, } from "@aws-sdk/middleware-bucket-endpoint";
3
3
  import { parse as parseArn, validate as validateArn } from "@aws-sdk/util-arn-parser";
4
4
  import { CONTEXT_ARN_REGION, CONTEXT_OUTPOST_ID, CONTEXT_SIGNING_REGION, CONTEXT_SIGNING_SERVICE } from "../constants";
5
5
  export var parseOutpostArnablesMiddleaware = function (options) {
6
6
  return function (next, context) {
7
7
  return function (args) { return __awaiter(void 0, void 0, void 0, function () {
8
- var input, parameter, clientRegion, regionInfoProvider, useArnRegion, baseRegion, _a, clientPartition, _b, signingRegion, validatorOptions, arn, _c, outpostId, accesspointName, _d, outpostId, bucketName;
8
+ var input, parameter, clientRegion, useArnRegion, useFipsEndpoint, useDualstackEndpoint, baseRegion, _a, clientPartition, _b, signingRegion, validatorOptions, arn, _c, outpostId, accesspointName, _d, outpostId, bucketName;
9
9
  return __generator(this, function (_e) {
10
10
  switch (_e.label) {
11
11
  case 0:
@@ -16,16 +16,25 @@ export var parseOutpostArnablesMiddleaware = function (options) {
16
16
  return [4, options.region()];
17
17
  case 1:
18
18
  clientRegion = _e.sent();
19
- regionInfoProvider = options.regionInfoProvider;
20
19
  return [4, options.useArnRegion()];
21
20
  case 2:
22
21
  useArnRegion = _e.sent();
23
- baseRegion = getPseudoRegion(clientRegion);
24
- return [4, regionInfoProvider(baseRegion)];
22
+ return [4, options.useFipsEndpoint()];
25
23
  case 3:
24
+ useFipsEndpoint = _e.sent();
25
+ return [4, options.useDualstackEndpoint()];
26
+ case 4:
27
+ useDualstackEndpoint = _e.sent();
28
+ baseRegion = clientRegion;
29
+ return [4, options.regionInfoProvider(baseRegion, {
30
+ useFipsEndpoint: useFipsEndpoint,
31
+ useDualstackEndpoint: useDualstackEndpoint,
32
+ })];
33
+ case 5:
26
34
  _a = (_e.sent()), clientPartition = _a.partition, _b = _a.signingRegion, signingRegion = _b === void 0 ? baseRegion : _b;
27
35
  validatorOptions = {
28
- useDualstackEndpoint: options.useDualstackEndpoint,
36
+ useFipsEndpoint: useFipsEndpoint,
37
+ useDualstackEndpoint: useDualstackEndpoint,
29
38
  clientRegion: clientRegion,
30
39
  clientPartition: clientPartition,
31
40
  signingRegion: signingRegion,
@@ -67,7 +76,7 @@ export var parseOutpostArnablesMiddleawareOptions = {
67
76
  name: "parseOutpostArnablesMiddleaware",
68
77
  };
69
78
  var validateOutpostsArn = function (arn, _a) {
70
- var clientRegion = _a.clientRegion, signingRegion = _a.signingRegion, clientPartition = _a.clientPartition, useArnRegion = _a.useArnRegion, useDualstackEndpoint = _a.useDualstackEndpoint;
79
+ var clientRegion = _a.clientRegion, signingRegion = _a.signingRegion, clientPartition = _a.clientPartition, useArnRegion = _a.useArnRegion, useFipsEndpoint = _a.useFipsEndpoint, useDualstackEndpoint = _a.useDualstackEndpoint;
71
80
  var service = arn.service, partition = arn.partition, accountId = arn.accountId, region = arn.region;
72
81
  validateOutpostService(service);
73
82
  validatePartition(partition, { clientPartition: clientPartition });
@@ -76,10 +85,9 @@ var validateOutpostsArn = function (arn, _a) {
76
85
  useArnRegion: useArnRegion,
77
86
  clientRegion: clientRegion,
78
87
  clientSigningRegion: signingRegion,
88
+ useFipsEndpoint: useFipsEndpoint,
79
89
  });
80
90
  validateNoDualstack(useDualstackEndpoint);
81
- if (!useArnRegion)
82
- validateNoFIPS(clientRegion);
83
91
  };
84
92
  var parseOutpostsAccessPointArnResource = function (resource) {
85
93
  var _a = getS3AccesspointArnResources(resource), outpostId = _a.outpostId, accesspointName = _a.accesspointName;
@@ -1,38 +1,39 @@
1
- import { __read } from "tslib";
1
+ import { __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest } from "@aws-sdk/protocol-http";
3
3
  import { CONTEXT_ACCOUNT_ID, CONTEXT_ARN_REGION, CONTEXT_OUTPOST_ID } from "../constants";
4
+ import { getOutpostEndpoint } from "./getOutpostEndpoint";
4
5
  var ACCOUNT_ID_HEADER = "x-amz-account-id";
5
6
  var OUTPOST_ID_HEADER = "x-amz-outpost-id";
6
- var REGEX_S3CONTROL_HOSTNAME = /^(.+\.)?s3-control[.-]([a-z0-9-]+)\./;
7
- export var updateArnablesRequestMiddleware = function (_a) {
8
- var isCustomEndpoint = _a.isCustomEndpoint;
7
+ export var updateArnablesRequestMiddleware = function (config) {
9
8
  return function (next, context) {
10
- return function (args) {
11
- var request = args.request;
12
- if (!HttpRequest.isInstance(request))
13
- return next(args);
14
- if (context[CONTEXT_ACCOUNT_ID])
15
- request.headers[ACCOUNT_ID_HEADER] = context[CONTEXT_ACCOUNT_ID];
16
- if (context[CONTEXT_OUTPOST_ID]) {
17
- request.headers[OUTPOST_ID_HEADER] = context[CONTEXT_OUTPOST_ID];
18
- request.hostname = getOutpostEndpoint(request.hostname, {
19
- isCustomEndpoint: isCustomEndpoint,
20
- regionOverride: context[CONTEXT_ARN_REGION],
21
- });
22
- }
23
- return next(args);
24
- };
9
+ return function (args) { return __awaiter(void 0, void 0, void 0, function () {
10
+ var request, isCustomEndpoint, useFipsEndpoint;
11
+ return __generator(this, function (_a) {
12
+ switch (_a.label) {
13
+ case 0:
14
+ request = args.request;
15
+ if (!HttpRequest.isInstance(request))
16
+ return [2, next(args)];
17
+ if (context[CONTEXT_ACCOUNT_ID])
18
+ request.headers[ACCOUNT_ID_HEADER] = context[CONTEXT_ACCOUNT_ID];
19
+ if (!context[CONTEXT_OUTPOST_ID]) return [3, 2];
20
+ isCustomEndpoint = config.isCustomEndpoint;
21
+ return [4, config.useFipsEndpoint()];
22
+ case 1:
23
+ useFipsEndpoint = _a.sent();
24
+ request.headers[OUTPOST_ID_HEADER] = context[CONTEXT_OUTPOST_ID];
25
+ request.hostname = getOutpostEndpoint(request.hostname, {
26
+ isCustomEndpoint: isCustomEndpoint,
27
+ regionOverride: context[CONTEXT_ARN_REGION],
28
+ useFipsEndpoint: useFipsEndpoint,
29
+ });
30
+ _a.label = 2;
31
+ case 2: return [2, next(args)];
32
+ }
33
+ });
34
+ }); };
25
35
  };
26
36
  };
27
- export var getOutpostEndpoint = function (hostname, _a) {
28
- var _b = _a === void 0 ? {} : _a, isCustomEndpoint = _b.isCustomEndpoint, regionOverride = _b.regionOverride;
29
- var _c = __read(hostname.match(REGEX_S3CONTROL_HOSTNAME), 3), matched = _c[0], prefix = _c[1], region = _c[2];
30
- return isCustomEndpoint
31
- ? hostname
32
- : ["s3-outposts", regionOverride || region, hostname.replace(new RegExp("^" + matched), "")]
33
- .filter(function (part) { return part !== undefined; })
34
- .join(".");
35
- };
36
37
  export var updateArnablesRequestMiddlewareOptions = {
37
38
  step: "build",
38
39
  name: "updateArnablesRequestMiddleware",
@@ -1,19 +1,29 @@
1
+ import { __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { CONTEXT_SIGNING_SERVICE } from "./constants";
3
4
  import { getOutpostEndpoint } from "./process-arnables-plugin";
4
- export var redirectFromPostIdMiddleware = function (_a) {
5
- var isCustomEndpoint = _a.isCustomEndpoint;
5
+ export var redirectFromPostIdMiddleware = function (config) {
6
6
  return function (next, context) {
7
- return function (args) {
8
- var input = args.input, request = args.request;
9
- if (!HttpRequest.isInstance(request))
10
- return next(args);
11
- if (input.OutpostId) {
12
- request.hostname = getOutpostEndpoint(request.hostname, { isCustomEndpoint: isCustomEndpoint });
13
- context[CONTEXT_SIGNING_SERVICE] = "s3-outposts";
14
- }
15
- return next(args);
16
- };
7
+ return function (args) { return __awaiter(void 0, void 0, void 0, function () {
8
+ var input, request, isCustomEndpoint, useFipsEndpoint;
9
+ return __generator(this, function (_a) {
10
+ switch (_a.label) {
11
+ case 0:
12
+ input = args.input, request = args.request;
13
+ if (!HttpRequest.isInstance(request))
14
+ return [2, next(args)];
15
+ if (!input.OutpostId) return [3, 2];
16
+ isCustomEndpoint = config.isCustomEndpoint;
17
+ return [4, config.useFipsEndpoint()];
18
+ case 1:
19
+ useFipsEndpoint = _a.sent();
20
+ request.hostname = getOutpostEndpoint(request.hostname, { isCustomEndpoint: isCustomEndpoint, useFipsEndpoint: useFipsEndpoint });
21
+ context[CONTEXT_SIGNING_SERVICE] = "s3-outposts";
22
+ _a.label = 2;
23
+ case 2: return [2, next(args)];
24
+ }
25
+ });
26
+ }); };
17
27
  };
18
28
  };
19
29
  export var redirectFromPostIdMiddlewareOptions = {
@@ -1,10 +1,6 @@
1
1
  import { Provider, RegionInfoProvider } from "@aws-sdk/types";
2
2
  export { NODE_USE_ARN_REGION_CONFIG_OPTIONS } from "@aws-sdk/middleware-bucket-endpoint";
3
3
  export interface S3ControlInputConfig {
4
- /**
5
- * Enables IPv6/IPv4 dualstack endpoint. When a DNS lookup is performed on an endpoint of this type, it returns an “A” record with an IPv4 address and an “AAAA” record with an IPv6 address. In most cases the network stack in the client environment will automatically prefer the AAAA record and make a connection using the IPv6 address. Note, however, that currently on Windows, the IPv4 address will be preferred.
6
- */
7
- useDualstackEndpoint?: boolean;
8
4
  /**
9
5
  * Whether to override the request region with the region inferred from requested resource's ARN. Defaults to false
10
6
  */
@@ -14,6 +10,8 @@ interface PreviouslyResolved {
14
10
  isCustomEndpoint: boolean;
15
11
  region: Provider<string>;
16
12
  regionInfoProvider: RegionInfoProvider;
13
+ useFipsEndpoint: Provider<boolean>;
14
+ useDualstackEndpoint: Provider<boolean>;
17
15
  }
18
16
  export interface S3ControlResolvedConfig {
19
17
  /**
@@ -22,9 +20,13 @@ export interface S3ControlResolvedConfig {
22
20
  */
23
21
  isCustomEndpoint: boolean;
24
22
  /**
25
- * Resolved value for input config {@link S3ControlInputConfig.useDualstackEndpoint}
23
+ * Enables FIPS compatible endpoints.
24
+ */
25
+ useFipsEndpoint: Provider<boolean>;
26
+ /**
27
+ * Enables IPv6/IPv4 dualstack endpoint.
26
28
  */
27
- useDualstackEndpoint: boolean;
29
+ useDualstackEndpoint: Provider<boolean>;
28
30
  /**
29
31
  * Resolved value for input config {@link S3ControlInputConfig.useArnRegion}
30
32
  */
@@ -0,0 +1,6 @@
1
+ export interface GetOutpostEndpointOptions {
2
+ isCustomEndpoint?: boolean;
3
+ regionOverride?: string;
4
+ useFipsEndpoint: boolean;
5
+ }
6
+ export declare const getOutpostEndpoint: (hostname: string, { isCustomEndpoint, regionOverride, useFipsEndpoint }: GetOutpostEndpointOptions) => string;
@@ -1,3 +1,4 @@
1
1
  export { getProcessArnablesPlugin } from "./plugin";
2
2
  export { parseOutpostArnablesMiddleaware, parseOutpostArnablesMiddleawareOptions } from "./parse-outpost-arnables";
3
- export { updateArnablesRequestMiddleware, updateArnablesRequestMiddlewareOptions, getOutpostEndpoint, } from "./update-arnables-request";
3
+ export { updateArnablesRequestMiddleware, updateArnablesRequestMiddlewareOptions } from "./update-arnables-request";
4
+ export { getOutpostEndpoint } from "./getOutpostEndpoint";
@@ -1,13 +1,11 @@
1
- import { BuildHandlerOptions, BuildMiddleware } from "@aws-sdk/types";
1
+ import { BuildHandlerOptions, BuildMiddleware, Provider } from "@aws-sdk/types";
2
+ export interface UpdateArnablesRequestMiddlewareConfig {
3
+ isCustomEndpoint: boolean;
4
+ useFipsEndpoint: Provider<boolean>;
5
+ }
2
6
  /**
3
7
  * After outpost request is constructed, redirect request to outpost endpoint and set `x-amz-account-id` and
4
8
  * `x-amz-outpost-id` headers.
5
9
  */
6
- export declare const updateArnablesRequestMiddleware: ({ isCustomEndpoint }: {
7
- isCustomEndpoint: boolean;
8
- }) => BuildMiddleware<any, any>;
9
- export declare const getOutpostEndpoint: (hostname: string, { isCustomEndpoint, regionOverride }?: {
10
- isCustomEndpoint?: boolean | undefined;
11
- regionOverride?: string | undefined;
12
- }) => string;
10
+ export declare const updateArnablesRequestMiddleware: (config: UpdateArnablesRequestMiddlewareConfig) => BuildMiddleware<any, any>;
13
11
  export declare const updateArnablesRequestMiddlewareOptions: BuildHandlerOptions;
@@ -1,15 +1,17 @@
1
- import { BuildHandlerOptions, BuildMiddleware, Pluggable } from "@aws-sdk/types";
1
+ import { BuildHandlerOptions, BuildMiddleware, Pluggable, Provider } from "@aws-sdk/types";
2
2
  import { S3ControlResolvedConfig } from "./configurations";
3
3
  declare type InputType = {
4
4
  OutpostId?: string;
5
5
  };
6
+ export interface RedirectFromPostIdMiddlewareConfig {
7
+ isCustomEndpoint: boolean;
8
+ useFipsEndpoint: Provider<boolean>;
9
+ }
6
10
  /**
7
11
  * If OutpostId is set, redirect hostname to Outpost one, and change signing service to `s3-outposts`.
8
12
  * Applied to S3Control.CreateBucket and S3Control.ListRegionalBuckets
9
13
  */
10
- export declare const redirectFromPostIdMiddleware: ({ isCustomEndpoint }: {
11
- isCustomEndpoint: boolean;
12
- }) => BuildMiddleware<InputType, any>;
14
+ export declare const redirectFromPostIdMiddleware: (config: RedirectFromPostIdMiddlewareConfig) => BuildMiddleware<InputType, any>;
13
15
  export declare const redirectFromPostIdMiddlewareOptions: BuildHandlerOptions;
14
16
  export declare const getRedirectFromPostIdPlugin: (options: S3ControlResolvedConfig) => Pluggable<any, any>;
15
17
  export {};
@@ -2,20 +2,22 @@ import { Provider, RegionInfoProvider } from "@aws-sdk/types";
2
2
  export { NODE_USE_ARN_REGION_CONFIG_OPTIONS } from "@aws-sdk/middleware-bucket-endpoint";
3
3
  export interface S3ControlInputConfig {
4
4
 
5
- useDualstackEndpoint?: boolean;
6
-
7
5
  useArnRegion?: boolean | Provider<boolean>;
8
6
  }
9
7
  interface PreviouslyResolved {
10
8
  isCustomEndpoint: boolean;
11
9
  region: Provider<string>;
12
10
  regionInfoProvider: RegionInfoProvider;
11
+ useFipsEndpoint: Provider<boolean>;
12
+ useDualstackEndpoint: Provider<boolean>;
13
13
  }
14
14
  export interface S3ControlResolvedConfig {
15
15
 
16
16
  isCustomEndpoint: boolean;
17
17
 
18
- useDualstackEndpoint: boolean;
18
+ useFipsEndpoint: Provider<boolean>;
19
+
20
+ useDualstackEndpoint: Provider<boolean>;
19
21
 
20
22
  useArnRegion: Provider<boolean>;
21
23
 
@@ -0,0 +1,6 @@
1
+ export interface GetOutpostEndpointOptions {
2
+ isCustomEndpoint?: boolean;
3
+ regionOverride?: string;
4
+ useFipsEndpoint: boolean;
5
+ }
6
+ export declare const getOutpostEndpoint: (hostname: string, { isCustomEndpoint, regionOverride, useFipsEndpoint }: GetOutpostEndpointOptions) => string;
@@ -1,3 +1,4 @@
1
1
  export { getProcessArnablesPlugin } from "./plugin";
2
2
  export { parseOutpostArnablesMiddleaware, parseOutpostArnablesMiddleawareOptions } from "./parse-outpost-arnables";
3
- export { updateArnablesRequestMiddleware, updateArnablesRequestMiddlewareOptions, getOutpostEndpoint, } from "./update-arnables-request";
3
+ export { updateArnablesRequestMiddleware, updateArnablesRequestMiddlewareOptions } from "./update-arnables-request";
4
+ export { getOutpostEndpoint } from "./getOutpostEndpoint";
@@ -1,10 +1,8 @@
1
- import { BuildHandlerOptions, BuildMiddleware } from "@aws-sdk/types";
2
-
3
- export declare const updateArnablesRequestMiddleware: ({ isCustomEndpoint }: {
1
+ import { BuildHandlerOptions, BuildMiddleware, Provider } from "@aws-sdk/types";
2
+ export interface UpdateArnablesRequestMiddlewareConfig {
4
3
  isCustomEndpoint: boolean;
5
- }) => BuildMiddleware<any, any>;
6
- export declare const getOutpostEndpoint: (hostname: string, { isCustomEndpoint, regionOverride }?: {
7
- isCustomEndpoint?: boolean | undefined;
8
- regionOverride?: string | undefined;
9
- }) => string;
4
+ useFipsEndpoint: Provider<boolean>;
5
+ }
6
+
7
+ export declare const updateArnablesRequestMiddleware: (config: UpdateArnablesRequestMiddlewareConfig) => BuildMiddleware<any, any>;
10
8
  export declare const updateArnablesRequestMiddlewareOptions: BuildHandlerOptions;
@@ -1,12 +1,14 @@
1
- import { BuildHandlerOptions, BuildMiddleware, Pluggable } from "@aws-sdk/types";
1
+ import { BuildHandlerOptions, BuildMiddleware, Pluggable, Provider } from "@aws-sdk/types";
2
2
  import { S3ControlResolvedConfig } from "./configurations";
3
3
  declare type InputType = {
4
4
  OutpostId?: string;
5
5
  };
6
-
7
- export declare const redirectFromPostIdMiddleware: ({ isCustomEndpoint }: {
6
+ export interface RedirectFromPostIdMiddlewareConfig {
8
7
  isCustomEndpoint: boolean;
9
- }) => BuildMiddleware<InputType, any>;
8
+ useFipsEndpoint: Provider<boolean>;
9
+ }
10
+
11
+ export declare const redirectFromPostIdMiddleware: (config: RedirectFromPostIdMiddlewareConfig) => BuildMiddleware<InputType, any>;
10
12
  export declare const redirectFromPostIdMiddlewareOptions: BuildHandlerOptions;
11
13
  export declare const getRedirectFromPostIdPlugin: (options: S3ControlResolvedConfig) => Pluggable<any, any>;
12
14
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-sdk-s3-control",
3
- "version": "3.37.0",
3
+ "version": "3.40.1",
4
4
  "scripts": {
5
5
  "build": "yarn build:cjs && yarn build:es && yarn build:types",
6
6
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@aws-sdk/middleware-bucket-endpoint": "3.37.0",
22
- "@aws-sdk/protocol-http": "3.37.0",
23
- "@aws-sdk/types": "3.37.0",
21
+ "@aws-sdk/middleware-bucket-endpoint": "3.40.1",
22
+ "@aws-sdk/protocol-http": "3.40.0",
23
+ "@aws-sdk/types": "3.40.0",
24
24
  "@aws-sdk/util-arn-parser": "3.37.0",
25
25
  "tslib": "^2.3.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@aws-sdk/middleware-stack": "3.37.0",
28
+ "@aws-sdk/middleware-stack": "3.40.0",
29
29
  "@types/jest": "^26.0.4",
30
30
  "jest": "^26.1.0",
31
31
  "typescript": "~4.3.5"