@cdk8s/awscdk-resolver 0.0.410 → 0.0.412
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/lambda-invoke-store/package.json +2 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +574 -574
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/index.js +2 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/models/enums.js +520 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/models/errors.js +407 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/models/models_0.js +1 -844
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/schemas/schemas_0.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListStackRefactorsCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListStackResourcesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListStackSetAutoDeploymentTargetsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListStackSetOperationResultsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListStackSetOperationsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListStackSetsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListStacksCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListTypeRegistrationsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListTypeVersionsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ListTypesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/PublishTypeCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/RecordHandlerProgressCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/RegisterPublisherCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/RegisterTypeCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/RollbackStackCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/SetStackPolicyCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/SetTypeConfigurationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/SetTypeDefaultVersionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/SignalResourceCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/StartResourceScanCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/StopStackSetOperationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/TestTypeCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/UpdateGeneratedTemplateCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/UpdateStackCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/UpdateStackInstancesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/UpdateStackSetCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/UpdateTerminationProtectionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/ValidateTemplateCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/index.d.ts +3 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/enums.d.ts +1200 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/errors.d.ts +413 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/models_0.d.ts +2937 -1483
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListStackRefactorsCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListStackResourcesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListStackSetAutoDeploymentTargetsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListStackSetOperationResultsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListStackSetOperationsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListStackSetsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListStacksCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListTypeRegistrationsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListTypeVersionsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ListTypesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/PublishTypeCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/RecordHandlerProgressCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/RegisterPublisherCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/RegisterTypeCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/RollbackStackCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/SetStackPolicyCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/SetTypeConfigurationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/SetTypeDefaultVersionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/SignalResourceCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/StartResourceScanCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/StopStackSetOperationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/TestTypeCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/UpdateGeneratedTemplateCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/UpdateStackCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/UpdateStackInstancesCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/UpdateStackSetCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/UpdateTerminationProtectionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/commands/ValidateTemplateCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/index.d.ts +3 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/models/enums.d.ts +669 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/models/errors.d.ts +264 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/models/models_0.d.ts +488 -849
- package/node_modules/@aws-sdk/client-cloudformation/package.json +19 -19
- package/node_modules/@aws-sdk/client-sso/dist-es/index.js +1 -1
- package/node_modules/@aws-sdk/client-sso/dist-es/models/errors.js +49 -0
- package/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js +1 -49
- package/node_modules/@aws-sdk/client-sso/dist-es/schemas/schemas_0.js +1 -1
- package/node_modules/@aws-sdk/client-sso/dist-types/index.d.ts +2 -1
- package/node_modules/@aws-sdk/client-sso/dist-types/models/errors.d.ts +53 -0
- package/node_modules/@aws-sdk/client-sso/dist-types/models/models_0.d.ts +0 -53
- package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/index.d.ts +2 -1
- package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/errors.d.ts +30 -0
- package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/models_0.d.ts +0 -30
- package/node_modules/@aws-sdk/client-sso/package.json +18 -18
- package/node_modules/@aws-sdk/core/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +15 -0
- package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveLoginCredentials.js +12 -0
- package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js +4 -0
- package/node_modules/@aws-sdk/credential-provider-ini/dist-types/fromIni.d.ts +4 -3
- package/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveLoginCredentials.d.ts +10 -0
- package/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/fromIni.d.ts +3 -1
- package/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveLoginCredentials.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +10 -9
- package/node_modules/@aws-sdk/credential-provider-login/README.md +7 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +286 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js +262 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-es/fromLoginCredentials.js +21 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-es/index.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-es/types.js +1 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-types/LoginCredentialsFetcher.d.ts +42 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-types/fromLoginCredentials.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-types/index.d.ts +8 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-types/ts3.4/LoginCredentialsFetcher.d.ts +24 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-types/ts3.4/fromLoginCredentials.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-types/ts3.4/index.d.ts +2 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-types/ts3.4/types.d.ts +39 -0
- package/node_modules/@aws-sdk/credential-provider-login/dist-types/types.d.ts +59 -0
- package/node_modules/@aws-sdk/credential-provider-login/package.json +68 -0
- package/node_modules/@aws-sdk/credential-provider-node/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-host-header/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-logger/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +5 -5
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/auth/httpAuthSchemeProvider.js +56 -0
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/endpointResolver.js +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/ruleset.js +7 -0
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +439 -0
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.browser.js +39 -0
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.js +54 -0
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.native.js +15 -0
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.shared.js +42 -0
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +10 -9
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js +50 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthExtensionConfiguration.js +38 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js +50 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +16 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/index.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/EndpointParameters.js +13 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +14 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/ruleset.js +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/extensionConfiguration.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js +6 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js +8 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +8 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js +57 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/models_0.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +34 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +49 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.native.js +11 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js +38 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +221 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/enums.js +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js +181 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/models_0.js +1 -190
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js +85 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/models_0.js +1 -85
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/Signin.d.ts +18 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +198 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +157 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/endpoint/EndpointParameters.d.ts +38 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/endpoint/endpointResolver.d.ts +5 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/endpoint/ruleset.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/extensionConfiguration.d.ts +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +16 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/SigninServiceException.d.ts +14 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +34 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +102 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/models_0.d.ts +142 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +59 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +59 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +58 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.shared.d.ts +33 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeExtensions.d.ts +17 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/schemas/schemas_0.d.ts +14 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/index.d.ts +3 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/enums.d.ts +25 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/errors.d.ts +279 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/models_0.d.ts +0 -303
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/index.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/errors.d.ts +108 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/models_0.d.ts +0 -108
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/Signin.d.ts +22 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/SigninClient.d.ts +127 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/auth/httpAuthSchemeProvider.d.ts +47 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +47 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/commands/index.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/endpoint/EndpointParameters.d.ts +51 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/endpoint/endpointResolver.d.ts +8 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/endpoint/ruleset.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/extensionConfiguration.d.ts +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/index.d.ts +10 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/SigninServiceException.d.ts +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +10 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/errors.d.ts +35 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/models_0.d.ts +26 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +121 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +114 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +125 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +53 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeExtensions.d.ts +11 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/schemas/schemas_0.d.ts +19 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/index.d.ts +3 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/enums.d.ts +13 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/errors.d.ts +105 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/models_0.d.ts +0 -114
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/index.d.ts +2 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/errors.d.ts +54 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/models_0.d.ts +0 -54
- package/node_modules/@aws-sdk/nested-clients/package.json +29 -18
- package/node_modules/@aws-sdk/nested-clients/signin.d.ts +7 -0
- package/node_modules/@aws-sdk/nested-clients/signin.js +5 -0
- package/node_modules/@aws-sdk/region-config-resolver/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +2 -0
- package/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +2 -0
- package/node_modules/@aws-sdk/types/package.json +1 -1
- package/node_modules/@aws-sdk/util-endpoints/package.json +2 -2
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +2 -2
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +3 -3
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +6 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpBindingProtocol.d.ts +6 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpBindingProtocol.d.ts +6 -2
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
- package/node_modules/@smithy/middleware-retry/package.json +2 -2
- package/node_modules/@smithy/smithy-client/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/package.json +4 -4
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/models/index.js +0 -2
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/models/models_1.js +0 -84
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/index.d.ts +0 -2
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/models_1.d.ts +0 -3069
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/models/index.d.ts +0 -2
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/models/models_1.d.ts +0 -524
- package/node_modules/@aws-sdk/client-sso/dist-es/models/index.js +0 -1
- package/node_modules/@aws-sdk/client-sso/dist-types/models/index.d.ts +0 -1
- package/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/index.d.ts +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/index.js +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/index.js +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/index.d.ts +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/index.d.ts +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/index.d.ts +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/index.d.ts +0 -1
package/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveLoginCredentials.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AwsCredentialIdentity, ParsedIniData } from "@smithy/types";
|
|
2
|
+
import { FromIniInit } from "./fromIni";
|
|
3
|
+
export declare const isLoginProfile: (data: ParsedIniData[string]) => boolean;
|
|
4
|
+
export declare const resolveLoginCredentials: (
|
|
5
|
+
profileName: string,
|
|
6
|
+
options: FromIniInit
|
|
7
|
+
) => Promise<AwsCredentialIdentity>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-ini",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.936.0",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -28,14 +28,15 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aws-sdk/core": "3.
|
|
32
|
-
"@aws-sdk/credential-provider-env": "3.
|
|
33
|
-
"@aws-sdk/credential-provider-http": "3.
|
|
34
|
-
"@aws-sdk/credential-provider-
|
|
35
|
-
"@aws-sdk/credential-provider-
|
|
36
|
-
"@aws-sdk/credential-provider-
|
|
37
|
-
"@aws-sdk/
|
|
38
|
-
"@aws-sdk/
|
|
31
|
+
"@aws-sdk/core": "3.936.0",
|
|
32
|
+
"@aws-sdk/credential-provider-env": "3.936.0",
|
|
33
|
+
"@aws-sdk/credential-provider-http": "3.936.0",
|
|
34
|
+
"@aws-sdk/credential-provider-login": "3.936.0",
|
|
35
|
+
"@aws-sdk/credential-provider-process": "3.936.0",
|
|
36
|
+
"@aws-sdk/credential-provider-sso": "3.936.0",
|
|
37
|
+
"@aws-sdk/credential-provider-web-identity": "3.936.0",
|
|
38
|
+
"@aws-sdk/nested-clients": "3.936.0",
|
|
39
|
+
"@aws-sdk/types": "3.936.0",
|
|
39
40
|
"@smithy/credential-provider-imds": "^4.2.5",
|
|
40
41
|
"@smithy/property-provider": "^4.2.5",
|
|
41
42
|
"@smithy/shared-ini-file-loader": "^4.4.0",
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var client = require('@aws-sdk/core/client');
|
|
4
|
+
var propertyProvider = require('@smithy/property-provider');
|
|
5
|
+
var sharedIniFileLoader = require('@smithy/shared-ini-file-loader');
|
|
6
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
7
|
+
var node_crypto = require('node:crypto');
|
|
8
|
+
var node_fs = require('node:fs');
|
|
9
|
+
var node_os = require('node:os');
|
|
10
|
+
var node_path = require('node:path');
|
|
11
|
+
|
|
12
|
+
class LoginCredentialsFetcher {
|
|
13
|
+
profileData;
|
|
14
|
+
init;
|
|
15
|
+
callerClientConfig;
|
|
16
|
+
static REFRESH_THRESHOLD = 5 * 60 * 1000;
|
|
17
|
+
constructor(profileData, init, callerClientConfig) {
|
|
18
|
+
this.profileData = profileData;
|
|
19
|
+
this.init = init;
|
|
20
|
+
this.callerClientConfig = callerClientConfig;
|
|
21
|
+
}
|
|
22
|
+
async loadCredentials() {
|
|
23
|
+
const token = await this.loadToken();
|
|
24
|
+
if (!token) {
|
|
25
|
+
throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger });
|
|
26
|
+
}
|
|
27
|
+
const accessToken = token.accessToken;
|
|
28
|
+
const now = Date.now();
|
|
29
|
+
const expiryTime = new Date(accessToken.expiresAt).getTime();
|
|
30
|
+
const timeUntilExpiry = expiryTime - now;
|
|
31
|
+
if (timeUntilExpiry <= LoginCredentialsFetcher.REFRESH_THRESHOLD) {
|
|
32
|
+
return this.refresh(token);
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
accessKeyId: accessToken.accessKeyId,
|
|
36
|
+
secretAccessKey: accessToken.secretAccessKey,
|
|
37
|
+
sessionToken: accessToken.sessionToken,
|
|
38
|
+
accountId: accessToken.accountId,
|
|
39
|
+
expiration: new Date(accessToken.expiresAt),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
get logger() {
|
|
43
|
+
return this.init?.logger;
|
|
44
|
+
}
|
|
45
|
+
get loginSession() {
|
|
46
|
+
return this.profileData.login_session;
|
|
47
|
+
}
|
|
48
|
+
async refresh(token) {
|
|
49
|
+
const { SigninClient, CreateOAuth2TokenCommand } = await import('@aws-sdk/nested-clients/signin');
|
|
50
|
+
const { logger, userAgentAppId } = this.callerClientConfig ?? {};
|
|
51
|
+
const isH2 = (requestHandler) => {
|
|
52
|
+
return requestHandler?.metadata?.handlerProtocol === "h2";
|
|
53
|
+
};
|
|
54
|
+
const requestHandler = isH2(this.callerClientConfig?.requestHandler)
|
|
55
|
+
? undefined
|
|
56
|
+
: this.callerClientConfig?.requestHandler;
|
|
57
|
+
const region = this.profileData.region ?? (await this.callerClientConfig?.region?.()) ?? process.env.AWS_REGION;
|
|
58
|
+
const client = new SigninClient({
|
|
59
|
+
credentials: {
|
|
60
|
+
accessKeyId: "",
|
|
61
|
+
secretAccessKey: "",
|
|
62
|
+
},
|
|
63
|
+
region,
|
|
64
|
+
requestHandler,
|
|
65
|
+
logger,
|
|
66
|
+
userAgentAppId,
|
|
67
|
+
...this.init?.clientConfig,
|
|
68
|
+
});
|
|
69
|
+
this.createDPoPInterceptor(client.middlewareStack);
|
|
70
|
+
const commandInput = {
|
|
71
|
+
tokenInput: {
|
|
72
|
+
clientId: token.clientId,
|
|
73
|
+
refreshToken: token.refreshToken,
|
|
74
|
+
grantType: "refresh_token",
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
try {
|
|
78
|
+
const response = await client.send(new CreateOAuth2TokenCommand(commandInput));
|
|
79
|
+
const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {};
|
|
80
|
+
const { refreshToken, expiresIn } = response.tokenOutput ?? {};
|
|
81
|
+
if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) {
|
|
82
|
+
throw new propertyProvider.CredentialsProviderError("Token refresh response missing required fields", {
|
|
83
|
+
logger: this.logger,
|
|
84
|
+
tryNextLink: false,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const expiresInMs = (expiresIn ?? 900) * 1000;
|
|
88
|
+
const expiration = new Date(Date.now() + expiresInMs);
|
|
89
|
+
const updatedToken = {
|
|
90
|
+
...token,
|
|
91
|
+
accessToken: {
|
|
92
|
+
...token.accessToken,
|
|
93
|
+
accessKeyId: accessKeyId,
|
|
94
|
+
secretAccessKey: secretAccessKey,
|
|
95
|
+
sessionToken: sessionToken,
|
|
96
|
+
expiresAt: expiration.toISOString(),
|
|
97
|
+
},
|
|
98
|
+
refreshToken: refreshToken,
|
|
99
|
+
};
|
|
100
|
+
await this.saveToken(updatedToken);
|
|
101
|
+
const newAccessToken = updatedToken.accessToken;
|
|
102
|
+
return {
|
|
103
|
+
accessKeyId: newAccessToken.accessKeyId,
|
|
104
|
+
secretAccessKey: newAccessToken.secretAccessKey,
|
|
105
|
+
sessionToken: newAccessToken.sessionToken,
|
|
106
|
+
accountId: newAccessToken.accountId,
|
|
107
|
+
expiration,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
if (error.name === "AccessDeniedException") {
|
|
112
|
+
const errorType = error.error;
|
|
113
|
+
let message;
|
|
114
|
+
switch (errorType) {
|
|
115
|
+
case "TOKEN_EXPIRED":
|
|
116
|
+
message = "Your session has expired. Please reauthenticate.";
|
|
117
|
+
break;
|
|
118
|
+
case "USER_CREDENTIALS_CHANGED":
|
|
119
|
+
message =
|
|
120
|
+
"Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";
|
|
121
|
+
break;
|
|
122
|
+
case "INSUFFICIENT_PERMISSIONS":
|
|
123
|
+
message =
|
|
124
|
+
"Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";
|
|
125
|
+
break;
|
|
126
|
+
default:
|
|
127
|
+
message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \`aws login\``;
|
|
128
|
+
}
|
|
129
|
+
throw new propertyProvider.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false });
|
|
130
|
+
}
|
|
131
|
+
throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async loadToken() {
|
|
135
|
+
const tokenFilePath = this.getTokenFilePath();
|
|
136
|
+
try {
|
|
137
|
+
let tokenData;
|
|
138
|
+
try {
|
|
139
|
+
tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache });
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
tokenData = await node_fs.promises.readFile(tokenFilePath, "utf8");
|
|
143
|
+
}
|
|
144
|
+
const token = JSON.parse(tokenData);
|
|
145
|
+
const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k) => !token[k]);
|
|
146
|
+
if (!token.accessToken?.accountId) {
|
|
147
|
+
missingFields.push("accountId");
|
|
148
|
+
}
|
|
149
|
+
if (missingFields.length > 0) {
|
|
150
|
+
throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, {
|
|
151
|
+
logger: this.logger,
|
|
152
|
+
tryNextLink: false,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return token;
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, {
|
|
159
|
+
logger: this.logger,
|
|
160
|
+
tryNextLink: false,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
async saveToken(token) {
|
|
165
|
+
const tokenFilePath = this.getTokenFilePath();
|
|
166
|
+
const directory = node_path.dirname(tokenFilePath);
|
|
167
|
+
try {
|
|
168
|
+
await node_fs.promises.mkdir(directory, { recursive: true });
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
}
|
|
172
|
+
await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
|
|
173
|
+
}
|
|
174
|
+
getTokenFilePath() {
|
|
175
|
+
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), ".aws", "login", "cache");
|
|
176
|
+
const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
|
|
177
|
+
const loginSessionSha256 = node_crypto.createHash("sha256").update(loginSessionBytes).digest("hex");
|
|
178
|
+
return node_path.join(directory, `${loginSessionSha256}.json`);
|
|
179
|
+
}
|
|
180
|
+
derToRawSignature(derSignature) {
|
|
181
|
+
let offset = 2;
|
|
182
|
+
if (derSignature[offset] !== 0x02) {
|
|
183
|
+
throw new Error("Invalid DER signature");
|
|
184
|
+
}
|
|
185
|
+
offset++;
|
|
186
|
+
const rLength = derSignature[offset++];
|
|
187
|
+
let r = derSignature.subarray(offset, offset + rLength);
|
|
188
|
+
offset += rLength;
|
|
189
|
+
if (derSignature[offset] !== 0x02) {
|
|
190
|
+
throw new Error("Invalid DER signature");
|
|
191
|
+
}
|
|
192
|
+
offset++;
|
|
193
|
+
const sLength = derSignature[offset++];
|
|
194
|
+
let s = derSignature.subarray(offset, offset + sLength);
|
|
195
|
+
r = r[0] === 0x00 ? r.subarray(1) : r;
|
|
196
|
+
s = s[0] === 0x00 ? s.subarray(1) : s;
|
|
197
|
+
const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]);
|
|
198
|
+
const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]);
|
|
199
|
+
return Buffer.concat([rPadded, sPadded]);
|
|
200
|
+
}
|
|
201
|
+
createDPoPInterceptor(middlewareStack) {
|
|
202
|
+
middlewareStack.add((next) => async (args) => {
|
|
203
|
+
if (protocolHttp.HttpRequest.isInstance(args.request)) {
|
|
204
|
+
const request = args.request;
|
|
205
|
+
const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`;
|
|
206
|
+
const dpop = await this.generateDpop(request.method, actualEndpoint);
|
|
207
|
+
request.headers = {
|
|
208
|
+
...request.headers,
|
|
209
|
+
DPoP: dpop,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
return next(args);
|
|
213
|
+
}, {
|
|
214
|
+
step: "finalizeRequest",
|
|
215
|
+
name: "dpopInterceptor",
|
|
216
|
+
override: true,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
async generateDpop(method = "POST", endpoint) {
|
|
220
|
+
const token = await this.loadToken();
|
|
221
|
+
try {
|
|
222
|
+
const privateKey = node_crypto.createPrivateKey({
|
|
223
|
+
key: token.dpopKey,
|
|
224
|
+
format: "pem",
|
|
225
|
+
type: "sec1",
|
|
226
|
+
});
|
|
227
|
+
const publicKey = node_crypto.createPublicKey(privateKey);
|
|
228
|
+
const publicDer = publicKey.export({ format: "der", type: "spki" });
|
|
229
|
+
let pointStart = -1;
|
|
230
|
+
for (let i = 0; i < publicDer.length; i++) {
|
|
231
|
+
if (publicDer[i] === 0x04) {
|
|
232
|
+
pointStart = i;
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const x = publicDer.slice(pointStart + 1, pointStart + 33);
|
|
237
|
+
const y = publicDer.slice(pointStart + 33, pointStart + 65);
|
|
238
|
+
const header = {
|
|
239
|
+
alg: "ES256",
|
|
240
|
+
typ: "dpop+jwt",
|
|
241
|
+
jwk: {
|
|
242
|
+
kty: "EC",
|
|
243
|
+
crv: "P-256",
|
|
244
|
+
x: x.toString("base64url"),
|
|
245
|
+
y: y.toString("base64url"),
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
const payload = {
|
|
249
|
+
jti: crypto.randomUUID(),
|
|
250
|
+
htm: method,
|
|
251
|
+
htu: endpoint,
|
|
252
|
+
iat: Math.floor(Date.now() / 1000),
|
|
253
|
+
};
|
|
254
|
+
const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url");
|
|
255
|
+
const payloadB64 = Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
256
|
+
const message = `${headerB64}.${payloadB64}`;
|
|
257
|
+
const asn1Signature = node_crypto.sign("sha256", Buffer.from(message), privateKey);
|
|
258
|
+
const rawSignature = this.derToRawSignature(asn1Signature);
|
|
259
|
+
const signatureB64 = rawSignature.toString("base64url");
|
|
260
|
+
return `${message}.${signatureB64}`;
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, { logger: this.logger, tryNextLink: false });
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {
|
|
269
|
+
init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");
|
|
270
|
+
const profiles = await sharedIniFileLoader.parseKnownFiles(init || {});
|
|
271
|
+
const profileName = sharedIniFileLoader.getProfileName({
|
|
272
|
+
profile: init?.profile ?? callerClientConfig?.profile,
|
|
273
|
+
});
|
|
274
|
+
const profile = profiles[profileName];
|
|
275
|
+
if (!profile?.login_session) {
|
|
276
|
+
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {
|
|
277
|
+
tryNextLink: true,
|
|
278
|
+
logger: init?.logger,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig);
|
|
282
|
+
const credentials = await fetcher.loadCredentials();
|
|
283
|
+
return client.setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD");
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
exports.fromLoginCredentials = fromLoginCredentials;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { CredentialsProviderError } from "@smithy/property-provider";
|
|
2
|
+
import { HttpRequest } from "@smithy/protocol-http";
|
|
3
|
+
import { readFile } from "@smithy/shared-ini-file-loader";
|
|
4
|
+
import { createHash, createPrivateKey, createPublicKey, sign } from "node:crypto";
|
|
5
|
+
import { promises as fs } from "node:fs";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
export class LoginCredentialsFetcher {
|
|
9
|
+
profileData;
|
|
10
|
+
init;
|
|
11
|
+
callerClientConfig;
|
|
12
|
+
static REFRESH_THRESHOLD = 5 * 60 * 1000;
|
|
13
|
+
constructor(profileData, init, callerClientConfig) {
|
|
14
|
+
this.profileData = profileData;
|
|
15
|
+
this.init = init;
|
|
16
|
+
this.callerClientConfig = callerClientConfig;
|
|
17
|
+
}
|
|
18
|
+
async loadCredentials() {
|
|
19
|
+
const token = await this.loadToken();
|
|
20
|
+
if (!token) {
|
|
21
|
+
throw new CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger });
|
|
22
|
+
}
|
|
23
|
+
const accessToken = token.accessToken;
|
|
24
|
+
const now = Date.now();
|
|
25
|
+
const expiryTime = new Date(accessToken.expiresAt).getTime();
|
|
26
|
+
const timeUntilExpiry = expiryTime - now;
|
|
27
|
+
if (timeUntilExpiry <= LoginCredentialsFetcher.REFRESH_THRESHOLD) {
|
|
28
|
+
return this.refresh(token);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
accessKeyId: accessToken.accessKeyId,
|
|
32
|
+
secretAccessKey: accessToken.secretAccessKey,
|
|
33
|
+
sessionToken: accessToken.sessionToken,
|
|
34
|
+
accountId: accessToken.accountId,
|
|
35
|
+
expiration: new Date(accessToken.expiresAt),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
get logger() {
|
|
39
|
+
return this.init?.logger;
|
|
40
|
+
}
|
|
41
|
+
get loginSession() {
|
|
42
|
+
return this.profileData.login_session;
|
|
43
|
+
}
|
|
44
|
+
async refresh(token) {
|
|
45
|
+
const { SigninClient, CreateOAuth2TokenCommand } = await import("@aws-sdk/nested-clients/signin");
|
|
46
|
+
const { logger, userAgentAppId } = this.callerClientConfig ?? {};
|
|
47
|
+
const isH2 = (requestHandler) => {
|
|
48
|
+
return requestHandler?.metadata?.handlerProtocol === "h2";
|
|
49
|
+
};
|
|
50
|
+
const requestHandler = isH2(this.callerClientConfig?.requestHandler)
|
|
51
|
+
? undefined
|
|
52
|
+
: this.callerClientConfig?.requestHandler;
|
|
53
|
+
const region = this.profileData.region ?? (await this.callerClientConfig?.region?.()) ?? process.env.AWS_REGION;
|
|
54
|
+
const client = new SigninClient({
|
|
55
|
+
credentials: {
|
|
56
|
+
accessKeyId: "",
|
|
57
|
+
secretAccessKey: "",
|
|
58
|
+
},
|
|
59
|
+
region,
|
|
60
|
+
requestHandler,
|
|
61
|
+
logger,
|
|
62
|
+
userAgentAppId,
|
|
63
|
+
...this.init?.clientConfig,
|
|
64
|
+
});
|
|
65
|
+
this.createDPoPInterceptor(client.middlewareStack);
|
|
66
|
+
const commandInput = {
|
|
67
|
+
tokenInput: {
|
|
68
|
+
clientId: token.clientId,
|
|
69
|
+
refreshToken: token.refreshToken,
|
|
70
|
+
grantType: "refresh_token",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
try {
|
|
74
|
+
const response = await client.send(new CreateOAuth2TokenCommand(commandInput));
|
|
75
|
+
const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {};
|
|
76
|
+
const { refreshToken, expiresIn } = response.tokenOutput ?? {};
|
|
77
|
+
if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) {
|
|
78
|
+
throw new CredentialsProviderError("Token refresh response missing required fields", {
|
|
79
|
+
logger: this.logger,
|
|
80
|
+
tryNextLink: false,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const expiresInMs = (expiresIn ?? 900) * 1000;
|
|
84
|
+
const expiration = new Date(Date.now() + expiresInMs);
|
|
85
|
+
const updatedToken = {
|
|
86
|
+
...token,
|
|
87
|
+
accessToken: {
|
|
88
|
+
...token.accessToken,
|
|
89
|
+
accessKeyId: accessKeyId,
|
|
90
|
+
secretAccessKey: secretAccessKey,
|
|
91
|
+
sessionToken: sessionToken,
|
|
92
|
+
expiresAt: expiration.toISOString(),
|
|
93
|
+
},
|
|
94
|
+
refreshToken: refreshToken,
|
|
95
|
+
};
|
|
96
|
+
await this.saveToken(updatedToken);
|
|
97
|
+
const newAccessToken = updatedToken.accessToken;
|
|
98
|
+
return {
|
|
99
|
+
accessKeyId: newAccessToken.accessKeyId,
|
|
100
|
+
secretAccessKey: newAccessToken.secretAccessKey,
|
|
101
|
+
sessionToken: newAccessToken.sessionToken,
|
|
102
|
+
accountId: newAccessToken.accountId,
|
|
103
|
+
expiration,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
if (error.name === "AccessDeniedException") {
|
|
108
|
+
const errorType = error.error;
|
|
109
|
+
let message;
|
|
110
|
+
switch (errorType) {
|
|
111
|
+
case "TOKEN_EXPIRED":
|
|
112
|
+
message = "Your session has expired. Please reauthenticate.";
|
|
113
|
+
break;
|
|
114
|
+
case "USER_CREDENTIALS_CHANGED":
|
|
115
|
+
message =
|
|
116
|
+
"Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";
|
|
117
|
+
break;
|
|
118
|
+
case "INSUFFICIENT_PERMISSIONS":
|
|
119
|
+
message =
|
|
120
|
+
"Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \`aws login\``;
|
|
124
|
+
}
|
|
125
|
+
throw new CredentialsProviderError(message, { logger: this.logger, tryNextLink: false });
|
|
126
|
+
}
|
|
127
|
+
throw new CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async loadToken() {
|
|
131
|
+
const tokenFilePath = this.getTokenFilePath();
|
|
132
|
+
try {
|
|
133
|
+
let tokenData;
|
|
134
|
+
try {
|
|
135
|
+
tokenData = await readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache });
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
tokenData = await fs.readFile(tokenFilePath, "utf8");
|
|
139
|
+
}
|
|
140
|
+
const token = JSON.parse(tokenData);
|
|
141
|
+
const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k) => !token[k]);
|
|
142
|
+
if (!token.accessToken?.accountId) {
|
|
143
|
+
missingFields.push("accountId");
|
|
144
|
+
}
|
|
145
|
+
if (missingFields.length > 0) {
|
|
146
|
+
throw new CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, {
|
|
147
|
+
logger: this.logger,
|
|
148
|
+
tryNextLink: false,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return token;
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
throw new CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, {
|
|
155
|
+
logger: this.logger,
|
|
156
|
+
tryNextLink: false,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async saveToken(token) {
|
|
161
|
+
const tokenFilePath = this.getTokenFilePath();
|
|
162
|
+
const directory = dirname(tokenFilePath);
|
|
163
|
+
try {
|
|
164
|
+
await fs.mkdir(directory, { recursive: true });
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
}
|
|
168
|
+
await fs.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
|
|
169
|
+
}
|
|
170
|
+
getTokenFilePath() {
|
|
171
|
+
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join(homedir(), ".aws", "login", "cache");
|
|
172
|
+
const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
|
|
173
|
+
const loginSessionSha256 = createHash("sha256").update(loginSessionBytes).digest("hex");
|
|
174
|
+
return join(directory, `${loginSessionSha256}.json`);
|
|
175
|
+
}
|
|
176
|
+
derToRawSignature(derSignature) {
|
|
177
|
+
let offset = 2;
|
|
178
|
+
if (derSignature[offset] !== 0x02) {
|
|
179
|
+
throw new Error("Invalid DER signature");
|
|
180
|
+
}
|
|
181
|
+
offset++;
|
|
182
|
+
const rLength = derSignature[offset++];
|
|
183
|
+
let r = derSignature.subarray(offset, offset + rLength);
|
|
184
|
+
offset += rLength;
|
|
185
|
+
if (derSignature[offset] !== 0x02) {
|
|
186
|
+
throw new Error("Invalid DER signature");
|
|
187
|
+
}
|
|
188
|
+
offset++;
|
|
189
|
+
const sLength = derSignature[offset++];
|
|
190
|
+
let s = derSignature.subarray(offset, offset + sLength);
|
|
191
|
+
r = r[0] === 0x00 ? r.subarray(1) : r;
|
|
192
|
+
s = s[0] === 0x00 ? s.subarray(1) : s;
|
|
193
|
+
const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]);
|
|
194
|
+
const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]);
|
|
195
|
+
return Buffer.concat([rPadded, sPadded]);
|
|
196
|
+
}
|
|
197
|
+
createDPoPInterceptor(middlewareStack) {
|
|
198
|
+
middlewareStack.add((next) => async (args) => {
|
|
199
|
+
if (HttpRequest.isInstance(args.request)) {
|
|
200
|
+
const request = args.request;
|
|
201
|
+
const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`;
|
|
202
|
+
const dpop = await this.generateDpop(request.method, actualEndpoint);
|
|
203
|
+
request.headers = {
|
|
204
|
+
...request.headers,
|
|
205
|
+
DPoP: dpop,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
return next(args);
|
|
209
|
+
}, {
|
|
210
|
+
step: "finalizeRequest",
|
|
211
|
+
name: "dpopInterceptor",
|
|
212
|
+
override: true,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
async generateDpop(method = "POST", endpoint) {
|
|
216
|
+
const token = await this.loadToken();
|
|
217
|
+
try {
|
|
218
|
+
const privateKey = createPrivateKey({
|
|
219
|
+
key: token.dpopKey,
|
|
220
|
+
format: "pem",
|
|
221
|
+
type: "sec1",
|
|
222
|
+
});
|
|
223
|
+
const publicKey = createPublicKey(privateKey);
|
|
224
|
+
const publicDer = publicKey.export({ format: "der", type: "spki" });
|
|
225
|
+
let pointStart = -1;
|
|
226
|
+
for (let i = 0; i < publicDer.length; i++) {
|
|
227
|
+
if (publicDer[i] === 0x04) {
|
|
228
|
+
pointStart = i;
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const x = publicDer.slice(pointStart + 1, pointStart + 33);
|
|
233
|
+
const y = publicDer.slice(pointStart + 33, pointStart + 65);
|
|
234
|
+
const header = {
|
|
235
|
+
alg: "ES256",
|
|
236
|
+
typ: "dpop+jwt",
|
|
237
|
+
jwk: {
|
|
238
|
+
kty: "EC",
|
|
239
|
+
crv: "P-256",
|
|
240
|
+
x: x.toString("base64url"),
|
|
241
|
+
y: y.toString("base64url"),
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
const payload = {
|
|
245
|
+
jti: crypto.randomUUID(),
|
|
246
|
+
htm: method,
|
|
247
|
+
htu: endpoint,
|
|
248
|
+
iat: Math.floor(Date.now() / 1000),
|
|
249
|
+
};
|
|
250
|
+
const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url");
|
|
251
|
+
const payloadB64 = Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
252
|
+
const message = `${headerB64}.${payloadB64}`;
|
|
253
|
+
const asn1Signature = sign("sha256", Buffer.from(message), privateKey);
|
|
254
|
+
const rawSignature = this.derToRawSignature(asn1Signature);
|
|
255
|
+
const signatureB64 = rawSignature.toString("base64url");
|
|
256
|
+
return `${message}.${signatureB64}`;
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
throw new CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, { logger: this.logger, tryNextLink: false });
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { setCredentialFeature } from "@aws-sdk/core/client";
|
|
2
|
+
import { CredentialsProviderError } from "@smithy/property-provider";
|
|
3
|
+
import { getProfileName, parseKnownFiles } from "@smithy/shared-ini-file-loader";
|
|
4
|
+
import { LoginCredentialsFetcher } from "./LoginCredentialsFetcher";
|
|
5
|
+
export const fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {
|
|
6
|
+
init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");
|
|
7
|
+
const profiles = await parseKnownFiles(init || {});
|
|
8
|
+
const profileName = getProfileName({
|
|
9
|
+
profile: init?.profile ?? callerClientConfig?.profile,
|
|
10
|
+
});
|
|
11
|
+
const profile = profiles[profileName];
|
|
12
|
+
if (!profile?.login_session) {
|
|
13
|
+
throw new CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {
|
|
14
|
+
tryNextLink: true,
|
|
15
|
+
logger: init?.logger,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig);
|
|
19
|
+
const credentials = await fetcher.loadCredentials();
|
|
20
|
+
return setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD");
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/node_modules/@aws-sdk/credential-provider-login/dist-types/LoginCredentialsFetcher.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AwsCredentialIdentity, AwsIdentityProperties } from "@aws-sdk/types";
|
|
2
|
+
import type { IniSection } from "@smithy/types";
|
|
3
|
+
import type { FromLoginCredentialsInit } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Handles loading and refreshing Sign-In credentials from cached tokens.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class LoginCredentialsFetcher {
|
|
9
|
+
private readonly profileData;
|
|
10
|
+
private readonly init?;
|
|
11
|
+
private readonly callerClientConfig?;
|
|
12
|
+
private static readonly REFRESH_THRESHOLD;
|
|
13
|
+
constructor(profileData: IniSection, init?: FromLoginCredentialsInit | undefined, callerClientConfig?: AwsIdentityProperties["callerClientConfig"]);
|
|
14
|
+
/**
|
|
15
|
+
* Loads credentials and refreshes if necessary
|
|
16
|
+
*/
|
|
17
|
+
loadCredentials(): Promise<AwsCredentialIdentity>;
|
|
18
|
+
private get logger();
|
|
19
|
+
private get loginSession();
|
|
20
|
+
private refresh;
|
|
21
|
+
private loadToken;
|
|
22
|
+
private saveToken;
|
|
23
|
+
private getTokenFilePath;
|
|
24
|
+
/**
|
|
25
|
+
* Converts ASN.1 DER encoded ECDSA signature to raw r||s format.
|
|
26
|
+
* raw format is a fixed 64-byte concatenation of r and s values (32 bytes each).
|
|
27
|
+
*
|
|
28
|
+
* References:
|
|
29
|
+
* - ECDSA algorithm: https://thecopenhagenbook.com/cryptography/ecdsa
|
|
30
|
+
* - ASN.1 DER encoding: https://www.rfc-editor.org/rfc/rfc5480#section-2.2
|
|
31
|
+
*
|
|
32
|
+
* @param derSignature - ASN.1 DER encoded signature from crypto.sign()
|
|
33
|
+
* @returns Raw signature as 64-byte buffer (32-byte r + 32-byte s)
|
|
34
|
+
*/
|
|
35
|
+
private derToRawSignature;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a DPoP interceptor that updates the DPoP header with the actual resolved endpoint
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
private createDPoPInterceptor;
|
|
41
|
+
private generateDpop;
|
|
42
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RuntimeConfigAwsCredentialIdentityProvider } from "@aws-sdk/types";
|
|
2
|
+
import type { FromLoginCredentialsInit } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a credential provider that sources credentials from aws login cached tokens
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const fromLoginCredentials: (init?: FromLoginCredentialsInit) => RuntimeConfigAwsCredentialIdentityProvider;
|