@aws-sdk/credential-provider-process 3.54.1 → 3.58.0
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.58.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.57.0...v3.58.0) (2022-03-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-process
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.56.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.55.0...v3.56.0) (2022-03-24)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-process
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-process
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [3.54.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.0...v3.54.1) (2022-03-15)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @aws-sdk/credential-provider-process
|
package/dist-cjs/fromProcess.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.fromProcess = void 0;
|
|
|
4
4
|
const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader");
|
|
5
5
|
const resolveProcessCredentials_1 = require("./resolveProcessCredentials");
|
|
6
6
|
const fromProcess = (init = {}) => async () => {
|
|
7
|
-
const profiles = await shared_ini_file_loader_1.parseKnownFiles(init);
|
|
8
|
-
return resolveProcessCredentials_1.resolveProcessCredentials(shared_ini_file_loader_1.getProfileName(init), profiles);
|
|
7
|
+
const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init);
|
|
8
|
+
return (0, resolveProcessCredentials_1.resolveProcessCredentials)((0, shared_ini_file_loader_1.getProfileName)(init), profiles);
|
|
9
9
|
};
|
|
10
10
|
exports.fromProcess = fromProcess;
|
|
@@ -10,7 +10,7 @@ const resolveProcessCredentials = async (profileName, profiles) => {
|
|
|
10
10
|
if (profiles[profileName]) {
|
|
11
11
|
const credentialProcess = profile["credential_process"];
|
|
12
12
|
if (credentialProcess !== undefined) {
|
|
13
|
-
const execPromise = util_1.promisify(child_process_1.exec);
|
|
13
|
+
const execPromise = (0, util_1.promisify)(child_process_1.exec);
|
|
14
14
|
try {
|
|
15
15
|
const { stdout } = await execPromise(credentialProcess);
|
|
16
16
|
let data;
|
|
@@ -20,7 +20,7 @@ const resolveProcessCredentials = async (profileName, profiles) => {
|
|
|
20
20
|
catch (_a) {
|
|
21
21
|
throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
|
|
22
22
|
}
|
|
23
|
-
return getValidatedProcessCredentials_1.getValidatedProcessCredentials(profileName, data);
|
|
23
|
+
return (0, getValidatedProcessCredentials_1.getValidatedProcessCredentials)(profileName, data);
|
|
24
24
|
}
|
|
25
25
|
catch (error) {
|
|
26
26
|
throw new property_provider_1.CredentialsProviderError(error.message);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
export var getValidatedProcessCredentials = function (profileName, data) {
|
|
3
3
|
if (data.Version !== 1) {
|
|
4
|
-
throw Error("Profile "
|
|
4
|
+
throw Error("Profile ".concat(profileName, " credential_process did not return Version 1."));
|
|
5
5
|
}
|
|
6
6
|
if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) {
|
|
7
|
-
throw Error("Profile "
|
|
7
|
+
throw Error("Profile ".concat(profileName, " credential_process returned invalid credentials."));
|
|
8
8
|
}
|
|
9
9
|
if (data.Expiration) {
|
|
10
10
|
var currentTime = new Date();
|
|
11
11
|
var expireTime = new Date(data.Expiration);
|
|
12
12
|
if (expireTime < currentTime) {
|
|
13
|
-
throw Error("Profile "
|
|
13
|
+
throw Error("Profile ".concat(profileName, " credential_process returned expired credentials."));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
return __assign(__assign({ accessKeyId: data.AccessKeyId, secretAccessKey: data.SecretAccessKey }, (data.SessionToken && { sessionToken: data.SessionToken })), (data.Expiration && { expiration: new Date(data.Expiration) }));
|
|
@@ -24,16 +24,16 @@ export var resolveProcessCredentials = function (profileName, profiles) { return
|
|
|
24
24
|
data = JSON.parse(stdout.trim());
|
|
25
25
|
}
|
|
26
26
|
catch (_b) {
|
|
27
|
-
throw Error("Profile "
|
|
27
|
+
throw Error("Profile ".concat(profileName, " credential_process returned invalid JSON."));
|
|
28
28
|
}
|
|
29
29
|
return [2, getValidatedProcessCredentials(profileName, data)];
|
|
30
30
|
case 3:
|
|
31
31
|
error_1 = _a.sent();
|
|
32
32
|
throw new CredentialsProviderError(error_1.message);
|
|
33
33
|
case 4: return [3, 6];
|
|
34
|
-
case 5: throw new CredentialsProviderError("Profile "
|
|
34
|
+
case 5: throw new CredentialsProviderError("Profile ".concat(profileName, " did not contain credential_process."));
|
|
35
35
|
case 6: return [3, 8];
|
|
36
|
-
case 7: throw new CredentialsProviderError("Profile "
|
|
36
|
+
case 7: throw new CredentialsProviderError("Profile ".concat(profileName, " could not be found in shared credentials file."));
|
|
37
37
|
case 8: return [2];
|
|
38
38
|
}
|
|
39
39
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-process",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.58.0",
|
|
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",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/property-provider": "3.
|
|
27
|
-
"@aws-sdk/shared-ini-file-loader": "3.
|
|
28
|
-
"@aws-sdk/types": "3.
|
|
29
|
-
"tslib": "^2.3.
|
|
26
|
+
"@aws-sdk/property-provider": "3.55.0",
|
|
27
|
+
"@aws-sdk/shared-ini-file-loader": "3.58.0",
|
|
28
|
+
"@aws-sdk/types": "3.55.0",
|
|
29
|
+
"tslib": "^2.3.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@tsconfig/recommended": "1.0.1",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"downlevel-dts": "0.7.0",
|
|
36
36
|
"rimraf": "3.0.2",
|
|
37
37
|
"typedoc": "0.19.2",
|
|
38
|
-
"typescript": "~4.
|
|
38
|
+
"typescript": "~4.6.2"
|
|
39
39
|
},
|
|
40
40
|
"types": "./dist-types/index.d.ts",
|
|
41
41
|
"engines": {
|