@aws-sdk/middleware-signing 3.709.0 → 3.713.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/README.md CHANGED
@@ -2,3 +2,6 @@
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-signing/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-signing)
4
4
  [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-signing.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-signing)
5
+
6
+ This package is deprecated. It is only used in "legacy auth", and no longer used in the
7
+ AWS SDK as of the Smithy Reference Architecture implementation of identity and auth.
package/dist-cjs/index.js CHANGED
@@ -36,11 +36,7 @@ var import_signature_v4 = require("@smithy/signature-v4");
36
36
  var import_util_middleware = require("@smithy/util-middleware");
37
37
  var CREDENTIAL_EXPIRE_WINDOW = 3e5;
38
38
  var resolveAwsAuthConfig = /* @__PURE__ */ __name((input) => {
39
- const normalizedCreds = input.credentials ? normalizeCredentialProvider(input.credentials) : input.credentialDefaultProvider(
40
- Object.assign({}, input, {
41
- parentClientConfig: input
42
- })
43
- );
39
+ const normalizedCreds = createConfigBoundCredentialProvider(input);
44
40
  const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input;
45
41
  let signer;
46
42
  if (input.signer) {
@@ -113,11 +109,7 @@ var resolveAwsAuthConfig = /* @__PURE__ */ __name((input) => {
113
109
  };
114
110
  }, "resolveAwsAuthConfig");
115
111
  var resolveSigV4AuthConfig = /* @__PURE__ */ __name((input) => {
116
- const normalizedCreds = input.credentials ? normalizeCredentialProvider(input.credentials) : input.credentialDefaultProvider(
117
- Object.assign({}, input, {
118
- parentClientConfig: input
119
- })
120
- );
112
+ const normalizedCreds = createConfigBoundCredentialProvider(input);
121
113
  const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input;
122
114
  let signer;
123
115
  if (input.signer) {
@@ -151,6 +143,19 @@ var normalizeCredentialProvider = /* @__PURE__ */ __name((credentials) => {
151
143
  }
152
144
  return (0, import_util_middleware.normalizeProvider)(credentials);
153
145
  }, "normalizeCredentialProvider");
146
+ var createConfigBoundCredentialProvider = /* @__PURE__ */ __name((input) => {
147
+ const normalizedCredentialsProvider = input.credentials ? normalizeCredentialProvider(input.credentials) : input.credentialDefaultProvider(
148
+ Object.assign({}, input, {
149
+ parentClientConfig: input
150
+ })
151
+ );
152
+ const normalizedCreds = /* @__PURE__ */ __name(async () => normalizedCredentialsProvider({
153
+ callerClientConfig: {
154
+ region: (0, import_util_middleware.normalizeProvider)(input.region)
155
+ }
156
+ }), "normalizedCreds");
157
+ return normalizedCreds;
158
+ }, "createConfigBoundCredentialProvider");
154
159
 
155
160
  // src/awsAuthMiddleware.ts
156
161
  var import_protocol_http = require("@smithy/protocol-http");
@@ -3,11 +3,7 @@ import { SignatureV4 } from "@smithy/signature-v4";
3
3
  import { normalizeProvider } from "@smithy/util-middleware";
4
4
  const CREDENTIAL_EXPIRE_WINDOW = 300000;
5
5
  export const resolveAwsAuthConfig = (input) => {
6
- const normalizedCreds = input.credentials
7
- ? normalizeCredentialProvider(input.credentials)
8
- : input.credentialDefaultProvider(Object.assign({}, input, {
9
- parentClientConfig: input,
10
- }));
6
+ const normalizedCreds = createConfigBoundCredentialProvider(input);
11
7
  const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input;
12
8
  let signer;
13
9
  if (input.signer) {
@@ -79,11 +75,7 @@ export const resolveAwsAuthConfig = (input) => {
79
75
  };
80
76
  };
81
77
  export const resolveSigV4AuthConfig = (input) => {
82
- const normalizedCreds = input.credentials
83
- ? normalizeCredentialProvider(input.credentials)
84
- : input.credentialDefaultProvider(Object.assign({}, input, {
85
- parentClientConfig: input,
86
- }));
78
+ const normalizedCreds = createConfigBoundCredentialProvider(input);
87
79
  const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input;
88
80
  let signer;
89
81
  if (input.signer) {
@@ -113,3 +105,16 @@ const normalizeCredentialProvider = (credentials) => {
113
105
  }
114
106
  return normalizeProvider(credentials);
115
107
  };
108
+ const createConfigBoundCredentialProvider = (input) => {
109
+ const normalizedCredentialsProvider = input.credentials
110
+ ? normalizeCredentialProvider(input.credentials)
111
+ : input.credentialDefaultProvider(Object.assign({}, input, {
112
+ parentClientConfig: input,
113
+ }));
114
+ const normalizedCreds = async () => normalizedCredentialsProvider({
115
+ callerClientConfig: {
116
+ region: normalizeProvider(input.region),
117
+ },
118
+ });
119
+ return normalizedCreds;
120
+ };
@@ -2,6 +2,7 @@ import { SignatureV4CryptoInit, SignatureV4Init } from "@smithy/signature-v4";
2
2
  import { AuthScheme, AwsCredentialIdentity, ChecksumConstructor, HashConstructor, Logger, MemoizedProvider, Provider, RegionInfoProvider, RequestSigner } from "@smithy/types";
3
3
  /**
4
4
  * @public
5
+ * @deprecated only used in legacy auth.
5
6
  */
6
7
  export interface AwsAuthInputConfig {
7
8
  /**
@@ -35,6 +36,7 @@ export interface AwsAuthInputConfig {
35
36
  }
36
37
  /**
37
38
  * @public
39
+ * @deprecated only used in legacy auth.
38
40
  */
39
41
  export interface SigV4AuthInputConfig {
40
42
  /**
@@ -54,6 +56,10 @@ export interface SigV4AuthInputConfig {
54
56
  */
55
57
  systemClockOffset?: number;
56
58
  }
59
+ /**
60
+ * @internal
61
+ * @deprecated only used in legacy auth.
62
+ */
57
63
  interface PreviouslyResolved {
58
64
  credentialDefaultProvider: (input: any) => MemoizedProvider<AwsCredentialIdentity>;
59
65
  region: string | Provider<string>;
@@ -65,6 +71,10 @@ interface PreviouslyResolved {
65
71
  useFipsEndpoint: Provider<boolean>;
66
72
  useDualstackEndpoint: Provider<boolean>;
67
73
  }
74
+ /**
75
+ * @internal
76
+ * @deprecated only used in legacy auth.
77
+ */
68
78
  interface SigV4PreviouslyResolved {
69
79
  credentialDefaultProvider: (input: any) => MemoizedProvider<AwsCredentialIdentity>;
70
80
  region: string | Provider<string>;
@@ -72,6 +82,10 @@ interface SigV4PreviouslyResolved {
72
82
  sha256: ChecksumConstructor | HashConstructor;
73
83
  logger?: Logger;
74
84
  }
85
+ /**
86
+ * @internal
87
+ * @deprecated only used in legacy auth.
88
+ */
75
89
  export interface AwsAuthResolvedConfig {
76
90
  /**
77
91
  * Resolved value for input config {@link AwsAuthInputConfig.credentials}
@@ -92,8 +106,20 @@ export interface AwsAuthResolvedConfig {
92
106
  */
93
107
  systemClockOffset: number;
94
108
  }
109
+ /**
110
+ * @internal
111
+ * @deprecated only used in legacy auth.
112
+ */
95
113
  export interface SigV4AuthResolvedConfig extends AwsAuthResolvedConfig {
96
114
  }
115
+ /**
116
+ * @internal
117
+ * @deprecated only used in legacy auth.
118
+ */
97
119
  export declare const resolveAwsAuthConfig: <T>(input: T & AwsAuthInputConfig & PreviouslyResolved) => T & AwsAuthResolvedConfig;
120
+ /**
121
+ * @internal
122
+ * @deprecated only used in legacy auth.
123
+ */
98
124
  export declare const resolveSigV4AuthConfig: <T>(input: T & SigV4AuthInputConfig & SigV4PreviouslyResolved) => T & SigV4AuthResolvedConfig;
99
125
  export {};
@@ -1,6 +1,18 @@
1
1
  import { FinalizeRequestMiddleware, Pluggable, RelativeMiddlewareOptions } from "@smithy/types";
2
2
  import { AwsAuthResolvedConfig } from "./awsAuthConfiguration";
3
+ /**
4
+ * @deprecated only used in legacy auth.
5
+ */
3
6
  export declare const awsAuthMiddleware: <Input extends object, Output extends object>(options: AwsAuthResolvedConfig) => FinalizeRequestMiddleware<Input, Output>;
7
+ /**
8
+ * @deprecated only used in legacy auth.
9
+ */
4
10
  export declare const awsAuthMiddlewareOptions: RelativeMiddlewareOptions;
11
+ /**
12
+ * @deprecated only used in legacy auth.
13
+ */
5
14
  export declare const getAwsAuthPlugin: (options: AwsAuthResolvedConfig) => Pluggable<any, any>;
15
+ /**
16
+ * @deprecated only used in legacy auth.
17
+ */
6
18
  export declare const getSigV4AuthPlugin: (options: AwsAuthResolvedConfig) => Pluggable<any, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-signing",
3
- "version": "3.709.0",
3
+ "version": "3.713.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline middleware-signing",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/types": "3.709.0",
27
+ "@aws-sdk/types": "3.713.0",
28
28
  "@smithy/property-provider": "^3.1.11",
29
29
  "@smithy/protocol-http": "^4.1.8",
30
30
  "@smithy/signature-v4": "^4.2.4",