@aws-sdk/credential-provider-env 3.485.0 → 3.495.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/dist-cjs/fromEnv.js +1 -27
- package/dist-cjs/index.js +64 -4
- package/package.json +5 -5
package/dist-cjs/fromEnv.js
CHANGED
|
@@ -1,27 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fromEnv = exports.ENV_CREDENTIAL_SCOPE = exports.ENV_EXPIRATION = exports.ENV_SESSION = exports.ENV_SECRET = exports.ENV_KEY = void 0;
|
|
4
|
-
const property_provider_1 = require("@smithy/property-provider");
|
|
5
|
-
exports.ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
6
|
-
exports.ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
7
|
-
exports.ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
8
|
-
exports.ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
|
9
|
-
exports.ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
|
10
|
-
const fromEnv = () => async () => {
|
|
11
|
-
const accessKeyId = process.env[exports.ENV_KEY];
|
|
12
|
-
const secretAccessKey = process.env[exports.ENV_SECRET];
|
|
13
|
-
const sessionToken = process.env[exports.ENV_SESSION];
|
|
14
|
-
const expiry = process.env[exports.ENV_EXPIRATION];
|
|
15
|
-
const credentialScope = process.env[exports.ENV_CREDENTIAL_SCOPE];
|
|
16
|
-
if (accessKeyId && secretAccessKey) {
|
|
17
|
-
return {
|
|
18
|
-
accessKeyId,
|
|
19
|
-
secretAccessKey,
|
|
20
|
-
...(sessionToken && { sessionToken }),
|
|
21
|
-
...(expiry && { expiration: new Date(expiry) }),
|
|
22
|
-
...(credentialScope && { credentialScope }),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
throw new property_provider_1.CredentialsProviderError("Unable to find environment variable credentials.");
|
|
26
|
-
};
|
|
27
|
-
exports.fromEnv = fromEnv;
|
|
1
|
+
module.exports = require("./index.js");
|
package/dist-cjs/index.js
CHANGED
|
@@ -1,4 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
|
|
24
|
+
ENV_EXPIRATION: () => ENV_EXPIRATION,
|
|
25
|
+
ENV_KEY: () => ENV_KEY,
|
|
26
|
+
ENV_SECRET: () => ENV_SECRET,
|
|
27
|
+
ENV_SESSION: () => ENV_SESSION,
|
|
28
|
+
fromEnv: () => fromEnv
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(src_exports);
|
|
31
|
+
|
|
32
|
+
// src/fromEnv.ts
|
|
33
|
+
var import_property_provider = require("@smithy/property-provider");
|
|
34
|
+
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
35
|
+
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
36
|
+
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
37
|
+
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
|
38
|
+
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
|
39
|
+
var fromEnv = /* @__PURE__ */ __name(() => async () => {
|
|
40
|
+
const accessKeyId = process.env[ENV_KEY];
|
|
41
|
+
const secretAccessKey = process.env[ENV_SECRET];
|
|
42
|
+
const sessionToken = process.env[ENV_SESSION];
|
|
43
|
+
const expiry = process.env[ENV_EXPIRATION];
|
|
44
|
+
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
|
45
|
+
if (accessKeyId && secretAccessKey) {
|
|
46
|
+
return {
|
|
47
|
+
accessKeyId,
|
|
48
|
+
secretAccessKey,
|
|
49
|
+
...sessionToken && { sessionToken },
|
|
50
|
+
...expiry && { expiration: new Date(expiry) },
|
|
51
|
+
...credentialScope && { credentialScope }
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.");
|
|
55
|
+
}, "fromEnv");
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
ENV_CREDENTIAL_SCOPE,
|
|
59
|
+
ENV_EXPIRATION,
|
|
60
|
+
ENV_KEY,
|
|
61
|
+
ENV_SECRET,
|
|
62
|
+
ENV_SESSION,
|
|
63
|
+
fromEnv
|
|
64
|
+
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-env",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.495.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",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
9
|
-
"build:cjs": "
|
|
9
|
+
"build:cjs": "node ../../scripts/compilation/inline credential-provider-env",
|
|
10
10
|
"build:es": "tsc -p tsconfig.es.json",
|
|
11
11
|
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
|
|
12
12
|
"build:types": "tsc -p tsconfig.types.json",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@aws-sdk/types": "3.
|
|
28
|
-
"@smithy/property-provider": "^2.
|
|
29
|
-
"@smithy/types": "^2.
|
|
27
|
+
"@aws-sdk/types": "3.495.0",
|
|
28
|
+
"@smithy/property-provider": "^2.1.0",
|
|
29
|
+
"@smithy/types": "^2.9.0",
|
|
30
30
|
"tslib": "^2.5.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|