@aws-sdk/credential-provider-process 3.972.46 → 3.972.47
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/dist-cjs/index.js +11 -13
- package/package.json +6 -6
package/dist-cjs/index.js
CHANGED
|
@@ -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
|
};
|
package/package.json
CHANGED
|
@@ -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"
|