@cdk8s/awscdk-resolver 0.0.42 → 0.0.44
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/.jsii +3 -3
- package/lib/fetch-output-value.js +1 -1
- package/lib/resolve.js +2 -2
- package/node_modules/@aws-sdk/client-cloudformation/package.json +4 -4
- package/node_modules/@aws-sdk/client-sso/package.json +2 -2
- package/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js +17 -3
- package/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js +67 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-cjs/commands/DecodeAuthorizationMessageCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetAccessKeyInfoCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetCallerIdentityCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetFederationTokenCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetSessionTokenCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js +14 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js +16 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js +3 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js +17 -3
- package/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthSchemeProvider.js +60 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js +0 -2
- package/node_modules/@aws-sdk/client-sts/dist-es/index.js +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js +15 -1
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js +16 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeExtensions.js +3 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts +13 -11
- package/node_modules/@aws-sdk/client-sts/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/auth/httpAuthSchemeProvider.d.ts +71 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/extensionConfiguration.d.ts +2 -1
- package/node_modules/@aws-sdk/client-sts/dist-types/index.d.ts +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts +15 -5
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts +13 -5
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts +16 -6
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.shared.d.ts +15 -2
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STSClient.d.ts +11 -9
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +54 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/index.d.ts +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts +36 -9
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts +27 -9
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts +39 -12
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.shared.d.ts +36 -4
- package/node_modules/@aws-sdk/client-sts/package.json +5 -5
- package/node_modules/@aws-sdk/core/CHANGELOG.md +22 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws-sdk/AWSSDKSigV4Signer.js +55 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws-sdk/index.js +5 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws-sdk/resolveAWSSDKSigV4Config.js +81 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/aws-sdk/throwAWSSDKSigningPropertyError.js +10 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/index.js +4 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getDateHeader.js +6 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getSkewCorrectedDate.js +5 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +12 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/index.js +6 -0
- package/node_modules/@aws-sdk/core/dist-cjs/httpAuthSchemes/utils/isClockSkewed.js +6 -0
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/aws-sdk/AWSSDKSigV4Signer.js +49 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/aws-sdk/index.js +2 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/aws-sdk/resolveAWSSDKSigV4Config.js +77 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/aws-sdk/throwAWSSDKSigningPropertyError.js +6 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/utils/getDateHeader.js +2 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/utils/getSkewCorrectedDate.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +8 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/utils/index.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/utils/isClockSkewed.js +2 -0
- package/node_modules/@aws-sdk/core/dist-es/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/aws-sdk/AWSSDKSigV4Signer.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/aws-sdk/index.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/aws-sdk/resolveAWSSDKSigV4Config.d.ts +76 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/aws-sdk/throwAWSSDKSigningPropertyError.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/utils/getDateHeader.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +8 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +10 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/utils/index.d.ts +3 -0
- package/node_modules/@aws-sdk/core/dist-types/httpAuthSchemes/utils/isClockSkewed.d.ts +9 -0
- package/node_modules/@aws-sdk/core/dist-types/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/aws-sdk/AWSSDKSigV4Signer.d.ts +20 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/aws-sdk/index.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/aws-sdk/resolveAWSSDKSigV4Config.d.ts +46 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/aws-sdk/throwAWSSDKSigningPropertyError.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/utils/getDateHeader.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/utils/index.d.ts +3 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/httpAuthSchemes/utils/isClockSkewed.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +6 -2
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws-sdk/AWSSDKSigV4Signer.ts +118 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws-sdk/index.ts +2 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws-sdk/resolveAWSSDKSigV4Config.ts +216 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws-sdk/throwAWSSDKSigningPropertyError.ts +9 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/index.ts +1 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getDateHeader.ts +7 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getSkewCorrectedDate.spec.ts +17 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getSkewCorrectedDate.ts +8 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getUpdatedSystemClockOffset.spec.ts +37 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getUpdatedSystemClockOffset.ts +18 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/index.ts +3 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/isClockSkewed.spec.ts +32 -0
- package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/isClockSkewed.ts +12 -0
- package/node_modules/@aws-sdk/core/src/index.ts +1 -0
- package/node_modules/@aws-sdk/core/tsconfig.cjs.tsbuildinfo +1 -1
- package/node_modules/@aws-sdk/core/tsconfig.es.tsbuildinfo +1 -1
- package/node_modules/@aws-sdk/core/tsconfig.types.tsbuildinfo +1 -1
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-node/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +2 -2
- package/node_modules/{@aws-sdk/middleware-sdk-sts → @smithy/core}/LICENSE +1 -1
- package/node_modules/@smithy/core/README.md +12 -0
- package/node_modules/@smithy/core/dist-cjs/getSmithyContext.js +6 -0
- package/node_modules/@smithy/core/dist-cjs/index.js +12 -0
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +22 -0
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +22 -0
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +45 -0
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/index.js +6 -0
- package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/getHttpSigningMiddleware.js +20 -0
- package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/httpSigningMiddleware.js +28 -0
- package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/index.js +5 -0
- package/node_modules/@smithy/core/dist-cjs/normalizeProvider.js +10 -0
- package/node_modules/@smithy/core/dist-cjs/pagination/createPaginator.js +32 -0
- package/node_modules/@smithy/core/dist-cjs/protocols/requestBuilder.js +72 -0
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +17 -0
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +37 -0
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +14 -0
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/index.js +6 -0
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/noAuth.js +9 -0
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/index.js +6 -0
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/memoizeIdentityProvider.js +59 -0
- package/node_modules/@smithy/core/dist-es/getSmithyContext.js +2 -0
- package/node_modules/@smithy/core/dist-es/index.js +7 -0
- package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +18 -0
- package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +18 -0
- package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +40 -0
- package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js +3 -0
- package/node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js +16 -0
- package/node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js +24 -0
- package/node_modules/@smithy/core/dist-es/middleware-http-signing/index.js +2 -0
- package/node_modules/@smithy/core/dist-es/normalizeProvider.js +6 -0
- package/node_modules/@smithy/core/dist-es/pagination/createPaginator.js +27 -0
- package/node_modules/@smithy/core/dist-es/protocols/requestBuilder.js +67 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +13 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +33 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +10 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js +3 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js +5 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js +3 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js +53 -0
- package/node_modules/@smithy/core/dist-types/getSmithyContext.d.ts +5 -0
- package/node_modules/@smithy/core/dist-types/index.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/middleware-http-auth-scheme/getHttpAuthSchemePlugin.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/middleware-http-auth-scheme/httpAuthSchemeMiddleware.d.ts +32 -0
- package/node_modules/@smithy/core/dist-types/middleware-http-auth-scheme/index.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/middleware-http-signing/getHttpSigningMiddleware.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/middleware-http-signing/httpSigningMiddleware.d.ts +5 -0
- package/node_modules/@smithy/core/dist-types/middleware-http-signing/index.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/normalizeProvider.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/pagination/createPaginator.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/protocols/requestBuilder.d.ts +51 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/getSmithyContext.d.ts +5 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/index.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/middleware-http-auth-scheme/getHttpAuthSchemePlugin.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/middleware-http-auth-scheme/httpAuthSchemeMiddleware.d.ts +32 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/middleware-http-auth-scheme/index.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/middleware-http-signing/getHttpSigningMiddleware.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/middleware-http-signing/httpSigningMiddleware.d.ts +5 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/middleware-http-signing/index.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/normalizeProvider.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/pagination/createPaginator.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/protocols/requestBuilder.d.ts +51 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/util-identity-and-auth/DefaultIdentityProviderConfig.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/util-identity-and-auth/httpAuthSchemes/index.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/util-identity-and-auth/httpAuthSchemes/noAuth.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/util-identity-and-auth/index.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/util-identity-and-auth/memoizeIdentityProvider.d.ts +30 -0
- package/node_modules/@smithy/core/dist-types/util-identity-and-auth/DefaultIdentityProviderConfig.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/util-identity-and-auth/httpAuthSchemes/index.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/util-identity-and-auth/httpAuthSchemes/noAuth.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/util-identity-and-auth/index.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/util-identity-and-auth/memoizeIdentityProvider.d.ts +30 -0
- package/node_modules/@smithy/core/package.json +67 -0
- package/node_modules/@smithy/signature-v4/README.md +1 -1
- package/node_modules/@smithy/signature-v4/package.json +1 -1
- package/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-sdk-sts/README.md +0 -4
- package/node_modules/@aws-sdk/middleware-sdk-sts/dist-cjs/index.js +0 -9
- package/node_modules/@aws-sdk/middleware-sdk-sts/dist-es/index.js +0 -5
- package/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/index.d.ts +0 -37
- package/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/ts3.4/index.d.ts +0 -34
- package/node_modules/@aws-sdk/middleware-sdk-sts/package.json +0 -55
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createPaginator = void 0;
|
4
|
+
const makePagedClientRequest = async (CommandCtor, client, input, ...args) => {
|
5
|
+
return await client.send(new CommandCtor(input), ...args);
|
6
|
+
};
|
7
|
+
function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
|
8
|
+
return async function* paginateOperation(config, input, ...additionalArguments) {
|
9
|
+
var _a;
|
10
|
+
let token = config.startingToken || undefined;
|
11
|
+
let hasNext = true;
|
12
|
+
let page;
|
13
|
+
while (hasNext) {
|
14
|
+
input[inputTokenName] = token;
|
15
|
+
if (pageSizeTokenName) {
|
16
|
+
input[pageSizeTokenName] = (_a = input[pageSizeTokenName]) !== null && _a !== void 0 ? _a : config.pageSize;
|
17
|
+
}
|
18
|
+
if (config.client instanceof ClientCtor) {
|
19
|
+
page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments);
|
20
|
+
}
|
21
|
+
else {
|
22
|
+
throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
|
23
|
+
}
|
24
|
+
yield page;
|
25
|
+
const prevToken = token;
|
26
|
+
token = page[outputTokenName];
|
27
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
28
|
+
}
|
29
|
+
return undefined;
|
30
|
+
};
|
31
|
+
}
|
32
|
+
exports.createPaginator = createPaginator;
|
@@ -0,0 +1,72 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.RequestBuilder = exports.requestBuilder = void 0;
|
4
|
+
const protocol_http_1 = require("@smithy/protocol-http");
|
5
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
6
|
+
function requestBuilder(input, context) {
|
7
|
+
return new RequestBuilder(input, context);
|
8
|
+
}
|
9
|
+
exports.requestBuilder = requestBuilder;
|
10
|
+
class RequestBuilder {
|
11
|
+
constructor(input, context) {
|
12
|
+
this.input = input;
|
13
|
+
this.context = context;
|
14
|
+
this.query = {};
|
15
|
+
this.method = "";
|
16
|
+
this.headers = {};
|
17
|
+
this.path = "";
|
18
|
+
this.body = null;
|
19
|
+
this.hostname = "";
|
20
|
+
this.resolvePathStack = [];
|
21
|
+
}
|
22
|
+
async build() {
|
23
|
+
const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
|
24
|
+
this.path = basePath;
|
25
|
+
for (const resolvePath of this.resolvePathStack) {
|
26
|
+
resolvePath(this.path);
|
27
|
+
}
|
28
|
+
return new protocol_http_1.HttpRequest({
|
29
|
+
protocol,
|
30
|
+
hostname: this.hostname || hostname,
|
31
|
+
port,
|
32
|
+
method: this.method,
|
33
|
+
path: this.path,
|
34
|
+
query: this.query,
|
35
|
+
body: this.body,
|
36
|
+
headers: this.headers,
|
37
|
+
});
|
38
|
+
}
|
39
|
+
hn(hostname) {
|
40
|
+
this.hostname = hostname;
|
41
|
+
return this;
|
42
|
+
}
|
43
|
+
bp(uriLabel) {
|
44
|
+
this.resolvePathStack.push((basePath) => {
|
45
|
+
this.path = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
|
46
|
+
});
|
47
|
+
return this;
|
48
|
+
}
|
49
|
+
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
50
|
+
this.resolvePathStack.push((path) => {
|
51
|
+
this.path = (0, smithy_client_1.resolvedPath)(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
52
|
+
});
|
53
|
+
return this;
|
54
|
+
}
|
55
|
+
h(headers) {
|
56
|
+
this.headers = headers;
|
57
|
+
return this;
|
58
|
+
}
|
59
|
+
q(query) {
|
60
|
+
this.query = query;
|
61
|
+
return this;
|
62
|
+
}
|
63
|
+
b(body) {
|
64
|
+
this.body = body;
|
65
|
+
return this;
|
66
|
+
}
|
67
|
+
m(method) {
|
68
|
+
this.method = method;
|
69
|
+
return this;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
exports.RequestBuilder = RequestBuilder;
|
package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DefaultIdentityProviderConfig = void 0;
|
4
|
+
class DefaultIdentityProviderConfig {
|
5
|
+
constructor(config) {
|
6
|
+
this.authSchemes = new Map();
|
7
|
+
for (const [key, value] of Object.entries(config)) {
|
8
|
+
if (value !== undefined) {
|
9
|
+
this.authSchemes.set(key, value);
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
getIdentityProvider(schemeId) {
|
14
|
+
return this.authSchemes.get(schemeId);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig;
|
package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.HttpApiKeyAuthSigner = void 0;
|
4
|
+
const types_1 = require("@smithy/types");
|
5
|
+
class HttpApiKeyAuthSigner {
|
6
|
+
async sign(httpRequest, identity, signingProperties) {
|
7
|
+
if (!signingProperties) {
|
8
|
+
throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");
|
9
|
+
}
|
10
|
+
if (!signingProperties.name) {
|
11
|
+
throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");
|
12
|
+
}
|
13
|
+
if (!signingProperties.in) {
|
14
|
+
throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");
|
15
|
+
}
|
16
|
+
if (!identity.apiKey) {
|
17
|
+
throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");
|
18
|
+
}
|
19
|
+
const clonedRequest = httpRequest.clone();
|
20
|
+
if (signingProperties.in === types_1.HttpApiKeyAuthLocation.QUERY) {
|
21
|
+
clonedRequest.query[signingProperties.name] = identity.apiKey;
|
22
|
+
}
|
23
|
+
else if (signingProperties.in === types_1.HttpApiKeyAuthLocation.HEADER) {
|
24
|
+
clonedRequest.headers[signingProperties.name] = signingProperties.scheme
|
25
|
+
? `${signingProperties.scheme} ${identity.apiKey}`
|
26
|
+
: identity.apiKey;
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " +
|
30
|
+
"but found: `" +
|
31
|
+
signingProperties.in +
|
32
|
+
"`");
|
33
|
+
}
|
34
|
+
return clonedRequest;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner;
|
package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.HttpBearerAuthSigner = void 0;
|
4
|
+
class HttpBearerAuthSigner {
|
5
|
+
async sign(httpRequest, identity, signingProperties) {
|
6
|
+
const clonedRequest = httpRequest.clone();
|
7
|
+
if (!identity.token) {
|
8
|
+
throw new Error("request could not be signed with `token` since the `token` is not defined");
|
9
|
+
}
|
10
|
+
clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`;
|
11
|
+
return clonedRequest;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
exports.HttpBearerAuthSigner = HttpBearerAuthSigner;
|
@@ -0,0 +1,6 @@
|
|
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);
|
@@ -0,0 +1,6 @@
|
|
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);
|
@@ -0,0 +1,59 @@
|
|
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) => (identity) => (0, exports.doesIdentityRequireRefresh)(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
|
5
|
+
exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction;
|
6
|
+
exports.EXPIRATION_MS = 300000;
|
7
|
+
exports.isIdentityExpired = (0, exports.createIsIdentityExpiredFunction)(exports.EXPIRATION_MS);
|
8
|
+
const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined;
|
9
|
+
exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh;
|
10
|
+
const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
11
|
+
if (provider === undefined) {
|
12
|
+
return undefined;
|
13
|
+
}
|
14
|
+
const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
|
15
|
+
let resolved;
|
16
|
+
let pending;
|
17
|
+
let hasResult;
|
18
|
+
let isConstant = false;
|
19
|
+
const coalesceProvider = async (options) => {
|
20
|
+
if (!pending) {
|
21
|
+
pending = normalizedProvider(options);
|
22
|
+
}
|
23
|
+
try {
|
24
|
+
resolved = await pending;
|
25
|
+
hasResult = true;
|
26
|
+
isConstant = false;
|
27
|
+
}
|
28
|
+
finally {
|
29
|
+
pending = undefined;
|
30
|
+
}
|
31
|
+
return resolved;
|
32
|
+
};
|
33
|
+
if (isExpired === undefined) {
|
34
|
+
return async (options) => {
|
35
|
+
if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) {
|
36
|
+
resolved = await coalesceProvider(options);
|
37
|
+
}
|
38
|
+
return resolved;
|
39
|
+
};
|
40
|
+
}
|
41
|
+
return async (options) => {
|
42
|
+
if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) {
|
43
|
+
resolved = await coalesceProvider(options);
|
44
|
+
}
|
45
|
+
if (isConstant) {
|
46
|
+
return resolved;
|
47
|
+
}
|
48
|
+
if (!requiresRefresh(resolved)) {
|
49
|
+
isConstant = true;
|
50
|
+
return resolved;
|
51
|
+
}
|
52
|
+
if (isExpired(resolved)) {
|
53
|
+
await coalesceProvider(options);
|
54
|
+
return resolved;
|
55
|
+
}
|
56
|
+
return resolved;
|
57
|
+
};
|
58
|
+
};
|
59
|
+
exports.memoizeIdentityProvider = memoizeIdentityProvider;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export * from "./middleware-http-auth-scheme";
|
2
|
+
export * from "./middleware-http-signing";
|
3
|
+
export * from "./util-identity-and-auth";
|
4
|
+
export * from "./getSmithyContext";
|
5
|
+
export * from "./normalizeProvider";
|
6
|
+
export * from "./protocols/requestBuilder";
|
7
|
+
export { createPaginator } from "./pagination/createPaginator";
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { endpointMiddlewareOptions } from "@smithy/middleware-endpoint";
|
2
|
+
import { httpAuthSchemeMiddleware } from "./httpAuthSchemeMiddleware";
|
3
|
+
export const httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
|
4
|
+
step: "serialize",
|
5
|
+
tags: ["HTTP_AUTH_SCHEME"],
|
6
|
+
name: "httpAuthSchemeMiddleware",
|
7
|
+
override: true,
|
8
|
+
relation: "before",
|
9
|
+
toMiddleware: endpointMiddlewareOptions.name,
|
10
|
+
};
|
11
|
+
export const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
12
|
+
applyToStack: (clientStack) => {
|
13
|
+
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
|
14
|
+
httpAuthSchemeParametersProvider,
|
15
|
+
identityProviderConfigProvider,
|
16
|
+
}), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
|
17
|
+
},
|
18
|
+
});
|
package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
import { serializerMiddlewareOption } from "@smithy/middleware-serde";
|
2
|
+
import { httpAuthSchemeMiddleware } from "./httpAuthSchemeMiddleware";
|
3
|
+
export const httpAuthSchemeMiddlewareOptions = {
|
4
|
+
step: "serialize",
|
5
|
+
tags: ["HTTP_AUTH_SCHEME"],
|
6
|
+
name: "httpAuthSchemeMiddleware",
|
7
|
+
override: true,
|
8
|
+
relation: "before",
|
9
|
+
toMiddleware: serializerMiddlewareOption.name,
|
10
|
+
};
|
11
|
+
export const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
12
|
+
applyToStack: (clientStack) => {
|
13
|
+
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
|
14
|
+
httpAuthSchemeParametersProvider,
|
15
|
+
identityProviderConfigProvider,
|
16
|
+
}), httpAuthSchemeMiddlewareOptions);
|
17
|
+
},
|
18
|
+
});
|
package/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
2
|
+
import { getSmithyContext } from "@smithy/util-middleware";
|
3
|
+
function convertHttpAuthSchemesToMap(httpAuthSchemes) {
|
4
|
+
const map = new Map();
|
5
|
+
for (const scheme of httpAuthSchemes) {
|
6
|
+
map.set(scheme.schemeId, scheme);
|
7
|
+
}
|
8
|
+
return map;
|
9
|
+
}
|
10
|
+
export const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
|
11
|
+
const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
|
12
|
+
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
|
13
|
+
const smithyContext = getSmithyContext(context);
|
14
|
+
const failureReasons = [];
|
15
|
+
for (const option of options) {
|
16
|
+
const scheme = authSchemes.get(option.schemeId);
|
17
|
+
if (!scheme) {
|
18
|
+
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
|
19
|
+
continue;
|
20
|
+
}
|
21
|
+
const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
|
22
|
+
if (!identityProvider) {
|
23
|
+
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
|
24
|
+
continue;
|
25
|
+
}
|
26
|
+
const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
|
27
|
+
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
|
28
|
+
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
|
29
|
+
smithyContext.selectedHttpAuthScheme = {
|
30
|
+
httpAuthOption: option,
|
31
|
+
identity: await identityProvider(option.identityProperties),
|
32
|
+
signer: scheme.signer,
|
33
|
+
};
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
if (!smithyContext.selectedHttpAuthScheme) {
|
37
|
+
throw new Error(failureReasons.join("\n"));
|
38
|
+
}
|
39
|
+
return next(args);
|
40
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { retryMiddlewareOptions } from "@smithy/middleware-retry";
|
2
|
+
import { httpSigningMiddleware } from "./httpSigningMiddleware";
|
3
|
+
export const httpSigningMiddlewareOptions = {
|
4
|
+
step: "finalizeRequest",
|
5
|
+
tags: ["HTTP_SIGNING"],
|
6
|
+
name: "httpSigningMiddleware",
|
7
|
+
aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
|
8
|
+
override: true,
|
9
|
+
relation: "after",
|
10
|
+
toMiddleware: retryMiddlewareOptions.name,
|
11
|
+
};
|
12
|
+
export const getHttpSigningPlugin = (config) => ({
|
13
|
+
applyToStack: (clientStack) => {
|
14
|
+
clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
|
15
|
+
},
|
16
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { HttpRequest } from "@smithy/protocol-http";
|
2
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
3
|
+
import { getSmithyContext } from "@smithy/util-middleware";
|
4
|
+
const defaultErrorHandler = (signingProperties) => (error) => {
|
5
|
+
throw error;
|
6
|
+
};
|
7
|
+
const defaultSuccessHandler = (httpResponse, signingProperties) => { };
|
8
|
+
export const httpSigningMiddleware = (config) => (next, context) => async (args) => {
|
9
|
+
if (!HttpRequest.isInstance(args.request)) {
|
10
|
+
return next(args);
|
11
|
+
}
|
12
|
+
const smithyContext = getSmithyContext(context);
|
13
|
+
const scheme = smithyContext.selectedHttpAuthScheme;
|
14
|
+
if (!scheme) {
|
15
|
+
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
16
|
+
}
|
17
|
+
const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;
|
18
|
+
const output = await next({
|
19
|
+
...args,
|
20
|
+
request: await signer.sign(args.request, identity, signingProperties),
|
21
|
+
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
22
|
+
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
23
|
+
return output;
|
24
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
const makePagedClientRequest = async (CommandCtor, client, input, ...args) => {
|
2
|
+
return await client.send(new CommandCtor(input), ...args);
|
3
|
+
};
|
4
|
+
export function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
|
5
|
+
return async function* paginateOperation(config, input, ...additionalArguments) {
|
6
|
+
let token = config.startingToken || undefined;
|
7
|
+
let hasNext = true;
|
8
|
+
let page;
|
9
|
+
while (hasNext) {
|
10
|
+
input[inputTokenName] = token;
|
11
|
+
if (pageSizeTokenName) {
|
12
|
+
input[pageSizeTokenName] = input[pageSizeTokenName] ?? config.pageSize;
|
13
|
+
}
|
14
|
+
if (config.client instanceof ClientCtor) {
|
15
|
+
page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments);
|
16
|
+
}
|
17
|
+
else {
|
18
|
+
throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
|
19
|
+
}
|
20
|
+
yield page;
|
21
|
+
const prevToken = token;
|
22
|
+
token = page[outputTokenName];
|
23
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
24
|
+
}
|
25
|
+
return undefined;
|
26
|
+
};
|
27
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { HttpRequest } from "@smithy/protocol-http";
|
2
|
+
import { resolvedPath } from "@smithy/smithy-client";
|
3
|
+
export function requestBuilder(input, context) {
|
4
|
+
return new RequestBuilder(input, context);
|
5
|
+
}
|
6
|
+
export class RequestBuilder {
|
7
|
+
constructor(input, context) {
|
8
|
+
this.input = input;
|
9
|
+
this.context = context;
|
10
|
+
this.query = {};
|
11
|
+
this.method = "";
|
12
|
+
this.headers = {};
|
13
|
+
this.path = "";
|
14
|
+
this.body = null;
|
15
|
+
this.hostname = "";
|
16
|
+
this.resolvePathStack = [];
|
17
|
+
}
|
18
|
+
async build() {
|
19
|
+
const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
|
20
|
+
this.path = basePath;
|
21
|
+
for (const resolvePath of this.resolvePathStack) {
|
22
|
+
resolvePath(this.path);
|
23
|
+
}
|
24
|
+
return new HttpRequest({
|
25
|
+
protocol,
|
26
|
+
hostname: this.hostname || hostname,
|
27
|
+
port,
|
28
|
+
method: this.method,
|
29
|
+
path: this.path,
|
30
|
+
query: this.query,
|
31
|
+
body: this.body,
|
32
|
+
headers: this.headers,
|
33
|
+
});
|
34
|
+
}
|
35
|
+
hn(hostname) {
|
36
|
+
this.hostname = hostname;
|
37
|
+
return this;
|
38
|
+
}
|
39
|
+
bp(uriLabel) {
|
40
|
+
this.resolvePathStack.push((basePath) => {
|
41
|
+
this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
|
42
|
+
});
|
43
|
+
return this;
|
44
|
+
}
|
45
|
+
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
46
|
+
this.resolvePathStack.push((path) => {
|
47
|
+
this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
48
|
+
});
|
49
|
+
return this;
|
50
|
+
}
|
51
|
+
h(headers) {
|
52
|
+
this.headers = headers;
|
53
|
+
return this;
|
54
|
+
}
|
55
|
+
q(query) {
|
56
|
+
this.query = query;
|
57
|
+
return this;
|
58
|
+
}
|
59
|
+
b(body) {
|
60
|
+
this.body = body;
|
61
|
+
return this;
|
62
|
+
}
|
63
|
+
m(method) {
|
64
|
+
this.method = method;
|
65
|
+
return this;
|
66
|
+
}
|
67
|
+
}
|
package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
export class DefaultIdentityProviderConfig {
|
2
|
+
constructor(config) {
|
3
|
+
this.authSchemes = new Map();
|
4
|
+
for (const [key, value] of Object.entries(config)) {
|
5
|
+
if (value !== undefined) {
|
6
|
+
this.authSchemes.set(key, value);
|
7
|
+
}
|
8
|
+
}
|
9
|
+
}
|
10
|
+
getIdentityProvider(schemeId) {
|
11
|
+
return this.authSchemes.get(schemeId);
|
12
|
+
}
|
13
|
+
}
|
package/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
import { HttpApiKeyAuthLocation } from "@smithy/types";
|
2
|
+
export class HttpApiKeyAuthSigner {
|
3
|
+
async sign(httpRequest, identity, signingProperties) {
|
4
|
+
if (!signingProperties) {
|
5
|
+
throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");
|
6
|
+
}
|
7
|
+
if (!signingProperties.name) {
|
8
|
+
throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");
|
9
|
+
}
|
10
|
+
if (!signingProperties.in) {
|
11
|
+
throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");
|
12
|
+
}
|
13
|
+
if (!identity.apiKey) {
|
14
|
+
throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");
|
15
|
+
}
|
16
|
+
const clonedRequest = httpRequest.clone();
|
17
|
+
if (signingProperties.in === HttpApiKeyAuthLocation.QUERY) {
|
18
|
+
clonedRequest.query[signingProperties.name] = identity.apiKey;
|
19
|
+
}
|
20
|
+
else if (signingProperties.in === HttpApiKeyAuthLocation.HEADER) {
|
21
|
+
clonedRequest.headers[signingProperties.name] = signingProperties.scheme
|
22
|
+
? `${signingProperties.scheme} ${identity.apiKey}`
|
23
|
+
: identity.apiKey;
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " +
|
27
|
+
"but found: `" +
|
28
|
+
signingProperties.in +
|
29
|
+
"`");
|
30
|
+
}
|
31
|
+
return clonedRequest;
|
32
|
+
}
|
33
|
+
}
|
package/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
export class HttpBearerAuthSigner {
|
2
|
+
async sign(httpRequest, identity, signingProperties) {
|
3
|
+
const clonedRequest = httpRequest.clone();
|
4
|
+
if (!identity.token) {
|
5
|
+
throw new Error("request could not be signed with `token` since the `token` is not defined");
|
6
|
+
}
|
7
|
+
clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`;
|
8
|
+
return clonedRequest;
|
9
|
+
}
|
10
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
export const createIsIdentityExpiredFunction = (expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
|
2
|
+
export const EXPIRATION_MS = 300000;
|
3
|
+
export const isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
|
4
|
+
export const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined;
|
5
|
+
export const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
6
|
+
if (provider === undefined) {
|
7
|
+
return undefined;
|
8
|
+
}
|
9
|
+
const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
|
10
|
+
let resolved;
|
11
|
+
let pending;
|
12
|
+
let hasResult;
|
13
|
+
let isConstant = false;
|
14
|
+
const coalesceProvider = async (options) => {
|
15
|
+
if (!pending) {
|
16
|
+
pending = normalizedProvider(options);
|
17
|
+
}
|
18
|
+
try {
|
19
|
+
resolved = await pending;
|
20
|
+
hasResult = true;
|
21
|
+
isConstant = false;
|
22
|
+
}
|
23
|
+
finally {
|
24
|
+
pending = undefined;
|
25
|
+
}
|
26
|
+
return resolved;
|
27
|
+
};
|
28
|
+
if (isExpired === undefined) {
|
29
|
+
return async (options) => {
|
30
|
+
if (!hasResult || options?.forceRefresh) {
|
31
|
+
resolved = await coalesceProvider(options);
|
32
|
+
}
|
33
|
+
return resolved;
|
34
|
+
};
|
35
|
+
}
|
36
|
+
return async (options) => {
|
37
|
+
if (!hasResult || options?.forceRefresh) {
|
38
|
+
resolved = await coalesceProvider(options);
|
39
|
+
}
|
40
|
+
if (isConstant) {
|
41
|
+
return resolved;
|
42
|
+
}
|
43
|
+
if (!requiresRefresh(resolved)) {
|
44
|
+
isConstant = true;
|
45
|
+
return resolved;
|
46
|
+
}
|
47
|
+
if (isExpired(resolved)) {
|
48
|
+
await coalesceProvider(options);
|
49
|
+
return resolved;
|
50
|
+
}
|
51
|
+
return resolved;
|
52
|
+
};
|
53
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export * from "./middleware-http-auth-scheme";
|
2
|
+
export * from "./middleware-http-signing";
|
3
|
+
export * from "./util-identity-and-auth";
|
4
|
+
export * from "./getSmithyContext";
|
5
|
+
export * from "./normalizeProvider";
|
6
|
+
export * from "./protocols/requestBuilder";
|
7
|
+
export { createPaginator } from "./pagination/createPaginator";
|