ag-awsauth 0.0.226 → 0.0.228
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/helpers/browser.js +4 -2
- package/dist/helpers/sso.js +6 -6
- package/package.json +6 -6
package/dist/helpers/browser.js
CHANGED
|
@@ -126,8 +126,10 @@ function getMFA(p) {
|
|
|
126
126
|
do {
|
|
127
127
|
(0, log_1.info)('mfa block');
|
|
128
128
|
const { mfa } = (0, input_1.enterMFA)();
|
|
129
|
-
yield page.waitForSelector('
|
|
130
|
-
|
|
129
|
+
yield page.waitForSelector('.awsui-input-type-text', {
|
|
130
|
+
timeout: config_1.timeoutMs,
|
|
131
|
+
});
|
|
132
|
+
yield page.focus('.awsui-input-type-text');
|
|
131
133
|
yield page.keyboard.type(mfa);
|
|
132
134
|
yield page.$eval('.awsui-signin-button-container button', (el) => el.click());
|
|
133
135
|
//
|
package/dist/helpers/sso.js
CHANGED
|
@@ -21,7 +21,7 @@ const config_1 = require("../config");
|
|
|
21
21
|
const awsconfig_1 = require("./awsconfig");
|
|
22
22
|
const sts_1 = require("./sts");
|
|
23
23
|
const getAssumedRole = (p) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
var _a, _b, _c, _d;
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
25
25
|
const sso = new client_sso_1.SSOClient({ region: config_1.identityCenterRegion });
|
|
26
26
|
let accountId = p.accountId;
|
|
27
27
|
if (!accountId) {
|
|
@@ -35,10 +35,10 @@ const getAssumedRole = (p) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
35
35
|
accessToken: p.accessToken,
|
|
36
36
|
accountId,
|
|
37
37
|
}));
|
|
38
|
-
const roles = ((_d = (_c = rolesResult.roleList) === null || _c === void 0 ? void 0 : _c.map((r) => ({
|
|
38
|
+
const roles = (_e = (_d = (_c = rolesResult.roleList) === null || _c === void 0 ? void 0 : _c.map((r) => ({
|
|
39
39
|
accountId: r.accountId || '',
|
|
40
40
|
roleName: r.roleName || '',
|
|
41
|
-
}))) === null || _d === void 0 ? void 0 : _d.filter((r) => r.accountId && r.roleName))
|
|
41
|
+
}))) === null || _d === void 0 ? void 0 : _d.filter((r) => r.accountId && r.roleName)) !== null && _e !== void 0 ? _e : [];
|
|
42
42
|
if (roles.length === 0) {
|
|
43
43
|
throw new Error('no roles can be assumed');
|
|
44
44
|
}
|
|
@@ -69,7 +69,7 @@ function appInstances(p) {
|
|
|
69
69
|
if (!(ai === null || ai === void 0 ? void 0 : ai.result)) {
|
|
70
70
|
throw new Error('appinstance error' + JSON.stringify(ai, null, 2));
|
|
71
71
|
}
|
|
72
|
-
return ai.result;
|
|
72
|
+
return ai.result.sort((a, b) => (a.name < b.name ? -1 : 1));
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
exports.appInstances = appInstances;
|
|
@@ -95,7 +95,7 @@ function getSamlAssertion(p, instance) {
|
|
|
95
95
|
}
|
|
96
96
|
exports.getSamlAssertion = getSamlAssertion;
|
|
97
97
|
const tryExistingCredentials = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
-
var
|
|
98
|
+
var _f;
|
|
99
99
|
const credraw = yield (0, awsconfig_1.getAwsCredentials)();
|
|
100
100
|
if (!credraw.default.aws_access_token) {
|
|
101
101
|
return undefined;
|
|
@@ -124,7 +124,7 @@ const tryExistingCredentials = () => __awaiter(void 0, void 0, void 0, function*
|
|
|
124
124
|
catch (e) {
|
|
125
125
|
//
|
|
126
126
|
const em = e.toString();
|
|
127
|
-
if ((
|
|
127
|
+
if ((_f = em.includes('is expired')) !== null && _f !== void 0 ? _f : em.includes('or invalid')) {
|
|
128
128
|
(0, log_1.info)('access token or sso expired, need to wipe');
|
|
129
129
|
}
|
|
130
130
|
else {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "andrei gec (andreigec@hotmail.com)",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"private": false,
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.228",
|
|
9
9
|
"preferGlobal": true,
|
|
10
10
|
"scripts": {
|
|
11
11
|
"format": "eslint --ext .ts,.tsx ./src --fix",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"LICENSE.md"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/client-sso": "3.
|
|
27
|
-
"@aws-sdk/client-sso-oidc": "3.
|
|
28
|
-
"@aws-sdk/client-sts": "3.
|
|
26
|
+
"@aws-sdk/client-sso": "3.495.0",
|
|
27
|
+
"@aws-sdk/client-sso-oidc": "3.495.0",
|
|
28
|
+
"@aws-sdk/client-sts": "3.495.0",
|
|
29
29
|
"@aws-sdk/shared-ini-file-loader": "3.370.0",
|
|
30
|
-
"ag-common": "0.0.
|
|
30
|
+
"ag-common": "0.0.587",
|
|
31
31
|
"cli-select": "1.1.2",
|
|
32
32
|
"dotenv": "16.3.1",
|
|
33
33
|
"envfile": "7.1.0",
|
|
34
|
-
"eslint-config-e7npm": "0.0.
|
|
34
|
+
"eslint-config-e7npm": "0.0.77",
|
|
35
35
|
"ini": "4.1.1",
|
|
36
36
|
"node-fetch": "2.7.0",
|
|
37
37
|
"puppeteer": "21.7.0",
|