@smithy/core 3.24.3 → 3.24.5
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/cbor.d.ts +1 -3
- package/cbor.js +0 -1
- package/checksum.d.ts +2 -2
- package/checksum.js +1 -1
- package/client.d.ts +1 -3
- package/client.js +0 -1
- package/config.d.ts +2 -2
- package/config.js +1 -1
- package/dist-cjs/index.js +3 -4
- package/dist-cjs/submodules/client/index.js +3 -11
- package/dist-cjs/submodules/config/index.browser.js +2 -2
- package/dist-cjs/submodules/config/index.js +2 -2
- package/dist-cjs/submodules/config/index.native.js +2 -2
- package/dist-cjs/submodules/endpoints/index.browser.js +9 -40
- package/dist-cjs/submodules/endpoints/index.js +9 -40
- package/dist-cjs/submodules/protocols/index.js +12 -142
- package/dist-cjs/submodules/schema/index.js +7 -9
- package/dist-cjs/submodules/serde/index.browser.js +2 -2
- package/dist-cjs/submodules/serde/index.js +2 -2
- package/dist-cjs/submodules/serde/index.native.js +2 -2
- package/dist-cjs/submodules/transport/index.js +184 -0
- package/dist-es/index.js +6 -6
- package/dist-es/submodules/client/index.js +2 -2
- package/dist-es/submodules/config/config-resolver/regionConfig/checkRegion.js +1 -1
- package/dist-es/submodules/endpoints/index.browser.js +2 -2
- package/dist-es/submodules/endpoints/index.js +2 -2
- package/dist-es/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.js +1 -1
- package/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js +1 -1
- package/dist-es/submodules/endpoints/util-endpoints/lib/index.js +1 -1
- package/dist-es/submodules/protocols/HttpBindingProtocol.js +1 -1
- package/dist-es/submodules/protocols/HttpProtocol.js +1 -2
- package/dist-es/submodules/protocols/RpcProtocol.js +1 -1
- package/dist-es/submodules/protocols/index.js +5 -5
- package/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js +1 -1
- package/dist-es/submodules/protocols/requestBuilder.js +1 -1
- package/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js +3 -4
- package/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +1 -2
- package/dist-es/submodules/serde/middleware-serde/deserializerMiddleware.js +1 -1
- package/dist-es/submodules/transport/index.js +9 -0
- package/dist-es/submodules/{protocols/url-parser → transport}/parseUrl.js +1 -1
- package/dist-es/submodules/{endpoints → transport}/toEndpointV1.js +1 -1
- package/dist-types/index.d.ts +10 -6
- package/dist-types/submodules/client/index.d.ts +2 -2
- package/dist-types/submodules/endpoints/index.browser.d.ts +2 -2
- package/dist-types/submodules/endpoints/index.d.ts +2 -2
- package/dist-types/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.d.ts +2 -2
- package/dist-types/submodules/endpoints/util-endpoints/lib/index.d.ts +1 -1
- package/dist-types/submodules/protocols/HttpBindingProtocol.d.ts +1 -1
- package/dist-types/submodules/protocols/index.d.ts +5 -5
- package/dist-types/submodules/protocols/protocol-http/httpHandler.d.ts +1 -2
- package/dist-types/submodules/protocols/requestBuilder.d.ts +1 -1
- package/dist-types/submodules/transport/index.d.ts +9 -0
- package/endpoints.d.ts +1 -3
- package/endpoints.js +0 -1
- package/event-streams.d.ts +1 -3
- package/event-streams.js +0 -1
- package/package.json +19 -10
- package/protocols.d.ts +1 -3
- package/protocols.js +0 -1
- package/retry.d.ts +2 -2
- package/retry.js +1 -1
- package/schema.d.ts +1 -3
- package/schema.js +0 -1
- package/serde.d.ts +1 -3
- package/serde.js +0 -1
- package/transport.d.ts +5 -0
- package/transport.js +5 -0
- package/dist-cjs/getSmithyContext.js +0 -6
- package/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +0 -21
- package/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +0 -21
- package/dist-cjs/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +0 -46
- package/dist-cjs/middleware-http-auth-scheme/index.js +0 -6
- package/dist-cjs/middleware-http-auth-scheme/resolveAuthOptions.js +0 -24
- package/dist-cjs/middleware-http-signing/getHttpSigningMiddleware.js +0 -19
- package/dist-cjs/middleware-http-signing/httpSigningMiddleware.js +0 -27
- package/dist-cjs/middleware-http-signing/index.js +0 -5
- package/dist-cjs/normalizeProvider.js +0 -10
- package/dist-cjs/pagination/createPaginator.js +0 -44
- package/dist-cjs/request-builder/requestBuilder.js +0 -5
- package/dist-cjs/setFeature.js +0 -14
- package/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +0 -18
- package/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +0 -38
- package/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +0 -15
- package/dist-cjs/util-identity-and-auth/httpAuthSchemes/index.js +0 -6
- package/dist-cjs/util-identity-and-auth/httpAuthSchemes/noAuth.js +0 -9
- package/dist-cjs/util-identity-and-auth/index.js +0 -6
- package/dist-cjs/util-identity-and-auth/memoizeIdentityProvider.js +0 -61
- package/dist-es/request-builder/requestBuilder.js +0 -1
- package/dist-es/submodules/client/util-middleware/getSmithyContext.js +0 -2
- package/dist-es/submodules/event-streams/eventstream-codec/TestVectors.fixture.js +0 -146
- package/dist-es/submodules/event-streams/eventstream-codec/vectorTypes.fixture.js +0 -1
- package/dist-types/request-builder/requestBuilder.d.ts +0 -6
- package/dist-types/submodules/client/util-middleware/getSmithyContext.d.ts +0 -5
- package/dist-types/submodules/event-streams/eventstream-codec/TestVectors.fixture.d.ts +0 -2
- package/dist-types/submodules/event-streams/eventstream-codec/vectorTypes.fixture.d.ts +0 -12
- /package/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemeEndpointRuleSetPlugin.js +0 -0
- /package/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemePlugin.js +0 -0
- /package/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/httpAuthSchemeMiddleware.js +0 -0
- /package/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/index.js +0 -0
- /package/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/resolveAuthOptions.js +0 -0
- /package/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/getHttpSigningMiddleware.js +0 -0
- /package/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/httpSigningMiddleware.js +0 -0
- /package/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/index.js +0 -0
- /package/dist-es/{pagination → legacy-root-exports/pagination}/createPaginator.js +0 -0
- /package/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/DefaultIdentityProviderConfig.js +0 -0
- /package/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpApiKeyAuth.js +0 -0
- /package/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpBearerAuth.js +0 -0
- /package/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/index.js +0 -0
- /package/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/noAuth.js +0 -0
- /package/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/index.js +0 -0
- /package/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/memoizeIdentityProvider.js +0 -0
- /package/dist-es/{getSmithyContext.js → submodules/transport/getSmithyContext.js} +0 -0
- /package/dist-es/submodules/{protocols/protocol-http → transport}/httpRequest.js +0 -0
- /package/dist-es/submodules/{protocols/protocol-http → transport}/httpResponse.js +0 -0
- /package/dist-es/submodules/{endpoints/util-endpoints/lib → transport}/isValidHostLabel.js +0 -0
- /package/dist-es/submodules/{protocols/protocol-http → transport}/isValidHostname.js +0 -0
- /package/dist-es/submodules/{client/util-middleware → transport}/normalizeProvider.js +0 -0
- /package/dist-es/submodules/{protocols/querystring-parser → transport}/parseQueryString.js +0 -0
- /package/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts +0 -0
- /package/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemePlugin.d.ts +0 -0
- /package/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/httpAuthSchemeMiddleware.d.ts +0 -0
- /package/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/index.d.ts +0 -0
- /package/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/resolveAuthOptions.d.ts +0 -0
- /package/dist-types/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/getHttpSigningMiddleware.d.ts +0 -0
- /package/dist-types/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/httpSigningMiddleware.d.ts +0 -0
- /package/dist-types/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/index.d.ts +0 -0
- /package/dist-types/{pagination → legacy-root-exports/pagination}/createPaginator.d.ts +0 -0
- /package/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/DefaultIdentityProviderConfig.d.ts +0 -0
- /package/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpApiKeyAuth.d.ts +0 -0
- /package/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpBearerAuth.d.ts +0 -0
- /package/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/index.d.ts +0 -0
- /package/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/noAuth.d.ts +0 -0
- /package/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/index.d.ts +0 -0
- /package/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/memoizeIdentityProvider.d.ts +0 -0
- /package/dist-types/{getSmithyContext.d.ts → submodules/transport/getSmithyContext.d.ts} +0 -0
- /package/dist-types/submodules/{protocols/protocol-http → transport}/httpRequest.d.ts +0 -0
- /package/dist-types/submodules/{protocols/protocol-http → transport}/httpResponse.d.ts +0 -0
- /package/dist-types/submodules/{endpoints/util-endpoints/lib → transport}/isValidHostLabel.d.ts +0 -0
- /package/dist-types/submodules/{protocols/protocol-http → transport}/isValidHostname.d.ts +0 -0
- /package/dist-types/submodules/{client/util-middleware → transport}/normalizeProvider.d.ts +0 -0
- /package/dist-types/submodules/{protocols/querystring-parser → transport}/parseQueryString.d.ts +0 -0
- /package/dist-types/submodules/{protocols/url-parser → transport}/parseUrl.d.ts +0 -0
- /package/dist-types/submodules/{endpoints → transport}/toEndpointV1.d.ts +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { getSmithyContext } from "./getSmithyContext";
|
|
2
|
+
export { HttpRequest, IHttpRequest } from "./httpRequest";
|
|
3
|
+
export { HttpResponse } from "./httpResponse";
|
|
4
|
+
export { isValidHostLabel } from "./isValidHostLabel";
|
|
5
|
+
export { isValidHostname } from "./isValidHostname";
|
|
6
|
+
export { normalizeProvider } from "./normalizeProvider";
|
|
7
|
+
export { parseQueryString } from "./parseQueryString";
|
|
8
|
+
export { parseUrl } from "./parseUrl";
|
|
9
|
+
export { toEndpointV1 } from "./toEndpointV1";
|
package/endpoints.d.ts
CHANGED
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
* Do not edit:
|
|
3
3
|
* This is a compatibility redirect for contexts that do not understand package.json exports field.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
export * from "@smithy/core/dist-types/submodules/endpoints/index.d";
|
|
7
|
-
}
|
|
5
|
+
export * from "./dist-types/submodules/endpoints/index";
|
package/endpoints.js
CHANGED
package/event-streams.d.ts
CHANGED
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
* Do not edit:
|
|
3
3
|
* This is a compatibility redirect for contexts that do not understand package.json exports field.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
export * from "@smithy/core/dist-types/submodules/event-streams/index.d";
|
|
7
|
-
}
|
|
5
|
+
export * from "./dist-types/submodules/event-streams/index";
|
package/event-streams.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "3.24.
|
|
3
|
+
"version": "3.24.5",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
|
|
6
6
|
"build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline core",
|
|
@@ -151,6 +151,13 @@
|
|
|
151
151
|
"node": "./dist-cjs/submodules/retry/index.js",
|
|
152
152
|
"import": "./dist-es/submodules/retry/index.js",
|
|
153
153
|
"require": "./dist-cjs/submodules/retry/index.js"
|
|
154
|
+
},
|
|
155
|
+
"./transport": {
|
|
156
|
+
"types": "./dist-types/submodules/transport/index.d.ts",
|
|
157
|
+
"module": "./dist-es/submodules/transport/index.js",
|
|
158
|
+
"node": "./dist-cjs/submodules/transport/index.js",
|
|
159
|
+
"import": "./dist-es/submodules/transport/index.js",
|
|
160
|
+
"require": "./dist-cjs/submodules/transport/index.js"
|
|
154
161
|
}
|
|
155
162
|
},
|
|
156
163
|
"author": {
|
|
@@ -178,25 +185,27 @@
|
|
|
178
185
|
"files": [
|
|
179
186
|
"./cbor.d.ts",
|
|
180
187
|
"./cbor.js",
|
|
188
|
+
"./checksum.d.ts",
|
|
189
|
+
"./checksum.js",
|
|
190
|
+
"./client.d.ts",
|
|
191
|
+
"./client.js",
|
|
192
|
+
"./config.d.ts",
|
|
193
|
+
"./config.js",
|
|
181
194
|
"./endpoints.d.ts",
|
|
182
195
|
"./endpoints.js",
|
|
183
196
|
"./event-streams.d.ts",
|
|
184
197
|
"./event-streams.js",
|
|
185
198
|
"./protocols.d.ts",
|
|
186
199
|
"./protocols.js",
|
|
200
|
+
"./retry.d.ts",
|
|
201
|
+
"./retry.js",
|
|
187
202
|
"./schema.d.ts",
|
|
188
203
|
"./schema.js",
|
|
189
204
|
"./serde.d.ts",
|
|
190
205
|
"./serde.js",
|
|
191
|
-
"
|
|
192
|
-
"./
|
|
193
|
-
"
|
|
194
|
-
"./config.d.ts",
|
|
195
|
-
"./config.js",
|
|
196
|
-
"./checksum.d.ts",
|
|
197
|
-
"./checksum.js",
|
|
198
|
-
"./retry.d.ts",
|
|
199
|
-
"./retry.js"
|
|
206
|
+
"./transport.d.ts",
|
|
207
|
+
"./transport.js",
|
|
208
|
+
"dist-*/**"
|
|
200
209
|
],
|
|
201
210
|
"homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
|
|
202
211
|
"repository": {
|
package/protocols.d.ts
CHANGED
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
* Do not edit:
|
|
3
3
|
* This is a compatibility redirect for contexts that do not understand package.json exports field.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
export * from "@smithy/core/dist-types/submodules/protocols/index.d";
|
|
7
|
-
}
|
|
5
|
+
export * from "./dist-types/submodules/protocols/index";
|
package/protocols.js
CHANGED
package/retry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit:
|
|
3
|
-
* This is a compatibility redirect for
|
|
3
|
+
* This is a compatibility redirect for contexts that do not understand package.json exports field.
|
|
4
4
|
*/
|
|
5
|
-
export * from "./dist-types/submodules/retry/index
|
|
5
|
+
export * from "./dist-types/submodules/retry/index";
|
package/retry.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit:
|
|
3
|
-
* This is a compatibility redirect for
|
|
3
|
+
* This is a compatibility redirect for contexts that do not understand package.json exports field.
|
|
4
4
|
*/
|
|
5
5
|
module.exports = require("./dist-cjs/submodules/retry/index.js");
|
package/schema.d.ts
CHANGED
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
* Do not edit:
|
|
3
3
|
* This is a compatibility redirect for contexts that do not understand package.json exports field.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
export * from "@smithy/core/dist-types/submodules/schema/index.d";
|
|
7
|
-
}
|
|
5
|
+
export * from "./dist-types/submodules/schema/index";
|
package/schema.js
CHANGED
package/serde.d.ts
CHANGED
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
* Do not edit:
|
|
3
3
|
* This is a compatibility redirect for contexts that do not understand package.json exports field.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
export * from "@smithy/core/dist-types/submodules/serde/index.d";
|
|
7
|
-
}
|
|
5
|
+
export * from "./dist-types/submodules/serde/index";
|
package/serde.js
CHANGED
package/transport.d.ts
ADDED
package/transport.js
ADDED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSmithyContext = void 0;
|
|
4
|
-
const types_1 = require("@smithy/types");
|
|
5
|
-
const getSmithyContext = (context) => context[types_1.SMITHY_CONTEXT_KEY] || (context[types_1.SMITHY_CONTEXT_KEY] = {});
|
|
6
|
-
exports.getSmithyContext = getSmithyContext;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHttpAuthSchemeEndpointRuleSetPlugin = exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = void 0;
|
|
4
|
-
const httpAuthSchemeMiddleware_1 = require("./httpAuthSchemeMiddleware");
|
|
5
|
-
exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
|
|
6
|
-
step: "serialize",
|
|
7
|
-
tags: ["HTTP_AUTH_SCHEME"],
|
|
8
|
-
name: "httpAuthSchemeMiddleware",
|
|
9
|
-
override: true,
|
|
10
|
-
relation: "before",
|
|
11
|
-
toMiddleware: "endpointV2Middleware",
|
|
12
|
-
};
|
|
13
|
-
const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
|
14
|
-
applyToStack: (clientStack) => {
|
|
15
|
-
clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config, {
|
|
16
|
-
httpAuthSchemeParametersProvider,
|
|
17
|
-
identityProviderConfigProvider,
|
|
18
|
-
}), exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions);
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
exports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHttpAuthSchemePlugin = exports.httpAuthSchemeMiddlewareOptions = void 0;
|
|
4
|
-
const httpAuthSchemeMiddleware_1 = require("./httpAuthSchemeMiddleware");
|
|
5
|
-
exports.httpAuthSchemeMiddlewareOptions = {
|
|
6
|
-
step: "serialize",
|
|
7
|
-
tags: ["HTTP_AUTH_SCHEME"],
|
|
8
|
-
name: "httpAuthSchemeMiddleware",
|
|
9
|
-
override: true,
|
|
10
|
-
relation: "before",
|
|
11
|
-
toMiddleware: "serializerMiddleware",
|
|
12
|
-
};
|
|
13
|
-
const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
|
14
|
-
applyToStack: (clientStack) => {
|
|
15
|
-
clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config, {
|
|
16
|
-
httpAuthSchemeParametersProvider,
|
|
17
|
-
identityProviderConfigProvider,
|
|
18
|
-
}), exports.httpAuthSchemeMiddlewareOptions);
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
exports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.httpAuthSchemeMiddleware = void 0;
|
|
4
|
-
const client_1 = require("@smithy/core/client");
|
|
5
|
-
const resolveAuthOptions_1 = require("./resolveAuthOptions");
|
|
6
|
-
function convertHttpAuthSchemesToMap(httpAuthSchemes) {
|
|
7
|
-
const map = new Map();
|
|
8
|
-
for (const scheme of httpAuthSchemes) {
|
|
9
|
-
map.set(scheme.schemeId, scheme);
|
|
10
|
-
}
|
|
11
|
-
return map;
|
|
12
|
-
}
|
|
13
|
-
const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
|
|
14
|
-
const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
|
|
15
|
-
const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
|
|
16
|
-
const resolvedOptions = (0, resolveAuthOptions_1.resolveAuthOptions)(options, authSchemePreference);
|
|
17
|
-
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
|
|
18
|
-
const smithyContext = (0, client_1.getSmithyContext)(context);
|
|
19
|
-
const failureReasons = [];
|
|
20
|
-
for (const option of resolvedOptions) {
|
|
21
|
-
const scheme = authSchemes.get(option.schemeId);
|
|
22
|
-
if (!scheme) {
|
|
23
|
-
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
|
|
27
|
-
if (!identityProvider) {
|
|
28
|
-
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
|
|
32
|
-
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
|
|
33
|
-
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
|
|
34
|
-
smithyContext.selectedHttpAuthScheme = {
|
|
35
|
-
httpAuthOption: option,
|
|
36
|
-
identity: await identityProvider(option.identityProperties),
|
|
37
|
-
signer: scheme.signer,
|
|
38
|
-
};
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
if (!smithyContext.selectedHttpAuthScheme) {
|
|
42
|
-
throw new Error(failureReasons.join("\n"));
|
|
43
|
-
}
|
|
44
|
-
return next(args);
|
|
45
|
-
};
|
|
46
|
-
exports.httpAuthSchemeMiddleware = httpAuthSchemeMiddleware;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./httpAuthSchemeMiddleware"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./getHttpAuthSchemeEndpointRuleSetPlugin"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./getHttpAuthSchemePlugin"), exports);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveAuthOptions = void 0;
|
|
4
|
-
const resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
|
|
5
|
-
if (!authSchemePreference || authSchemePreference.length === 0) {
|
|
6
|
-
return candidateAuthOptions;
|
|
7
|
-
}
|
|
8
|
-
const preferredAuthOptions = [];
|
|
9
|
-
for (const preferredSchemeName of authSchemePreference) {
|
|
10
|
-
for (const candidateAuthOption of candidateAuthOptions) {
|
|
11
|
-
const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
|
|
12
|
-
if (candidateAuthSchemeName === preferredSchemeName) {
|
|
13
|
-
preferredAuthOptions.push(candidateAuthOption);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
for (const candidateAuthOption of candidateAuthOptions) {
|
|
18
|
-
if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
|
|
19
|
-
preferredAuthOptions.push(candidateAuthOption);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return preferredAuthOptions;
|
|
23
|
-
};
|
|
24
|
-
exports.resolveAuthOptions = resolveAuthOptions;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHttpSigningPlugin = exports.httpSigningMiddlewareOptions = void 0;
|
|
4
|
-
const httpSigningMiddleware_1 = require("./httpSigningMiddleware");
|
|
5
|
-
exports.httpSigningMiddlewareOptions = {
|
|
6
|
-
step: "finalizeRequest",
|
|
7
|
-
tags: ["HTTP_SIGNING"],
|
|
8
|
-
name: "httpSigningMiddleware",
|
|
9
|
-
aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
|
|
10
|
-
override: true,
|
|
11
|
-
relation: "after",
|
|
12
|
-
toMiddleware: "retryMiddleware",
|
|
13
|
-
};
|
|
14
|
-
const getHttpSigningPlugin = (config) => ({
|
|
15
|
-
applyToStack: (clientStack) => {
|
|
16
|
-
clientStack.addRelativeTo((0, httpSigningMiddleware_1.httpSigningMiddleware)(config), exports.httpSigningMiddlewareOptions);
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
exports.getHttpSigningPlugin = getHttpSigningPlugin;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.httpSigningMiddleware = void 0;
|
|
4
|
-
const client_1 = require("@smithy/core/client");
|
|
5
|
-
const protocols_1 = require("@smithy/core/protocols");
|
|
6
|
-
const defaultErrorHandler = (signingProperties) => (error) => {
|
|
7
|
-
throw error;
|
|
8
|
-
};
|
|
9
|
-
const defaultSuccessHandler = (httpResponse, signingProperties) => { };
|
|
10
|
-
const httpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
11
|
-
if (!protocols_1.HttpRequest.isInstance(args.request)) {
|
|
12
|
-
return next(args);
|
|
13
|
-
}
|
|
14
|
-
const smithyContext = (0, client_1.getSmithyContext)(context);
|
|
15
|
-
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
16
|
-
if (!scheme) {
|
|
17
|
-
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
18
|
-
}
|
|
19
|
-
const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;
|
|
20
|
-
const output = await next({
|
|
21
|
-
...args,
|
|
22
|
-
request: await signer.sign(args.request, identity, signingProperties),
|
|
23
|
-
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
|
24
|
-
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
|
25
|
-
return output;
|
|
26
|
-
};
|
|
27
|
-
exports.httpSigningMiddleware = httpSigningMiddleware;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeProvider = void 0;
|
|
4
|
-
const normalizeProvider = (input) => {
|
|
5
|
-
if (typeof input === "function")
|
|
6
|
-
return input;
|
|
7
|
-
const promisified = Promise.resolve(input);
|
|
8
|
-
return () => promisified;
|
|
9
|
-
};
|
|
10
|
-
exports.normalizeProvider = normalizeProvider;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPaginator = createPaginator;
|
|
4
|
-
const makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => {
|
|
5
|
-
let command = new CommandCtor(input);
|
|
6
|
-
command = withCommand(command) ?? command;
|
|
7
|
-
return await client.send(command, ...args);
|
|
8
|
-
};
|
|
9
|
-
function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
|
|
10
|
-
return async function* paginateOperation(config, input, ...additionalArguments) {
|
|
11
|
-
const _input = input;
|
|
12
|
-
let token = config.startingToken ?? _input[inputTokenName];
|
|
13
|
-
let hasNext = true;
|
|
14
|
-
let page;
|
|
15
|
-
while (hasNext) {
|
|
16
|
-
_input[inputTokenName] = token;
|
|
17
|
-
if (pageSizeTokenName) {
|
|
18
|
-
_input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;
|
|
19
|
-
}
|
|
20
|
-
if (config.client instanceof ClientCtor) {
|
|
21
|
-
page = await makePagedClientRequest(CommandCtor, config.client, input, config.withCommand, ...additionalArguments);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
|
|
25
|
-
}
|
|
26
|
-
yield page;
|
|
27
|
-
const prevToken = token;
|
|
28
|
-
token = get(page, outputTokenName);
|
|
29
|
-
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
30
|
-
}
|
|
31
|
-
return undefined;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const get = (fromObject, path) => {
|
|
35
|
-
let cursor = fromObject;
|
|
36
|
-
const pathComponents = path.split(".");
|
|
37
|
-
for (const step of pathComponents) {
|
|
38
|
-
if (!cursor || typeof cursor !== "object") {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
cursor = cursor[step];
|
|
42
|
-
}
|
|
43
|
-
return cursor;
|
|
44
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.requestBuilder = void 0;
|
|
4
|
-
var protocols_1 = require("@smithy/core/protocols");
|
|
5
|
-
Object.defineProperty(exports, "requestBuilder", { enumerable: true, get: function () { return protocols_1.requestBuilder; } });
|
package/dist-cjs/setFeature.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setFeature = setFeature;
|
|
4
|
-
function setFeature(context, feature, value) {
|
|
5
|
-
if (!context.__smithy_context) {
|
|
6
|
-
context.__smithy_context = {
|
|
7
|
-
features: {},
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
else if (!context.__smithy_context.features) {
|
|
11
|
-
context.__smithy_context.features = {};
|
|
12
|
-
}
|
|
13
|
-
context.__smithy_context.features[feature] = value;
|
|
14
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultIdentityProviderConfig = void 0;
|
|
4
|
-
class DefaultIdentityProviderConfig {
|
|
5
|
-
authSchemes = new Map();
|
|
6
|
-
constructor(config) {
|
|
7
|
-
for (const key in config) {
|
|
8
|
-
const value = config[key];
|
|
9
|
-
if (value !== undefined) {
|
|
10
|
-
this.authSchemes.set(key, value);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
getIdentityProvider(schemeId) {
|
|
15
|
-
return this.authSchemes.get(schemeId);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpApiKeyAuthSigner = void 0;
|
|
4
|
-
const protocols_1 = require("@smithy/core/protocols");
|
|
5
|
-
const types_1 = require("@smithy/types");
|
|
6
|
-
class HttpApiKeyAuthSigner {
|
|
7
|
-
async sign(httpRequest, identity, signingProperties) {
|
|
8
|
-
if (!signingProperties) {
|
|
9
|
-
throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");
|
|
10
|
-
}
|
|
11
|
-
if (!signingProperties.name) {
|
|
12
|
-
throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");
|
|
13
|
-
}
|
|
14
|
-
if (!signingProperties.in) {
|
|
15
|
-
throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");
|
|
16
|
-
}
|
|
17
|
-
if (!identity.apiKey) {
|
|
18
|
-
throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");
|
|
19
|
-
}
|
|
20
|
-
const clonedRequest = protocols_1.HttpRequest.clone(httpRequest);
|
|
21
|
-
if (signingProperties.in === types_1.HttpApiKeyAuthLocation.QUERY) {
|
|
22
|
-
clonedRequest.query[signingProperties.name] = identity.apiKey;
|
|
23
|
-
}
|
|
24
|
-
else if (signingProperties.in === types_1.HttpApiKeyAuthLocation.HEADER) {
|
|
25
|
-
clonedRequest.headers[signingProperties.name] = signingProperties.scheme
|
|
26
|
-
? `${signingProperties.scheme} ${identity.apiKey}`
|
|
27
|
-
: identity.apiKey;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " +
|
|
31
|
-
"but found: `" +
|
|
32
|
-
signingProperties.in +
|
|
33
|
-
"`");
|
|
34
|
-
}
|
|
35
|
-
return clonedRequest;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpBearerAuthSigner = void 0;
|
|
4
|
-
const protocols_1 = require("@smithy/core/protocols");
|
|
5
|
-
class HttpBearerAuthSigner {
|
|
6
|
-
async sign(httpRequest, identity, signingProperties) {
|
|
7
|
-
const clonedRequest = protocols_1.HttpRequest.clone(httpRequest);
|
|
8
|
-
if (!identity.token) {
|
|
9
|
-
throw new Error("request could not be signed with `token` since the `token` is not defined");
|
|
10
|
-
}
|
|
11
|
-
clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`;
|
|
12
|
-
return clonedRequest;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.HttpBearerAuthSigner = HttpBearerAuthSigner;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./httpApiKeyAuth"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./httpBearerAuth"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./noAuth"), exports);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./DefaultIdentityProviderConfig"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./httpAuthSchemes"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./memoizeIdentityProvider"), exports);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.memoizeIdentityProvider = exports.doesIdentityRequireRefresh = exports.isIdentityExpired = exports.EXPIRATION_MS = exports.createIsIdentityExpiredFunction = void 0;
|
|
4
|
-
const createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired(identity) {
|
|
5
|
-
return (0, exports.doesIdentityRequireRefresh)(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
|
|
6
|
-
};
|
|
7
|
-
exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction;
|
|
8
|
-
exports.EXPIRATION_MS = 300_000;
|
|
9
|
-
exports.isIdentityExpired = (0, exports.createIsIdentityExpiredFunction)(exports.EXPIRATION_MS);
|
|
10
|
-
const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined;
|
|
11
|
-
exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh;
|
|
12
|
-
const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
|
13
|
-
if (provider === undefined) {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
|
|
17
|
-
let resolved;
|
|
18
|
-
let pending;
|
|
19
|
-
let hasResult;
|
|
20
|
-
let isConstant = false;
|
|
21
|
-
const coalesceProvider = async (options) => {
|
|
22
|
-
if (!pending) {
|
|
23
|
-
pending = normalizedProvider(options);
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
resolved = await pending;
|
|
27
|
-
hasResult = true;
|
|
28
|
-
isConstant = false;
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
pending = undefined;
|
|
32
|
-
}
|
|
33
|
-
return resolved;
|
|
34
|
-
};
|
|
35
|
-
if (isExpired === undefined) {
|
|
36
|
-
return async (options) => {
|
|
37
|
-
if (!hasResult || options?.forceRefresh) {
|
|
38
|
-
resolved = await coalesceProvider(options);
|
|
39
|
-
}
|
|
40
|
-
return resolved;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return async (options) => {
|
|
44
|
-
if (!hasResult || options?.forceRefresh) {
|
|
45
|
-
resolved = await coalesceProvider(options);
|
|
46
|
-
}
|
|
47
|
-
if (isConstant) {
|
|
48
|
-
return resolved;
|
|
49
|
-
}
|
|
50
|
-
if (!requiresRefresh(resolved)) {
|
|
51
|
-
isConstant = true;
|
|
52
|
-
return resolved;
|
|
53
|
-
}
|
|
54
|
-
if (isExpired(resolved)) {
|
|
55
|
-
await coalesceProvider(options);
|
|
56
|
-
return resolved;
|
|
57
|
-
}
|
|
58
|
-
return resolved;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
exports.memoizeIdentityProvider = memoizeIdentityProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { requestBuilder } from "@smithy/core/protocols";
|