@aws-sdk/credential-provider-env 3.186.0 → 3.188.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 +8 -0
- package/dist-es/fromEnv.js +19 -18
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-env
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-sdk/credential-provider-env
|
package/dist-es/fromEnv.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { CredentialsProviderError } from "@aws-sdk/property-provider";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
2
|
+
export const ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
3
|
+
export const ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
4
|
+
export const ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
5
|
+
export const ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
|
6
|
+
export const fromEnv = () => async () => {
|
|
7
|
+
const accessKeyId = process.env[ENV_KEY];
|
|
8
|
+
const secretAccessKey = process.env[ENV_SECRET];
|
|
9
|
+
const sessionToken = process.env[ENV_SESSION];
|
|
10
|
+
const expiry = process.env[ENV_EXPIRATION];
|
|
11
|
+
if (accessKeyId && secretAccessKey) {
|
|
12
|
+
return {
|
|
13
|
+
accessKeyId,
|
|
14
|
+
secretAccessKey,
|
|
15
|
+
...(sessionToken && { sessionToken }),
|
|
16
|
+
...(expiry && { expiration: new Date(expiry) }),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
throw new CredentialsProviderError("Unable to find environment variable credentials.");
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-env",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.188.0",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from known environment variables",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@aws-sdk/property-provider": "3.
|
|
28
|
-
"@aws-sdk/types": "3.
|
|
27
|
+
"@aws-sdk/property-provider": "3.188.0",
|
|
28
|
+
"@aws-sdk/types": "3.188.0",
|
|
29
29
|
"tslib": "^2.3.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|