@psnext/slingcli 2.5.20260615-2 → 2.5.20260617-2
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/node_modules/@aws-sdk/core/dist-cjs/index.js +45 -50
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +2 -4
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +21 -22
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +51 -51
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +21 -22
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +19 -21
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +107 -109
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -4
- package/node_modules/@aws-sdk/core/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +4 -6
- package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +3 -7
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +12 -16
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +16 -21
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +14 -18
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +1 -5
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.browser.js +2 -5
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +2 -7
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +47 -41
- package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js +8 -4
- package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js +14 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +31 -33
- package/node_modules/@aws-sdk/credential-provider-login/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +16 -18
- package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +11 -13
- package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +22 -24
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BGYXHf8s.js +3 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +26 -28
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +10 -14
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +2 -6
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +3 -27
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
- package/node_modules/@aws-sdk/eventstream-handler-node/dist-cjs/index.js +7 -9
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js +3 -5
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js +16 -18
- package/node_modules/@aws-sdk/middleware-websocket/package.json +6 -6
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +82 -84
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +158 -119
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +80 -82
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +80 -82
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +99 -101
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +4 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +70 -35
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +3 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +12 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +3 -0
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/package.json +9 -8
- package/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +4 -6
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +5 -5
- package/node_modules/@aws-sdk/types/dist-cjs/index.js +7 -8
- package/node_modules/@aws-sdk/types/package.json +4 -4
- package/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js +0 -2
- package/node_modules/@aws-sdk/util-locate-window/package.json +4 -4
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +2 -4
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js +4 -7
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +2 -5
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +7 -10
- package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +21 -57
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +277 -175
- package/node_modules/@earendil-works/pi-ai/dist/models.js +4 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +52 -34
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +11 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +7 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +15 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +18 -17
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +21 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +8 -7
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +17 -22
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js +44 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bun/restore-sandbox-env.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +10 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +8 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +10 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/vendor/marked.min.js +75 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +17 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +8 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.js +19 -19
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +6 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +17 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/session-selector.js +0 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +6 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js +23 -5
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +17 -17
- package/node_modules/@earendil-works/pi-coding-agent/package.json +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +5 -1
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/@smithy/core/dist-cjs/index.js +13 -15
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +29 -31
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +2 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +7 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +3 -5
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +22 -23
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +10 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +38 -39
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +10 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +14 -17
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +20 -23
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +9 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +11 -13
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +59 -60
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +23 -24
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +25 -26
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +5 -7
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +4 -6
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +23 -25
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +4 -6
- package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +2 -4
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
- package/node_modules/@smithy/core/package.json +7 -6
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +23 -24
- package/node_modules/@smithy/credential-provider-imds/package.json +6 -6
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +6 -8
- package/node_modules/@smithy/fetch-http-handler/package.json +7 -7
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +27 -29
- package/node_modules/@smithy/signature-v4/package.json +6 -6
- package/node_modules/@smithy/types/dist-cjs/index.js +23 -18
- package/node_modules/@smithy/types/package.json +4 -4
- package/node_modules/marked/README.md +13 -4
- package/node_modules/marked/bin/main.js +16 -14
- package/node_modules/marked/bin/marked.js +2 -1
- package/node_modules/marked/lib/marked.d.ts +157 -125
- package/node_modules/marked/lib/marked.esm.js +67 -2179
- package/node_modules/marked/lib/marked.esm.js.map +3 -3
- package/node_modules/marked/lib/marked.umd.js +67 -2201
- package/node_modules/marked/lib/marked.umd.js.map +3 -3
- package/node_modules/marked/man/marked.1 +4 -2
- package/node_modules/marked/man/marked.1.md +2 -1
- package/node_modules/marked/package.json +27 -35
- package/node_modules/undici/docs/docs/api/Client.md +3 -0
- package/node_modules/undici/docs/docs/api/Cookies.md +27 -0
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +1 -0
- package/node_modules/undici/lib/core/socks5-client.js +14 -4
- package/node_modules/undici/lib/core/socks5-utils.js +18 -4
- package/node_modules/undici/lib/dispatcher/agent.js +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/client-h1.js +69 -1
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +19 -0
- package/node_modules/undici/lib/dispatcher/pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +2 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +45 -34
- package/node_modules/undici/lib/util/cache.js +8 -2
- package/node_modules/undici/lib/web/cookies/parse.js +17 -25
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +13 -31
- package/node_modules/undici/lib/web/websocket/receiver.js +80 -23
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -1
- package/node_modules/undici/lib/web/websocket/websocket.js +8 -1
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +16 -0
- package/package.json +6 -6
- package/slingshot/index.js +253 -253
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js +0 -8
- package/node_modules/marked/lib/marked.cjs +0 -2211
- package/node_modules/marked/lib/marked.cjs.map +0 -7
- package/node_modules/marked/lib/marked.d.cts +0 -728
- package/node_modules/marked/marked.min.js +0 -69
- /package/node_modules/marked/{LICENSE.md → LICENSE} +0 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var node_util = require('node:util');
|
|
6
|
-
var client = require('@aws-sdk/core/client');
|
|
1
|
+
const { externalDataInterceptor, CredentialsProviderError, parseKnownFiles, getProfileName } = require("@smithy/core/config");
|
|
2
|
+
const { exec } = require("node:child_process");
|
|
3
|
+
const { promisify } = require("node:util");
|
|
4
|
+
const { setCredentialFeature } = require("@aws-sdk/core/client");
|
|
7
5
|
|
|
8
6
|
const getValidatedProcessCredentials = (profileName, data, profiles) => {
|
|
9
7
|
if (data.Version !== 1) {
|
|
@@ -31,7 +29,7 @@ const getValidatedProcessCredentials = (profileName, data, profiles) => {
|
|
|
31
29
|
...(data.CredentialScope && { credentialScope: data.CredentialScope }),
|
|
32
30
|
...(accountId && { accountId }),
|
|
33
31
|
};
|
|
34
|
-
|
|
32
|
+
setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
|
|
35
33
|
return credentials;
|
|
36
34
|
};
|
|
37
35
|
|
|
@@ -40,7 +38,7 @@ const resolveProcessCredentials = async (profileName, profiles, logger) => {
|
|
|
40
38
|
if (profiles[profileName]) {
|
|
41
39
|
const credentialProcess = profile["credential_process"];
|
|
42
40
|
if (credentialProcess !== undefined) {
|
|
43
|
-
const execPromise =
|
|
41
|
+
const execPromise = promisify(externalDataInterceptor?.getTokenRecord?.().exec ?? exec);
|
|
44
42
|
try {
|
|
45
43
|
const { stdout } = await execPromise(credentialProcess);
|
|
46
44
|
let data;
|
|
@@ -53,15 +51,15 @@ const resolveProcessCredentials = async (profileName, profiles, logger) => {
|
|
|
53
51
|
return getValidatedProcessCredentials(profileName, data, profiles);
|
|
54
52
|
}
|
|
55
53
|
catch (error) {
|
|
56
|
-
throw new
|
|
54
|
+
throw new CredentialsProviderError(error.message, { logger });
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
else {
|
|
60
|
-
throw new
|
|
58
|
+
throw new CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
else {
|
|
64
|
-
throw new
|
|
62
|
+
throw new CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
|
|
65
63
|
logger,
|
|
66
64
|
});
|
|
67
65
|
}
|
|
@@ -69,8 +67,8 @@ const resolveProcessCredentials = async (profileName, profiles, logger) => {
|
|
|
69
67
|
|
|
70
68
|
const fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
71
69
|
init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
|
|
72
|
-
const profiles = await
|
|
73
|
-
return resolveProcessCredentials(
|
|
70
|
+
const profiles = await parseKnownFiles(init);
|
|
71
|
+
return resolveProcessCredentials(getProfileName({
|
|
74
72
|
profile: init.profile ?? callerClientConfig?.profile,
|
|
75
73
|
}), profiles, init.logger);
|
|
76
74
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-process",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.47",
|
|
4
4
|
"description": "AWS credential provider that sources credential_process from ~/.aws/credentials and ~/.aws/config",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
9
9
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
10
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
10
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
11
11
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
12
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
12
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
13
13
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
14
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
14
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
15
15
|
"test": "yarn g:vitest run",
|
|
16
16
|
"test:watch": "yarn g:vitest watch"
|
|
17
17
|
},
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aws-sdk/core": "^3.974.
|
|
30
|
-
"@aws-sdk/types": "^3.973.
|
|
29
|
+
"@aws-sdk/core": "^3.974.21",
|
|
30
|
+
"@aws-sdk/types": "^3.973.13",
|
|
31
31
|
"@smithy/core": "^3.24.6",
|
|
32
32
|
"@smithy/types": "^4.14.3",
|
|
33
33
|
"tslib": "^2.6.2"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var client = require('@aws-sdk/core/client');
|
|
5
|
-
var tokenProviders = require('@aws-sdk/token-providers');
|
|
1
|
+
const { CredentialsProviderError, getSSOTokenFromFile, getProfileName, parseKnownFiles, loadSsoSessionData } = require("@smithy/core/config");
|
|
2
|
+
const { setCredentialFeature } = require("@aws-sdk/core/client");
|
|
3
|
+
const { fromSso } = require("@aws-sdk/token-providers");
|
|
6
4
|
|
|
7
5
|
const isSsoProfile = (arg) => arg &&
|
|
8
6
|
(typeof arg.sso_start_url === "string" ||
|
|
@@ -17,7 +15,7 @@ const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ss
|
|
|
17
15
|
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
|
|
18
16
|
if (ssoSession) {
|
|
19
17
|
try {
|
|
20
|
-
const _token = await
|
|
18
|
+
const _token = await fromSso({
|
|
21
19
|
profile,
|
|
22
20
|
filepath,
|
|
23
21
|
configFilepath,
|
|
@@ -32,7 +30,7 @@ const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ss
|
|
|
32
30
|
};
|
|
33
31
|
}
|
|
34
32
|
catch (e) {
|
|
35
|
-
throw new
|
|
33
|
+
throw new CredentialsProviderError(e.message, {
|
|
36
34
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
37
35
|
logger,
|
|
38
36
|
});
|
|
@@ -40,23 +38,23 @@ const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ss
|
|
|
40
38
|
}
|
|
41
39
|
else {
|
|
42
40
|
try {
|
|
43
|
-
token = await
|
|
41
|
+
token = await getSSOTokenFromFile(ssoStartUrl);
|
|
44
42
|
}
|
|
45
43
|
catch (e) {
|
|
46
|
-
throw new
|
|
44
|
+
throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
|
|
47
45
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
48
46
|
logger,
|
|
49
47
|
});
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
|
|
53
|
-
throw new
|
|
51
|
+
throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
|
|
54
52
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
55
53
|
logger,
|
|
56
54
|
});
|
|
57
55
|
}
|
|
58
56
|
const { accessToken } = token;
|
|
59
|
-
const { SSOClient, GetRoleCredentialsCommand } =
|
|
57
|
+
const { SSOClient, GetRoleCredentialsCommand } = require('./loadSso-BGYXHf8s.js');
|
|
60
58
|
const sso = ssoClient ||
|
|
61
59
|
new SSOClient(Object.assign({}, clientConfig ?? {}, {
|
|
62
60
|
logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,
|
|
@@ -72,14 +70,14 @@ const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ss
|
|
|
72
70
|
}));
|
|
73
71
|
}
|
|
74
72
|
catch (e) {
|
|
75
|
-
throw new
|
|
73
|
+
throw new CredentialsProviderError(e, {
|
|
76
74
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
77
75
|
logger,
|
|
78
76
|
});
|
|
79
77
|
}
|
|
80
78
|
const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}, } = ssoResp;
|
|
81
79
|
if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
|
|
82
|
-
throw new
|
|
80
|
+
throw new CredentialsProviderError("SSO returns an invalid temporary credential.", {
|
|
83
81
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
84
82
|
logger,
|
|
85
83
|
});
|
|
@@ -93,10 +91,10 @@ const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ss
|
|
|
93
91
|
...(accountId && { accountId }),
|
|
94
92
|
};
|
|
95
93
|
if (ssoSession) {
|
|
96
|
-
|
|
94
|
+
setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
|
|
97
95
|
}
|
|
98
96
|
else {
|
|
99
|
-
|
|
97
|
+
setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
|
|
100
98
|
}
|
|
101
99
|
return credentials;
|
|
102
100
|
};
|
|
@@ -104,7 +102,7 @@ const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ss
|
|
|
104
102
|
const validateSsoProfile = (profile, logger) => {
|
|
105
103
|
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
|
|
106
104
|
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
|
|
107
|
-
throw new
|
|
105
|
+
throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` +
|
|
108
106
|
`"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });
|
|
109
107
|
}
|
|
110
108
|
return profile;
|
|
@@ -114,32 +112,32 @@ const fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
|
114
112
|
init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
|
|
115
113
|
const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
|
|
116
114
|
const { ssoClient } = init;
|
|
117
|
-
const profileName =
|
|
115
|
+
const profileName = getProfileName({
|
|
118
116
|
profile: init.profile ?? callerClientConfig?.profile,
|
|
119
117
|
});
|
|
120
118
|
if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
|
|
121
|
-
const profiles = await
|
|
119
|
+
const profiles = await parseKnownFiles(init);
|
|
122
120
|
const profile = profiles[profileName];
|
|
123
121
|
if (!profile) {
|
|
124
|
-
throw new
|
|
122
|
+
throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
|
|
125
123
|
}
|
|
126
124
|
if (!isSsoProfile(profile)) {
|
|
127
|
-
throw new
|
|
125
|
+
throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
|
|
128
126
|
logger: init.logger,
|
|
129
127
|
});
|
|
130
128
|
}
|
|
131
129
|
if (profile?.sso_session) {
|
|
132
|
-
const ssoSessions = await
|
|
130
|
+
const ssoSessions = await loadSsoSessionData(init);
|
|
133
131
|
const session = ssoSessions[profile.sso_session];
|
|
134
132
|
const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
|
|
135
133
|
if (ssoRegion && ssoRegion !== session.sso_region) {
|
|
136
|
-
throw new
|
|
134
|
+
throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
|
|
137
135
|
tryNextLink: false,
|
|
138
136
|
logger: init.logger,
|
|
139
137
|
});
|
|
140
138
|
}
|
|
141
139
|
if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
|
|
142
|
-
throw new
|
|
140
|
+
throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
|
|
143
141
|
tryNextLink: false,
|
|
144
142
|
logger: init.logger,
|
|
145
143
|
});
|
|
@@ -166,7 +164,7 @@ const fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
|
166
164
|
});
|
|
167
165
|
}
|
|
168
166
|
else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
|
|
169
|
-
throw new
|
|
167
|
+
throw new CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " +
|
|
170
168
|
'"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger });
|
|
171
169
|
}
|
|
172
170
|
else {
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var config = require('@smithy/core/config');
|
|
6
|
-
var node_fs = require('node:fs');
|
|
1
|
+
const { setTokenFeature } = require("@aws-sdk/core/client");
|
|
2
|
+
const { getBearerTokenEnvKey } = require("@aws-sdk/core/httpAuthSchemes");
|
|
3
|
+
const { TokenProviderError, getSSOTokenFilepath, parseKnownFiles, getProfileName, loadSsoSessionData, getSSOTokenFromFile, memoize, chain } = require("@smithy/core/config");
|
|
4
|
+
const { promises } = require("node:fs");
|
|
7
5
|
|
|
8
6
|
const fromEnvSigningName = ({ logger, signingName } = {}) => async () => {
|
|
9
7
|
logger?.debug?.("@aws-sdk/token-providers - fromEnvSigningName");
|
|
10
8
|
if (!signingName) {
|
|
11
|
-
throw new
|
|
9
|
+
throw new TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger });
|
|
12
10
|
}
|
|
13
|
-
const bearerTokenKey =
|
|
11
|
+
const bearerTokenKey = getBearerTokenEnvKey(signingName);
|
|
14
12
|
if (!(bearerTokenKey in process.env)) {
|
|
15
|
-
throw new
|
|
13
|
+
throw new TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger });
|
|
16
14
|
}
|
|
17
15
|
const token = { token: process.env[bearerTokenKey] };
|
|
18
|
-
|
|
16
|
+
setTokenFeature(token, "BEARER_SERVICE_ENV_VARS", "3");
|
|
19
17
|
return token;
|
|
20
18
|
};
|
|
21
19
|
|
|
@@ -23,7 +21,7 @@ const EXPIRE_WINDOW_MS = 5 * 60 * 1000;
|
|
|
23
21
|
const REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
|
|
24
22
|
|
|
25
23
|
const getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
|
|
26
|
-
const { SSOOIDCClient } =
|
|
24
|
+
const { SSOOIDCClient } = require('@aws-sdk/nested-clients/sso-oidc');
|
|
27
25
|
const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];
|
|
28
26
|
const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
|
|
29
27
|
region: ssoRegion ?? init.clientConfig?.region,
|
|
@@ -34,7 +32,7 @@ const getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
|
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
const getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
|
|
37
|
-
const { CreateTokenCommand } =
|
|
35
|
+
const { CreateTokenCommand } = require('@aws-sdk/nested-clients/sso-oidc');
|
|
38
36
|
const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
|
|
39
37
|
return ssoOidcClient.send(new CreateTokenCommand({
|
|
40
38
|
clientId: ssoToken.clientId,
|
|
@@ -46,19 +44,19 @@ const getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientCo
|
|
|
46
44
|
|
|
47
45
|
const validateTokenExpiry = (token) => {
|
|
48
46
|
if (token.expiration && token.expiration.getTime() < Date.now()) {
|
|
49
|
-
throw new
|
|
47
|
+
throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
50
|
|
|
53
51
|
const validateTokenKey = (key, value, forRefresh = false) => {
|
|
54
52
|
if (typeof value === "undefined") {
|
|
55
|
-
throw new
|
|
53
|
+
throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
|
|
56
54
|
}
|
|
57
55
|
};
|
|
58
56
|
|
|
59
|
-
const { writeFile } =
|
|
57
|
+
const { writeFile } = promises;
|
|
60
58
|
const writeSSOTokenToFile = (id, ssoToken) => {
|
|
61
|
-
const tokenFilepath =
|
|
59
|
+
const tokenFilepath = getSSOTokenFilepath(id);
|
|
62
60
|
const tokenString = JSON.stringify(ssoToken, null, 2);
|
|
63
61
|
return writeFile(tokenFilepath, tokenString);
|
|
64
62
|
};
|
|
@@ -66,36 +64,36 @@ const writeSSOTokenToFile = (id, ssoToken) => {
|
|
|
66
64
|
const lastRefreshAttemptTime = new Date(0);
|
|
67
65
|
const fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
68
66
|
init.logger?.debug("@aws-sdk/token-providers - fromSso");
|
|
69
|
-
const profiles = await
|
|
70
|
-
const profileName =
|
|
67
|
+
const profiles = await parseKnownFiles(init);
|
|
68
|
+
const profileName = getProfileName({
|
|
71
69
|
profile: init.profile ?? callerClientConfig?.profile,
|
|
72
70
|
});
|
|
73
71
|
const profile = profiles[profileName];
|
|
74
72
|
if (!profile) {
|
|
75
|
-
throw new
|
|
73
|
+
throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
|
|
76
74
|
}
|
|
77
75
|
else if (!profile["sso_session"]) {
|
|
78
|
-
throw new
|
|
76
|
+
throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
|
|
79
77
|
}
|
|
80
78
|
const ssoSessionName = profile["sso_session"];
|
|
81
|
-
const ssoSessions = await
|
|
79
|
+
const ssoSessions = await loadSsoSessionData(init);
|
|
82
80
|
const ssoSession = ssoSessions[ssoSessionName];
|
|
83
81
|
if (!ssoSession) {
|
|
84
|
-
throw new
|
|
82
|
+
throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
|
|
85
83
|
}
|
|
86
84
|
for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
|
|
87
85
|
if (!ssoSession[ssoSessionRequiredKey]) {
|
|
88
|
-
throw new
|
|
86
|
+
throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
89
|
ssoSession["sso_start_url"];
|
|
92
90
|
const ssoRegion = ssoSession["sso_region"];
|
|
93
91
|
let ssoToken;
|
|
94
92
|
try {
|
|
95
|
-
ssoToken = await
|
|
93
|
+
ssoToken = await getSSOTokenFromFile(ssoSessionName);
|
|
96
94
|
}
|
|
97
95
|
catch (e) {
|
|
98
|
-
throw new
|
|
96
|
+
throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
|
|
99
97
|
}
|
|
100
98
|
validateTokenKey("accessToken", ssoToken.accessToken);
|
|
101
99
|
validateTokenKey("expiresAt", ssoToken.expiresAt);
|
|
@@ -141,13 +139,13 @@ const fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
|
141
139
|
const fromStatic = ({ token, logger }) => async () => {
|
|
142
140
|
logger?.debug("@aws-sdk/token-providers - fromStatic");
|
|
143
141
|
if (!token || !token.token) {
|
|
144
|
-
throw new
|
|
142
|
+
throw new TokenProviderError(`Please pass a valid token to fromStatic`, false);
|
|
145
143
|
}
|
|
146
144
|
return token;
|
|
147
145
|
};
|
|
148
146
|
|
|
149
|
-
const nodeProvider = (init = {}) =>
|
|
150
|
-
throw new
|
|
147
|
+
const nodeProvider = (init = {}) => memoize(chain(fromSso(init), async () => {
|
|
148
|
+
throw new TokenProviderError("Could not load token from any providers", false);
|
|
151
149
|
}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined);
|
|
152
150
|
|
|
153
151
|
exports.fromEnvSigningName = fromEnvSigningName;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/token-providers",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1069.0",
|
|
4
4
|
"description": "A collection of token providers",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
9
9
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
10
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
10
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
11
11
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
12
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
12
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
13
13
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
14
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
14
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
15
15
|
"extract:docs": "api-extractor run --local",
|
|
16
16
|
"test": "yarn g:vitest run",
|
|
17
17
|
"test:watch": "yarn g:vitest watch",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"license": "Apache-2.0",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@aws-sdk/core": "^3.974.
|
|
33
|
-
"@aws-sdk/nested-clients": "^3.997.
|
|
34
|
-
"@aws-sdk/types": "^3.973.
|
|
32
|
+
"@aws-sdk/core": "^3.974.21",
|
|
33
|
+
"@aws-sdk/nested-clients": "^3.997.21",
|
|
34
|
+
"@aws-sdk/types": "^3.973.13",
|
|
35
35
|
"@smithy/core": "^3.24.6",
|
|
36
36
|
"@smithy/types": "^4.14.3",
|
|
37
37
|
"tslib": "^2.6.2"
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-sso",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.53",
|
|
4
4
|
"description": "AWS credential provider that exchanges a resolved SSO login token file for temporary AWS credentials",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
9
9
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
10
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
10
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
11
11
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
12
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
12
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
13
13
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
14
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
14
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
15
15
|
"test": "yarn g:vitest run",
|
|
16
16
|
"test:watch": "yarn g:vitest watch",
|
|
17
17
|
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aws-sdk/core": "^3.974.
|
|
32
|
-
"@aws-sdk/nested-clients": "^3.997.
|
|
33
|
-
"@aws-sdk/token-providers": "3.
|
|
34
|
-
"@aws-sdk/types": "^3.973.
|
|
31
|
+
"@aws-sdk/core": "^3.974.21",
|
|
32
|
+
"@aws-sdk/nested-clients": "^3.997.21",
|
|
33
|
+
"@aws-sdk/token-providers": "3.1069.0",
|
|
34
|
+
"@aws-sdk/types": "^3.973.13",
|
|
35
35
|
"@smithy/core": "^3.24.6",
|
|
36
36
|
"@smithy/types": "^4.14.3",
|
|
37
37
|
"tslib": "^2.6.2"
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const config_1 = require("@smithy/core/config");
|
|
6
|
-
const node_fs_1 = require("node:fs");
|
|
7
|
-
const fromWebToken_1 = require("./fromWebToken");
|
|
1
|
+
const { setCredentialFeature } = require("@aws-sdk/core/client");
|
|
2
|
+
const { CredentialsProviderError, externalDataInterceptor } = require("@smithy/core/config");
|
|
3
|
+
const { readFileSync } = require("node:fs");
|
|
4
|
+
const { fromWebToken } = require("./fromWebToken");
|
|
8
5
|
const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
|
|
9
6
|
const ENV_ROLE_ARN = "AWS_ROLE_ARN";
|
|
10
7
|
const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
|
|
11
|
-
|
|
8
|
+
exports.fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
|
|
12
9
|
init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
|
|
13
10
|
const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
|
|
14
11
|
const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
|
|
15
12
|
const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
|
|
16
13
|
if (!webIdentityTokenFile || !roleArn) {
|
|
17
|
-
throw new
|
|
14
|
+
throw new CredentialsProviderError("Web identity configuration not specified", {
|
|
18
15
|
logger: init.logger,
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
|
-
const credentials = await
|
|
18
|
+
const credentials = await fromWebToken({
|
|
22
19
|
...init,
|
|
23
|
-
webIdentityToken:
|
|
24
|
-
|
|
20
|
+
webIdentityToken: externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ??
|
|
21
|
+
readFileSync(webIdentityTokenFile, { encoding: "ascii" }),
|
|
25
22
|
roleArn,
|
|
26
23
|
roleSessionName,
|
|
27
24
|
})(awsIdentityProperties);
|
|
28
25
|
if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
|
|
29
|
-
|
|
26
|
+
setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
|
|
30
27
|
}
|
|
31
28
|
return credentials;
|
|
32
29
|
};
|
|
33
|
-
exports.fromTokenFile = fromTokenFile;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fromWebToken = void 0;
|
|
4
|
-
const fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
1
|
+
exports.fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
5
2
|
init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
|
|
6
3
|
const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
|
|
7
4
|
let { roleAssumerWithWebIdentity } = init;
|
|
8
5
|
if (!roleAssumerWithWebIdentity) {
|
|
9
|
-
const { getDefaultRoleAssumerWithWebIdentity } =
|
|
6
|
+
const { getDefaultRoleAssumerWithWebIdentity } = require("@aws-sdk/nested-clients/sts");
|
|
10
7
|
roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
|
|
11
8
|
...init.clientConfig,
|
|
12
9
|
credentialProviderLogger: init.logger,
|
|
@@ -26,4 +23,3 @@ const fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
|
26
23
|
DurationSeconds: durationSeconds,
|
|
27
24
|
});
|
|
28
25
|
};
|
|
29
|
-
exports.fromWebToken = fromWebToken;
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var fromWebToken = require('./fromWebToken');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.prototype.hasOwnProperty.call(fromTokenFile, '__proto__') &&
|
|
9
|
-
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
10
|
-
Object.defineProperty(exports, '__proto__', {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
value: fromTokenFile['__proto__']
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
Object.keys(fromTokenFile).forEach(function (k) {
|
|
16
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = fromTokenFile[k];
|
|
17
|
-
});
|
|
18
|
-
Object.prototype.hasOwnProperty.call(fromWebToken, '__proto__') &&
|
|
19
|
-
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
20
|
-
Object.defineProperty(exports, '__proto__', {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
value: fromWebToken['__proto__']
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
Object.keys(fromWebToken).forEach(function (k) {
|
|
26
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = fromWebToken[k];
|
|
27
|
-
});
|
|
1
|
+
var __exportStar = (m, e) => { Object.assign(e, m); };
|
|
2
|
+
__exportStar(require("./fromTokenFile"), exports);
|
|
3
|
+
__exportStar(require("./fromWebToken"), exports);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-web-identity",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.53",
|
|
4
4
|
"description": "AWS credential provider that calls STS assumeRole for temporary AWS credentials",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
9
9
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
10
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
10
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
11
11
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
12
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
12
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
13
13
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
14
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
14
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
15
15
|
"test": "yarn g:vitest run",
|
|
16
16
|
"test:watch": "yarn g:vitest watch"
|
|
17
17
|
},
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
},
|
|
35
35
|
"license": "Apache-2.0",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@aws-sdk/core": "^3.974.
|
|
38
|
-
"@aws-sdk/nested-clients": "^3.997.
|
|
39
|
-
"@aws-sdk/types": "^3.973.
|
|
37
|
+
"@aws-sdk/core": "^3.974.21",
|
|
38
|
+
"@aws-sdk/nested-clients": "^3.997.21",
|
|
39
|
+
"@aws-sdk/types": "^3.973.13",
|
|
40
40
|
"@smithy/core": "^3.24.6",
|
|
41
41
|
"@smithy/types": "^4.14.3",
|
|
42
42
|
"tslib": "^2.6.2"
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const { EventStreamCodec } = require("@smithy/core/event-streams");
|
|
2
|
+
const { Transform, Readable, PassThrough, pipeline } = require("node:stream");
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
var node_stream = require('node:stream');
|
|
5
|
-
|
|
6
|
-
class EventSigningTransformStream extends node_stream.Transform {
|
|
4
|
+
class EventSigningTransformStream extends Transform {
|
|
7
5
|
priorSignature;
|
|
8
6
|
messageSigner;
|
|
9
7
|
eventStreamCodec;
|
|
@@ -69,18 +67,18 @@ class EventStreamPayloadHandler {
|
|
|
69
67
|
credentials;
|
|
70
68
|
constructor(options) {
|
|
71
69
|
this.messageSigner = options.messageSigner;
|
|
72
|
-
this.eventStreamCodec = new
|
|
70
|
+
this.eventStreamCodec = new EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
|
|
73
71
|
this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
|
|
74
72
|
this.credentials = options.credentials;
|
|
75
73
|
}
|
|
76
74
|
async handle(next, args, context = {}) {
|
|
77
75
|
const request = args.request;
|
|
78
76
|
const { body: payload, query } = request;
|
|
79
|
-
if (!(payload instanceof
|
|
77
|
+
if (!(payload instanceof Readable)) {
|
|
80
78
|
throw new Error("Eventstream payload must be a Readable stream.");
|
|
81
79
|
}
|
|
82
80
|
const payloadStream = payload;
|
|
83
|
-
request.body = new
|
|
81
|
+
request.body = new PassThrough({
|
|
84
82
|
objectMode: true,
|
|
85
83
|
});
|
|
86
84
|
const match = request.headers?.authorization?.match(/Signature=([\w]+)$/);
|
|
@@ -98,7 +96,7 @@ class EventStreamPayloadHandler {
|
|
|
98
96
|
let resolvePipeline;
|
|
99
97
|
const pipelineError = new Promise((resolve, reject) => {
|
|
100
98
|
resolvePipeline = () => resolve(undefined);
|
|
101
|
-
|
|
99
|
+
pipeline(payloadStream, signingStream, request.body, (err) => {
|
|
102
100
|
if (err) {
|
|
103
101
|
reject(new Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${err.message}`, { cause: err }));
|
|
104
102
|
}
|