@cdk8s/awscdk-resolver 0.0.42 → 0.0.43
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/resolve.js +1 -1
- 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 +11 -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 +9 -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/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 +6 -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/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 +6 -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/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 +6 -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/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 +66 -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,216 @@
|
|
1
|
+
import {
|
2
|
+
doesIdentityRequireRefresh,
|
3
|
+
isIdentityExpired,
|
4
|
+
memoizeIdentityProvider,
|
5
|
+
normalizeProvider,
|
6
|
+
} from "@smithy/core";
|
7
|
+
import { SignatureV4, SignatureV4CryptoInit, SignatureV4Init } from "@smithy/signature-v4";
|
8
|
+
import {
|
9
|
+
AuthScheme,
|
10
|
+
AwsCredentialIdentity,
|
11
|
+
AwsCredentialIdentityProvider,
|
12
|
+
ChecksumConstructor,
|
13
|
+
HashConstructor,
|
14
|
+
MemoizedProvider,
|
15
|
+
Provider,
|
16
|
+
RegionInfo,
|
17
|
+
RegionInfoProvider,
|
18
|
+
RequestSigner,
|
19
|
+
} from "@smithy/types";
|
20
|
+
|
21
|
+
/**
|
22
|
+
* @internal
|
23
|
+
*/
|
24
|
+
export interface AWSSDKSigV4AuthInputConfig {
|
25
|
+
/**
|
26
|
+
* The credentials used to sign requests.
|
27
|
+
*/
|
28
|
+
credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* The signer to use when signing requests.
|
32
|
+
*/
|
33
|
+
signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise<RequestSigner>);
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Whether to escape request path when signing the request.
|
37
|
+
*/
|
38
|
+
signingEscapePath?: boolean;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* An offset value in milliseconds to apply to all signing times.
|
42
|
+
*/
|
43
|
+
systemClockOffset?: number;
|
44
|
+
|
45
|
+
/**
|
46
|
+
* The region where you want to sign your request against. This
|
47
|
+
* can be different to the region in the endpoint.
|
48
|
+
*/
|
49
|
+
signingRegion?: string;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* The injectable SigV4-compatible signer class constructor. If not supplied,
|
53
|
+
* regular SignatureV4 constructor will be used.
|
54
|
+
*
|
55
|
+
* @internal
|
56
|
+
*/
|
57
|
+
signerConstructor?: new (options: SignatureV4Init & SignatureV4CryptoInit) => RequestSigner;
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* @internal
|
62
|
+
*/
|
63
|
+
export interface AWSSDKSigV4PreviouslyResolved {
|
64
|
+
credentialDefaultProvider?: (input: any) => MemoizedProvider<AwsCredentialIdentity>;
|
65
|
+
region: string | Provider<string>;
|
66
|
+
sha256: ChecksumConstructor | HashConstructor;
|
67
|
+
signingName?: string;
|
68
|
+
regionInfoProvider?: RegionInfoProvider;
|
69
|
+
defaultSigningName?: string;
|
70
|
+
serviceId: string;
|
71
|
+
useFipsEndpoint: Provider<boolean>;
|
72
|
+
useDualstackEndpoint: Provider<boolean>;
|
73
|
+
}
|
74
|
+
|
75
|
+
/**
|
76
|
+
* @internal
|
77
|
+
*/
|
78
|
+
export interface AWSSDKSigV4AuthResolvedConfig {
|
79
|
+
/**
|
80
|
+
* Resolved value for input config {@link AWSSDKSigV4AuthInputConfig.credentials}
|
81
|
+
* This provider MAY memoize the loaded credentials for certain period.
|
82
|
+
* See {@link MemoizedProvider} for more information.
|
83
|
+
*/
|
84
|
+
credentials: AwsCredentialIdentityProvider;
|
85
|
+
/**
|
86
|
+
* Resolved value for input config {@link AWSSDKSigV4AuthInputConfig.signer}
|
87
|
+
*/
|
88
|
+
signer: (authScheme?: AuthScheme) => Promise<RequestSigner>;
|
89
|
+
/**
|
90
|
+
* Resolved value for input config {@link AWSSDKSigV4AuthInputConfig.signingEscapePath}
|
91
|
+
*/
|
92
|
+
signingEscapePath: boolean;
|
93
|
+
/**
|
94
|
+
* Resolved value for input config {@link AWSSDKSigV4AuthInputConfig.systemClockOffset}
|
95
|
+
*/
|
96
|
+
systemClockOffset: number;
|
97
|
+
}
|
98
|
+
|
99
|
+
/**
|
100
|
+
* @internal
|
101
|
+
*/
|
102
|
+
export const resolveAWSSDKSigV4Config = <T>(
|
103
|
+
config: T & AWSSDKSigV4AuthInputConfig & AWSSDKSigV4PreviouslyResolved
|
104
|
+
): T & AWSSDKSigV4AuthResolvedConfig => {
|
105
|
+
// Normalize credentials
|
106
|
+
let normalizedCreds: AwsCredentialIdentityProvider | undefined;
|
107
|
+
if (config.credentials) {
|
108
|
+
normalizedCreds = memoizeIdentityProvider(config.credentials, isIdentityExpired, doesIdentityRequireRefresh);
|
109
|
+
}
|
110
|
+
if (!normalizedCreds) {
|
111
|
+
// credentialDefaultProvider should always be populated, but in case
|
112
|
+
// it isn't, set a default identity provider that throws an error
|
113
|
+
if (config.credentialDefaultProvider) {
|
114
|
+
normalizedCreds = config.credentialDefaultProvider(config as any);
|
115
|
+
} else {
|
116
|
+
normalizedCreds = async () => { throw new Error("`credentials` is missing") };
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
// Populate sigv4 arguments
|
121
|
+
const {
|
122
|
+
// Default for signingEscapePath
|
123
|
+
signingEscapePath = true,
|
124
|
+
// Default for systemClockOffset
|
125
|
+
systemClockOffset = config.systemClockOffset || 0,
|
126
|
+
// No default for sha256 since it is platform dependent
|
127
|
+
sha256,
|
128
|
+
} = config;
|
129
|
+
|
130
|
+
// Resolve signer
|
131
|
+
let signer: (authScheme?: AuthScheme) => Promise<RequestSigner>;
|
132
|
+
if (config.signer) {
|
133
|
+
// if signer is supplied by user, normalize it to a function returning a promise for signer.
|
134
|
+
signer = normalizeProvider(config.signer);
|
135
|
+
} else if (config.regionInfoProvider) {
|
136
|
+
// This branch is for endpoints V1.
|
137
|
+
// construct a provider inferring signing from region.
|
138
|
+
signer = () =>
|
139
|
+
normalizeProvider(config.region)()
|
140
|
+
.then(
|
141
|
+
async (region) =>
|
142
|
+
[
|
143
|
+
(await config.regionInfoProvider!(region, {
|
144
|
+
useFipsEndpoint: await config.useFipsEndpoint(),
|
145
|
+
useDualstackEndpoint: await config.useDualstackEndpoint(),
|
146
|
+
})) || {},
|
147
|
+
region,
|
148
|
+
] as [RegionInfo, string]
|
149
|
+
)
|
150
|
+
.then(([regionInfo, region]) => {
|
151
|
+
const { signingRegion, signingService } = regionInfo;
|
152
|
+
// update client's singing region and signing service config if they are resolved.
|
153
|
+
// signing region resolving order: user supplied signingRegion -> endpoints.json inferred region -> client region
|
154
|
+
config.signingRegion = config.signingRegion || signingRegion || region;
|
155
|
+
// signing name resolving order:
|
156
|
+
// user supplied signingName -> endpoints.json inferred (credential scope -> model arnNamespace) -> model service id
|
157
|
+
config.signingName = config.signingName || signingService || config.serviceId;
|
158
|
+
|
159
|
+
const params: SignatureV4Init & SignatureV4CryptoInit = {
|
160
|
+
...config,
|
161
|
+
credentials: normalizedCreds!,
|
162
|
+
region: config.signingRegion,
|
163
|
+
service: config.signingName,
|
164
|
+
sha256,
|
165
|
+
uriEscapePath: signingEscapePath,
|
166
|
+
};
|
167
|
+
const SignerCtor = config.signerConstructor || SignatureV4;
|
168
|
+
return new SignerCtor(params);
|
169
|
+
});
|
170
|
+
} else {
|
171
|
+
// This branch is for endpoints V2.
|
172
|
+
// Handle endpoints v2 that resolved per-command
|
173
|
+
// TODO: need total refactor for reference auth architecture.
|
174
|
+
signer = async (authScheme?: AuthScheme) => {
|
175
|
+
authScheme = Object.assign(
|
176
|
+
{},
|
177
|
+
{
|
178
|
+
name: "sigv4",
|
179
|
+
signingName: config.signingName || config.defaultSigningName!,
|
180
|
+
signingRegion: await normalizeProvider(config.region)(),
|
181
|
+
properties: {},
|
182
|
+
},
|
183
|
+
authScheme
|
184
|
+
);
|
185
|
+
|
186
|
+
const signingRegion = authScheme.signingRegion;
|
187
|
+
const signingService = authScheme.signingName;
|
188
|
+
// update client's singing region and signing service config if they are resolved.
|
189
|
+
// signing region resolving order: user supplied signingRegion -> endpoints.json inferred region -> client region
|
190
|
+
config.signingRegion = config.signingRegion || signingRegion;
|
191
|
+
// signing name resolving order:
|
192
|
+
// user supplied signingName -> endpoints.json inferred (credential scope -> model arnNamespace) -> model service id
|
193
|
+
config.signingName = config.signingName || signingService || config.serviceId;
|
194
|
+
|
195
|
+
const params: SignatureV4Init & SignatureV4CryptoInit = {
|
196
|
+
...config,
|
197
|
+
credentials: normalizedCreds!,
|
198
|
+
region: config.signingRegion,
|
199
|
+
service: config.signingName,
|
200
|
+
sha256,
|
201
|
+
uriEscapePath: signingEscapePath,
|
202
|
+
};
|
203
|
+
|
204
|
+
const SignerCtor = config.signerConstructor || SignatureV4;
|
205
|
+
return new SignerCtor(params);
|
206
|
+
};
|
207
|
+
}
|
208
|
+
|
209
|
+
return {
|
210
|
+
...config,
|
211
|
+
systemClockOffset,
|
212
|
+
signingEscapePath,
|
213
|
+
credentials: normalizedCreds!,
|
214
|
+
signer,
|
215
|
+
};
|
216
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./aws-sdk";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { getSkewCorrectedDate } from "./getSkewCorrectedDate";
|
2
|
+
|
3
|
+
describe(getSkewCorrectedDate.name, () => {
|
4
|
+
const mockDateNow = Date.now();
|
5
|
+
|
6
|
+
beforeEach(() => {
|
7
|
+
jest.spyOn(Date, "now").mockReturnValue(mockDateNow);
|
8
|
+
});
|
9
|
+
|
10
|
+
afterEach(() => {
|
11
|
+
jest.clearAllMocks();
|
12
|
+
});
|
13
|
+
|
14
|
+
it.each([-100000, -100, 0, 100, 100000])("systemClockOffset: %d", (systemClockOffset) => {
|
15
|
+
expect(getSkewCorrectedDate(systemClockOffset)).toStrictEqual(new Date(mockDateNow + systemClockOffset));
|
16
|
+
});
|
17
|
+
});
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* @internal
|
3
|
+
*
|
4
|
+
* Returns a date that is corrected for clock skew.
|
5
|
+
*
|
6
|
+
* @param systemClockOffset The offset of the system clock in milliseconds.
|
7
|
+
*/
|
8
|
+
export const getSkewCorrectedDate = (systemClockOffset: number) => new Date(Date.now() + systemClockOffset);
|
package/node_modules/@aws-sdk/core/src/httpAuthSchemes/utils/getUpdatedSystemClockOffset.spec.ts
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
import { getUpdatedSystemClockOffset } from "./getUpdatedSystemClockOffset";
|
2
|
+
import { isClockSkewed } from "./isClockSkewed";
|
3
|
+
|
4
|
+
jest.mock("./isClockSkewed");
|
5
|
+
|
6
|
+
describe(getUpdatedSystemClockOffset.name, () => {
|
7
|
+
// Mock ServerTime is accurate to last second, to remove milliseconds information.
|
8
|
+
const mockClockTime = new Date(Math.floor(Date.now() / 1000) * 1000);
|
9
|
+
const mockSystemClockOffset = 100;
|
10
|
+
|
11
|
+
afterEach(() => {
|
12
|
+
jest.clearAllMocks();
|
13
|
+
});
|
14
|
+
|
15
|
+
it("returns passed systemClockOffset when clock is not skewed", () => {
|
16
|
+
(isClockSkewed as jest.Mock).mockReturnValue(false);
|
17
|
+
expect(getUpdatedSystemClockOffset(mockClockTime.toString(), mockSystemClockOffset)).toEqual(mockSystemClockOffset);
|
18
|
+
});
|
19
|
+
|
20
|
+
describe("returns difference between serverTime and current time when clock is skewed", () => {
|
21
|
+
const dateDotNowFn = Date.now;
|
22
|
+
|
23
|
+
beforeEach(() => {
|
24
|
+
(isClockSkewed as jest.Mock).mockReturnValue(true);
|
25
|
+
jest.spyOn(Date, "now").mockReturnValueOnce(mockClockTime.getTime());
|
26
|
+
});
|
27
|
+
|
28
|
+
afterEach(() => {
|
29
|
+
Date.now = dateDotNowFn;
|
30
|
+
});
|
31
|
+
|
32
|
+
it.each([1000, 100000])("difference: %d", (difference) => {
|
33
|
+
const updatedClockTime = new Date(mockClockTime.getTime() + difference);
|
34
|
+
expect(getUpdatedSystemClockOffset(updatedClockTime.toString(), mockSystemClockOffset)).toEqual(difference);
|
35
|
+
});
|
36
|
+
});
|
37
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { isClockSkewed } from "./isClockSkewed";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @internal
|
5
|
+
*
|
6
|
+
* If clock is skewed, it returns the difference between serverTime and current time.
|
7
|
+
* If clock is not skewed, it returns currentSystemClockOffset.
|
8
|
+
*
|
9
|
+
* @param clockTime The string value of the server time.
|
10
|
+
* @param currentSystemClockOffset The current system clock offset.
|
11
|
+
*/
|
12
|
+
export const getUpdatedSystemClockOffset = (clockTime: string, currentSystemClockOffset: number): number => {
|
13
|
+
const clockTimeInMs = Date.parse(clockTime);
|
14
|
+
if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
|
15
|
+
return clockTimeInMs - Date.now();
|
16
|
+
}
|
17
|
+
return currentSystemClockOffset;
|
18
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { getSkewCorrectedDate } from "./getSkewCorrectedDate";
|
2
|
+
import { isClockSkewed } from "./isClockSkewed";
|
3
|
+
|
4
|
+
jest.mock("./getSkewCorrectedDate");
|
5
|
+
|
6
|
+
describe(isClockSkewed.name, () => {
|
7
|
+
const mockSystemClockOffset = 100;
|
8
|
+
const mockSkewCorrectedDate = new Date();
|
9
|
+
|
10
|
+
beforeEach(() => {
|
11
|
+
(getSkewCorrectedDate as jest.Mock).mockReturnValue(mockSkewCorrectedDate);
|
12
|
+
});
|
13
|
+
|
14
|
+
afterEach(() => {
|
15
|
+
expect(getSkewCorrectedDate).toHaveBeenCalledWith(mockSystemClockOffset);
|
16
|
+
jest.clearAllMocks();
|
17
|
+
});
|
18
|
+
|
19
|
+
describe("returns true for time difference >=300000", () => {
|
20
|
+
it.each([300000, 500000])("difference: %d", (difference) => {
|
21
|
+
expect(isClockSkewed(mockSkewCorrectedDate.getTime() + difference, mockSystemClockOffset)).toBe(true);
|
22
|
+
expect(isClockSkewed(mockSkewCorrectedDate.getTime() - difference, mockSystemClockOffset)).toBe(true);
|
23
|
+
});
|
24
|
+
});
|
25
|
+
|
26
|
+
describe("returns false for time difference <300000", () => {
|
27
|
+
it.each([299999, 100000, 0])("difference: %d", (difference) => {
|
28
|
+
expect(isClockSkewed(mockSkewCorrectedDate.getTime() + difference, mockSystemClockOffset)).toBe(false);
|
29
|
+
expect(isClockSkewed(mockSkewCorrectedDate.getTime() - difference, mockSystemClockOffset)).toBe(false);
|
30
|
+
});
|
31
|
+
});
|
32
|
+
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { getSkewCorrectedDate } from "./getSkewCorrectedDate";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @internal
|
5
|
+
*
|
6
|
+
* Checks if the provided date is within the skew window of 300000ms.
|
7
|
+
*
|
8
|
+
* @param clockTime - The time to check for skew in milliseconds.
|
9
|
+
* @param systemClockOffset - The offset of the system clock in milliseconds.
|
10
|
+
*/
|
11
|
+
export const isClockSkewed = (clockTime: number, systemClockOffset: number) =>
|
12
|
+
Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000;
|