@aws-sdk/middleware-sdk-s3-control 3.357.0 → 3.369.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.
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deduplicateHostPrefix = void 0;
4
+ const util_endpoints_1 = require("@aws-sdk/util-endpoints");
4
5
  const deduplicateHostPrefix = (hostname) => {
5
- const [prefix1, prefix2, ...rest] = hostname.split(".");
6
- if (prefix1 === prefix2) {
7
- return [prefix1, ...rest].join(".");
6
+ const [p1, p2, p3, p4, ...rest] = hostname.split(".");
7
+ if ((0, util_endpoints_1.isIpAddress)(`${p1}.${p2}.${p3}.${parseInt(p4, 10)}`)) {
8
+ return hostname;
9
+ }
10
+ if (p1 === p2) {
11
+ return [p2, p3, p4, ...rest].join(".");
8
12
  }
9
13
  return hostname;
10
14
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateArnablesRequestMiddlewareOptions = exports.updateArnablesRequestMiddleware = void 0;
4
- const protocol_http_1 = require("@aws-sdk/protocol-http");
4
+ const protocol_http_1 = require("@smithy/protocol-http");
5
5
  const constants_1 = require("../constants");
6
6
  const getOutpostEndpoint_1 = require("./getOutpostEndpoint");
7
7
  const ACCOUNT_ID_HEADER = "x-amz-account-id";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRedirectFromPostIdPlugin = exports.redirectFromPostIdMiddlewareOptions = exports.redirectFromPostIdMiddleware = void 0;
4
- const protocol_http_1 = require("@aws-sdk/protocol-http");
4
+ const protocol_http_1 = require("@smithy/protocol-http");
5
5
  const constants_1 = require("./constants");
6
6
  const process_arnables_plugin_1 = require("./process-arnables-plugin");
7
7
  const redirectFromPostIdMiddleware = (config) => (next, context) => async (args) => {
@@ -1,7 +1,11 @@
1
+ import { isIpAddress } from "@aws-sdk/util-endpoints";
1
2
  export const deduplicateHostPrefix = (hostname) => {
2
- const [prefix1, prefix2, ...rest] = hostname.split(".");
3
- if (prefix1 === prefix2) {
4
- return [prefix1, ...rest].join(".");
3
+ const [p1, p2, p3, p4, ...rest] = hostname.split(".");
4
+ if (isIpAddress(`${p1}.${p2}.${p3}.${parseInt(p4, 10)}`)) {
5
+ return hostname;
6
+ }
7
+ if (p1 === p2) {
8
+ return [p2, p3, p4, ...rest].join(".");
5
9
  }
6
10
  return hostname;
7
11
  };
@@ -1,4 +1,4 @@
1
- import { HttpRequest } from "@aws-sdk/protocol-http";
1
+ import { HttpRequest } from "@smithy/protocol-http";
2
2
  import { CONTEXT_ACCOUNT_ID, CONTEXT_ARN_REGION, CONTEXT_OUTPOST_ID } from "../constants";
3
3
  import { getOutpostEndpoint } from "./getOutpostEndpoint";
4
4
  const ACCOUNT_ID_HEADER = "x-amz-account-id";
@@ -1,4 +1,4 @@
1
- import { HttpRequest } from "@aws-sdk/protocol-http";
1
+ import { HttpRequest } from "@smithy/protocol-http";
2
2
  import { CONTEXT_SIGNING_SERVICE } from "./constants";
3
3
  import { getOutpostEndpoint } from "./process-arnables-plugin";
4
4
  export const redirectFromPostIdMiddleware = (config) => (next, context) => async (args) => {
@@ -1,4 +1,4 @@
1
- import { Provider, RegionInfoProvider } from "@aws-sdk/types";
1
+ import { Provider, RegionInfoProvider } from "@smithy/types";
2
2
  export { NODE_USE_ARN_REGION_CONFIG_OPTIONS } from "@aws-sdk/middleware-bucket-endpoint";
3
3
  export interface S3ControlInputConfig {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Pluggable, RelativeMiddlewareOptions, SerializeMiddleware } from "@aws-sdk/types";
1
+ import { Pluggable, RelativeMiddlewareOptions, SerializeMiddleware } from "@smithy/types";
2
2
  /**
3
3
  * @internal
4
4
  * This customization handles an edge case where
@@ -1,3 +1,3 @@
1
- import { Pluggable } from "@aws-sdk/types";
1
+ import { Pluggable } from "@smithy/types";
2
2
  import { S3ControlResolvedConfig } from "../configurations";
3
3
  export declare const getProcessArnablesPlugin: (options: S3ControlResolvedConfig) => Pluggable<any, any>;
@@ -1,4 +1,4 @@
1
- import { InitializeHandlerOptions, InitializeMiddleware } from "@aws-sdk/types";
1
+ import { InitializeHandlerOptions, InitializeMiddleware } from "@smithy/types";
2
2
  import { S3ControlResolvedConfig } from "../configurations";
3
3
  type ArnableInput = {
4
4
  Name?: string;
@@ -1,4 +1,4 @@
1
- import { BuildHandlerOptions, BuildMiddleware, Provider } from "@aws-sdk/types";
1
+ import { BuildHandlerOptions, BuildMiddleware, Provider } from "@smithy/types";
2
2
  export interface UpdateArnablesRequestMiddlewareConfig {
3
3
  isCustomEndpoint?: boolean;
4
4
  useFipsEndpoint: Provider<boolean>;
@@ -1,4 +1,4 @@
1
- import { BuildHandlerOptions, BuildMiddleware, Pluggable, Provider } from "@aws-sdk/types";
1
+ import { BuildHandlerOptions, BuildMiddleware, Pluggable, Provider } from "@smithy/types";
2
2
  import { S3ControlResolvedConfig } from "./configurations";
3
3
  type InputType = {
4
4
  OutpostId?: string;
@@ -1,4 +1,4 @@
1
- import { Provider, RegionInfoProvider } from "@aws-sdk/types";
1
+ import { Provider, RegionInfoProvider } from "@smithy/types";
2
2
  export { NODE_USE_ARN_REGION_CONFIG_OPTIONS } from "@aws-sdk/middleware-bucket-endpoint";
3
3
  export interface S3ControlInputConfig {
4
4
  useArnRegion?: boolean | Provider<boolean>;
@@ -2,7 +2,7 @@ import {
2
2
  Pluggable,
3
3
  RelativeMiddlewareOptions,
4
4
  SerializeMiddleware,
5
- } from "@aws-sdk/types";
5
+ } from "@smithy/types";
6
6
  export declare const hostPrefixDeduplicationMiddleware: () => SerializeMiddleware<
7
7
  any,
8
8
  any
@@ -1,4 +1,4 @@
1
- import { Pluggable } from "@aws-sdk/types";
1
+ import { Pluggable } from "@smithy/types";
2
2
  import { S3ControlResolvedConfig } from "../configurations";
3
3
  export declare const getProcessArnablesPlugin: (
4
4
  options: S3ControlResolvedConfig
@@ -1,4 +1,4 @@
1
- import { InitializeHandlerOptions, InitializeMiddleware } from "@aws-sdk/types";
1
+ import { InitializeHandlerOptions, InitializeMiddleware } from "@smithy/types";
2
2
  import { S3ControlResolvedConfig } from "../configurations";
3
3
  type ArnableInput = {
4
4
  Name?: string;
@@ -1,4 +1,4 @@
1
- import { BuildHandlerOptions, BuildMiddleware, Provider } from "@aws-sdk/types";
1
+ import { BuildHandlerOptions, BuildMiddleware, Provider } from "@smithy/types";
2
2
  export interface UpdateArnablesRequestMiddlewareConfig {
3
3
  isCustomEndpoint?: boolean;
4
4
  useFipsEndpoint: Provider<boolean>;
@@ -3,7 +3,7 @@ import {
3
3
  BuildMiddleware,
4
4
  Pluggable,
5
5
  Provider,
6
- } from "@aws-sdk/types";
6
+ } from "@smithy/types";
7
7
  import { S3ControlResolvedConfig } from "./configurations";
8
8
  type InputType = {
9
9
  OutpostId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-sdk-s3-control",
3
- "version": "3.357.0",
3
+ "version": "3.369.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",
@@ -21,14 +21,16 @@
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "@aws-sdk/middleware-bucket-endpoint": "3.357.0",
25
- "@aws-sdk/protocol-http": "3.357.0",
26
- "@aws-sdk/types": "3.357.0",
24
+ "@aws-sdk/middleware-bucket-endpoint": "3.369.0",
25
+ "@aws-sdk/types": "3.369.0",
27
26
  "@aws-sdk/util-arn-parser": "3.310.0",
27
+ "@aws-sdk/util-endpoints": "3.369.0",
28
+ "@smithy/protocol-http": "^1.1.0",
29
+ "@smithy/types": "^1.1.0",
28
30
  "tslib": "^2.5.0"
29
31
  },
30
32
  "devDependencies": {
31
- "@aws-sdk/middleware-stack": "3.357.0",
33
+ "@smithy/middleware-stack": "^1.0.1",
32
34
  "@tsconfig/recommended": "1.0.1",
33
35
  "concurrently": "7.0.0",
34
36
  "downlevel-dts": "0.10.1",