@aws-sdk/credential-provider-web-identity 3.972.38 → 3.972.39
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.
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fromTokenFile = void 0;
|
|
4
4
|
const client_1 = require("@aws-sdk/core/client");
|
|
5
|
-
const
|
|
6
|
-
const shared_ini_file_loader_1 = require("@smithy/shared-ini-file-loader");
|
|
5
|
+
const config_1 = require("@smithy/core/config");
|
|
7
6
|
const node_fs_1 = require("node:fs");
|
|
8
7
|
const fromWebToken_1 = require("./fromWebToken");
|
|
9
8
|
const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
|
|
@@ -15,13 +14,13 @@ const fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
|
|
|
15
14
|
const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
|
|
16
15
|
const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
|
|
17
16
|
if (!webIdentityTokenFile || !roleArn) {
|
|
18
|
-
throw new
|
|
17
|
+
throw new config_1.CredentialsProviderError("Web identity configuration not specified", {
|
|
19
18
|
logger: init.logger,
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
21
|
const credentials = await (0, fromWebToken_1.fromWebToken)({
|
|
23
22
|
...init,
|
|
24
|
-
webIdentityToken:
|
|
23
|
+
webIdentityToken: config_1.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ??
|
|
25
24
|
(0, node_fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }),
|
|
26
25
|
roleArn,
|
|
27
26
|
roleSessionName,
|
package/dist-cjs/fromWebToken.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.fromWebToken = void 0;
|
|
37
4
|
const fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
@@ -39,7 +6,7 @@ const fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
|
39
6
|
const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
|
|
40
7
|
let { roleAssumerWithWebIdentity } = init;
|
|
41
8
|
if (!roleAssumerWithWebIdentity) {
|
|
42
|
-
const { getDefaultRoleAssumerWithWebIdentity } = await
|
|
9
|
+
const { getDefaultRoleAssumerWithWebIdentity } = await import("@aws-sdk/nested-clients/sts");
|
|
43
10
|
roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
|
|
44
11
|
...init.clientConfig,
|
|
45
12
|
credentialProviderLogger: init.logger,
|
package/dist-es/fromTokenFile.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { setCredentialFeature } from "@aws-sdk/core/client";
|
|
2
|
-
import { CredentialsProviderError } from "@smithy/
|
|
3
|
-
import { externalDataInterceptor } from "@smithy/shared-ini-file-loader";
|
|
2
|
+
import { CredentialsProviderError, externalDataInterceptor } from "@smithy/core/config";
|
|
4
3
|
import { readFileSync } from "node:fs";
|
|
5
4
|
import { fromWebToken } from "./fromWebToken";
|
|
6
5
|
const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-web-identity",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.39",
|
|
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",
|
|
@@ -34,11 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"license": "Apache-2.0",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@aws-sdk/core": "^3.974.
|
|
38
|
-
"@aws-sdk/nested-clients": "^3.997.
|
|
37
|
+
"@aws-sdk/core": "^3.974.9",
|
|
38
|
+
"@aws-sdk/nested-clients": "^3.997.7",
|
|
39
39
|
"@aws-sdk/types": "^3.973.8",
|
|
40
|
-
"@smithy/
|
|
41
|
-
"@smithy/shared-ini-file-loader": "^4.4.9",
|
|
40
|
+
"@smithy/core": "^3.24.1",
|
|
42
41
|
"@smithy/types": "^4.14.1",
|
|
43
42
|
"tslib": "^2.6.2"
|
|
44
43
|
},
|