@cdk8s/awscdk-resolver 0.0.95 → 0.0.97
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 +4 -4
- package/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +4 -2
- package/node_modules/@aws-sdk/client-sso-oidc/LICENSE +201 -0
- package/node_modules/@aws-sdk/client-sso-oidc/README.md +274 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js +64 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js +14 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js +7 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js +1024 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.browser.js +39 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js +49 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.native.js +15 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js +40 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js +15 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js +52 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthSchemeProvider.js +58 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js +25 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenWithIAMCommand.js +25 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js +25 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js +25 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js +4 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js +14 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js +10 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js +4 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/extensionConfiguration.js +1 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js +5 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js +8 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js +1 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js +217 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js +409 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.browser.js +34 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js +44 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.native.js +11 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js +36 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeExtensions.js +21 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDC.d.ts +75 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDCClient.d.ts +212 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/CreateTokenCommand.d.ts +162 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/CreateTokenWithIAMCommand.d.ts +244 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/RegisterClientCommand.d.ts +108 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/StartDeviceAuthorizationCommand.d.ts +111 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/index.d.ts +4 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/EndpointParameters.d.ts +40 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/ruleset.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/extensionConfiguration.d.ts +9 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/index.d.ts +50 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/SSOOIDCServiceException.d.ts +13 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/models_0.d.ts +734 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/protocols/Aws_restJson1.d.ts +38 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.browser.d.ts +53 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.d.ts +53 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.native.d.ts +52 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.shared.d.ts +32 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeExtensions.d.ts +17 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDC.d.ts +73 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDCClient.d.ts +144 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/CreateTokenCommand.d.ts +35 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/CreateTokenWithIAMCommand.d.ts +39 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/RegisterClientCommand.d.ts +38 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/StartDeviceAuthorizationCommand.d.ts +39 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/index.d.ts +4 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/index.d.ts +8 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/SSOOIDCServiceException.d.ts +8 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/models_0.d.ts +201 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +53 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.browser.d.ts +110 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.d.ts +114 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.native.d.ts +104 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.shared.d.ts +49 -0
- package/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/node_modules/@aws-sdk/client-sso-oidc/package.json +100 -0
- package/node_modules/@aws-sdk/client-sts/LICENSE +201 -0
- package/node_modules/@aws-sdk/client-sts/README.md +273 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js +56 -0
- 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/endpoint/EndpointParameters.js +20 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js +14 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js +7 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/index.js +1457 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.browser.js +39 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js +63 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.native.js +15 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js +40 -0
- package/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js +25 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/STS.js +23 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js +52 -0
- 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 +25 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js +25 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js +25 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js +24 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js +24 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js +24 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js +25 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js +25 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js +8 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js +22 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js +67 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js +16 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js +10 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js +4 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/extensionConfiguration.js +1 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/index.js +6 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js +8 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/models/index.js +1 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js +130 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js +885 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.browser.js +34 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js +58 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.native.js +11 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js +36 -0
- package/node_modules/@aws-sdk/client-sts/dist-es/runtimeExtensions.js +21 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/STS.d.ts +71 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts +182 -0
- 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/commands/AssumeRoleCommand.d.ts +257 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithSAMLCommand.d.ts +282 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithWebIdentityCommand.d.ts +291 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/commands/DecodeAuthorizationMessageCommand.d.ts +115 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/commands/GetAccessKeyInfoCommand.d.ts +75 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/commands/GetCallerIdentityCommand.d.ts +116 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/commands/GetFederationTokenCommand.d.ts +230 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/commands/GetSessionTokenCommand.d.ts +154 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/commands/index.d.ts +8 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/defaultRoleAssumers.d.ts +23 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/defaultStsRoleAssumers.d.ts +43 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/endpoint/EndpointParameters.d.ts +46 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/endpoint/ruleset.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/extensionConfiguration.d.ts +9 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/index.d.ts +17 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/models/STSServiceException.d.ts +13 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/models/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/models/models_0.d.ts +1213 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/protocols/Aws_query.d.ts +74 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts +54 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts +52 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts +53 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.shared.d.ts +32 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeExtensions.d.ts +17 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STS.d.ts +143 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STSClient.d.ts +165 -0
- 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/commands/AssumeRoleCommand.d.ts +35 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts +39 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts +39 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts +39 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts +38 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetCallerIdentityCommand.d.ts +39 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetFederationTokenCommand.d.ts +39 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetSessionTokenCommand.d.ts +38 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/index.d.ts +8 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultRoleAssumers.d.ts +19 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultStsRoleAssumers.d.ts +33 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +57 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/index.d.ts +9 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/STSServiceException.d.ts +8 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/models_0.d.ts +206 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/protocols/Aws_query.d.ts +101 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts +116 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts +109 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts +110 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.shared.d.ts +51 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/node_modules/@aws-sdk/client-sts/package.json +102 -0
- package/node_modules/@aws-sdk/credential-provider-node/package.json +1 -1
- package/package.json +3 -3
@@ -0,0 +1,67 @@
|
|
1
|
+
import { AssumeRoleCommand } from "./commands/AssumeRoleCommand";
|
2
|
+
import { AssumeRoleWithWebIdentityCommand, } from "./commands/AssumeRoleWithWebIdentityCommand";
|
3
|
+
const ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
|
4
|
+
const resolveRegion = async (_region, _parentRegion, credentialProviderLogger) => {
|
5
|
+
const region = typeof _region === "function" ? await _region() : _region;
|
6
|
+
const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
|
7
|
+
credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (provider)`, `${parentRegion} (parent client)`, `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`);
|
8
|
+
return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
|
9
|
+
};
|
10
|
+
export const getDefaultRoleAssumer = (stsOptions, stsClientCtor) => {
|
11
|
+
let stsClient;
|
12
|
+
let closureSourceCreds;
|
13
|
+
return async (sourceCreds, params) => {
|
14
|
+
closureSourceCreds = sourceCreds;
|
15
|
+
if (!stsClient) {
|
16
|
+
const { logger = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, } = stsOptions;
|
17
|
+
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
|
18
|
+
stsClient = new stsClientCtor({
|
19
|
+
credentialDefaultProvider: () => async () => closureSourceCreds,
|
20
|
+
region: resolvedRegion,
|
21
|
+
requestHandler: requestHandler,
|
22
|
+
logger: logger,
|
23
|
+
});
|
24
|
+
}
|
25
|
+
const { Credentials } = await stsClient.send(new AssumeRoleCommand(params));
|
26
|
+
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
27
|
+
throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
|
28
|
+
}
|
29
|
+
return {
|
30
|
+
accessKeyId: Credentials.AccessKeyId,
|
31
|
+
secretAccessKey: Credentials.SecretAccessKey,
|
32
|
+
sessionToken: Credentials.SessionToken,
|
33
|
+
expiration: Credentials.Expiration,
|
34
|
+
credentialScope: Credentials.CredentialScope,
|
35
|
+
};
|
36
|
+
};
|
37
|
+
};
|
38
|
+
export const getDefaultRoleAssumerWithWebIdentity = (stsOptions, stsClientCtor) => {
|
39
|
+
let stsClient;
|
40
|
+
return async (params) => {
|
41
|
+
if (!stsClient) {
|
42
|
+
const { logger = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, } = stsOptions;
|
43
|
+
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
|
44
|
+
stsClient = new stsClientCtor({
|
45
|
+
region: resolvedRegion,
|
46
|
+
requestHandler: requestHandler,
|
47
|
+
logger: logger,
|
48
|
+
});
|
49
|
+
}
|
50
|
+
const { Credentials } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
|
51
|
+
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
52
|
+
throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
|
53
|
+
}
|
54
|
+
return {
|
55
|
+
accessKeyId: Credentials.AccessKeyId,
|
56
|
+
secretAccessKey: Credentials.SecretAccessKey,
|
57
|
+
sessionToken: Credentials.SessionToken,
|
58
|
+
expiration: Credentials.Expiration,
|
59
|
+
credentialScope: Credentials.CredentialScope,
|
60
|
+
};
|
61
|
+
};
|
62
|
+
};
|
63
|
+
export const decorateDefaultCredentialProvider = (provider) => (input) => provider({
|
64
|
+
roleAssumer: getDefaultRoleAssumer(input, input.stsClientCtor),
|
65
|
+
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input, input.stsClientCtor),
|
66
|
+
...input,
|
67
|
+
});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export const resolveClientEndpointParameters = (options) => {
|
2
|
+
return {
|
3
|
+
...options,
|
4
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
5
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
6
|
+
useGlobalEndpoint: options.useGlobalEndpoint ?? false,
|
7
|
+
defaultSigningName: "sts",
|
8
|
+
};
|
9
|
+
};
|
10
|
+
export const commonParams = {
|
11
|
+
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
|
12
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
13
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
14
|
+
Region: { type: "builtInParams", name: "region" },
|
15
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
16
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { awsEndpointFunctions } from "@aws-sdk/util-endpoints";
|
2
|
+
import { customEndpointFunctions, resolveEndpoint } from "@smithy/util-endpoints";
|
3
|
+
import { ruleSet } from "./ruleset";
|
4
|
+
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
5
|
+
return resolveEndpoint(ruleSet, {
|
6
|
+
endpointParams: endpointParams,
|
7
|
+
logger: context.logger,
|
8
|
+
});
|
9
|
+
};
|
10
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
const F = "required", G = "type", H = "fn", I = "argv", J = "ref";
|
2
|
+
const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "String" }, n = { [F]: true, "default": false, [G]: "Boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], "assign": "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e, "signingName": f, "signingRegion": g }] }, "headers": {} }, v = {}, w = { "conditions": [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y];
|
3
|
+
const _data = { version: "1.0", parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H]: "not", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G]: h }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: "Invalid Configuration: Missing Region", [G]: k }] };
|
4
|
+
export const ruleSet = _data;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
|
2
|
+
export { __ServiceException };
|
3
|
+
export class STSServiceException extends __ServiceException {
|
4
|
+
constructor(options) {
|
5
|
+
super(options);
|
6
|
+
Object.setPrototypeOf(this, STSServiceException.prototype);
|
7
|
+
}
|
8
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./models_0";
|
@@ -0,0 +1,130 @@
|
|
1
|
+
import { SENSITIVE_STRING } from "@smithy/smithy-client";
|
2
|
+
import { STSServiceException as __BaseException } from "./STSServiceException";
|
3
|
+
export class ExpiredTokenException extends __BaseException {
|
4
|
+
constructor(opts) {
|
5
|
+
super({
|
6
|
+
name: "ExpiredTokenException",
|
7
|
+
$fault: "client",
|
8
|
+
...opts,
|
9
|
+
});
|
10
|
+
this.name = "ExpiredTokenException";
|
11
|
+
this.$fault = "client";
|
12
|
+
Object.setPrototypeOf(this, ExpiredTokenException.prototype);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
export class MalformedPolicyDocumentException extends __BaseException {
|
16
|
+
constructor(opts) {
|
17
|
+
super({
|
18
|
+
name: "MalformedPolicyDocumentException",
|
19
|
+
$fault: "client",
|
20
|
+
...opts,
|
21
|
+
});
|
22
|
+
this.name = "MalformedPolicyDocumentException";
|
23
|
+
this.$fault = "client";
|
24
|
+
Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
export class PackedPolicyTooLargeException extends __BaseException {
|
28
|
+
constructor(opts) {
|
29
|
+
super({
|
30
|
+
name: "PackedPolicyTooLargeException",
|
31
|
+
$fault: "client",
|
32
|
+
...opts,
|
33
|
+
});
|
34
|
+
this.name = "PackedPolicyTooLargeException";
|
35
|
+
this.$fault = "client";
|
36
|
+
Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
export class RegionDisabledException extends __BaseException {
|
40
|
+
constructor(opts) {
|
41
|
+
super({
|
42
|
+
name: "RegionDisabledException",
|
43
|
+
$fault: "client",
|
44
|
+
...opts,
|
45
|
+
});
|
46
|
+
this.name = "RegionDisabledException";
|
47
|
+
this.$fault = "client";
|
48
|
+
Object.setPrototypeOf(this, RegionDisabledException.prototype);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
export class IDPRejectedClaimException extends __BaseException {
|
52
|
+
constructor(opts) {
|
53
|
+
super({
|
54
|
+
name: "IDPRejectedClaimException",
|
55
|
+
$fault: "client",
|
56
|
+
...opts,
|
57
|
+
});
|
58
|
+
this.name = "IDPRejectedClaimException";
|
59
|
+
this.$fault = "client";
|
60
|
+
Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
export class InvalidIdentityTokenException extends __BaseException {
|
64
|
+
constructor(opts) {
|
65
|
+
super({
|
66
|
+
name: "InvalidIdentityTokenException",
|
67
|
+
$fault: "client",
|
68
|
+
...opts,
|
69
|
+
});
|
70
|
+
this.name = "InvalidIdentityTokenException";
|
71
|
+
this.$fault = "client";
|
72
|
+
Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
export class IDPCommunicationErrorException extends __BaseException {
|
76
|
+
constructor(opts) {
|
77
|
+
super({
|
78
|
+
name: "IDPCommunicationErrorException",
|
79
|
+
$fault: "client",
|
80
|
+
...opts,
|
81
|
+
});
|
82
|
+
this.name = "IDPCommunicationErrorException";
|
83
|
+
this.$fault = "client";
|
84
|
+
Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
export class InvalidAuthorizationMessageException extends __BaseException {
|
88
|
+
constructor(opts) {
|
89
|
+
super({
|
90
|
+
name: "InvalidAuthorizationMessageException",
|
91
|
+
$fault: "client",
|
92
|
+
...opts,
|
93
|
+
});
|
94
|
+
this.name = "InvalidAuthorizationMessageException";
|
95
|
+
this.$fault = "client";
|
96
|
+
Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype);
|
97
|
+
}
|
98
|
+
}
|
99
|
+
export const CredentialsFilterSensitiveLog = (obj) => ({
|
100
|
+
...obj,
|
101
|
+
...(obj.SecretAccessKey && { SecretAccessKey: SENSITIVE_STRING }),
|
102
|
+
});
|
103
|
+
export const AssumeRoleResponseFilterSensitiveLog = (obj) => ({
|
104
|
+
...obj,
|
105
|
+
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
106
|
+
});
|
107
|
+
export const AssumeRoleWithSAMLRequestFilterSensitiveLog = (obj) => ({
|
108
|
+
...obj,
|
109
|
+
...(obj.SAMLAssertion && { SAMLAssertion: SENSITIVE_STRING }),
|
110
|
+
});
|
111
|
+
export const AssumeRoleWithSAMLResponseFilterSensitiveLog = (obj) => ({
|
112
|
+
...obj,
|
113
|
+
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
114
|
+
});
|
115
|
+
export const AssumeRoleWithWebIdentityRequestFilterSensitiveLog = (obj) => ({
|
116
|
+
...obj,
|
117
|
+
...(obj.WebIdentityToken && { WebIdentityToken: SENSITIVE_STRING }),
|
118
|
+
});
|
119
|
+
export const AssumeRoleWithWebIdentityResponseFilterSensitiveLog = (obj) => ({
|
120
|
+
...obj,
|
121
|
+
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
122
|
+
});
|
123
|
+
export const GetFederationTokenResponseFilterSensitiveLog = (obj) => ({
|
124
|
+
...obj,
|
125
|
+
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
126
|
+
});
|
127
|
+
export const GetSessionTokenResponseFilterSensitiveLog = (obj) => ({
|
128
|
+
...obj,
|
129
|
+
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
130
|
+
});
|