ag-awsauth 0.0.256 → 0.0.258

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.
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getMFA = exports.goToPage = exports.launchBrowser = exports.closeBrowser = void 0;
12
+ exports.goToPage = exports.launchBrowser = exports.closeBrowser = void 0;
13
+ exports.getMFA = getMFA;
13
14
  const log_1 = require("ag-common/dist/common/helpers/log");
14
15
  const sleep_1 = require("ag-common/dist/common/helpers/sleep");
15
16
  const puppeteer_1 = require("puppeteer");
@@ -196,4 +197,3 @@ function getMFA(p) {
196
197
  return { ssoAuthn };
197
198
  });
198
199
  }
199
- exports.getMFA = getMFA;
@@ -12,7 +12,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.enterMFA = exports.enterCreds = exports.readArguments = exports.chooseAppInstance = void 0;
15
+ exports.chooseAppInstance = chooseAppInstance;
16
+ exports.readArguments = readArguments;
17
+ exports.enterCreds = enterCreds;
18
+ exports.enterMFA = enterMFA;
16
19
  const log_1 = require("ag-common/dist/common/helpers/log");
17
20
  const string_1 = require("ag-common/dist/common/helpers/string");
18
21
  const cli_select_1 = __importDefault(require("cli-select"));
@@ -41,7 +44,6 @@ function chooseAppInstance(ai, args) {
41
44
  return res.value;
42
45
  });
43
46
  }
44
- exports.chooseAppInstance = chooseAppInstance;
45
47
  function readArguments() {
46
48
  return __awaiter(this, void 0, void 0, function* () {
47
49
  const { vers: version, applicationfilter, verbose, wipe, config, } = yield (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
@@ -79,7 +81,6 @@ function readArguments() {
79
81
  return { applicationfilter, verbose, wipe, config, version };
80
82
  });
81
83
  }
82
- exports.readArguments = readArguments;
83
84
  function enterCreds() {
84
85
  const username = (0, readline_sync_1.question)('Enter username:');
85
86
  const password = (0, readline_sync_1.question)('Enter password:', {
@@ -87,7 +88,6 @@ function enterCreds() {
87
88
  });
88
89
  return { username, password };
89
90
  }
90
- exports.enterCreds = enterCreds;
91
91
  function enterMFA() {
92
92
  return {
93
93
  mfa: (0, readline_sync_1.question)('Enter MFA code:', {
@@ -97,4 +97,3 @@ function enterMFA() {
97
97
  }),
98
98
  };
99
99
  }
100
- exports.enterMFA = enterMFA;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.requestMFA = void 0;
12
+ exports.requestMFA = requestMFA;
13
13
  const client_sso_oidc_1 = require("@aws-sdk/client-sso-oidc");
14
14
  const log_1 = require("ag-common/dist/common/helpers/log");
15
15
  const sleep_1 = require("ag-common/dist/common/helpers/sleep");
@@ -80,4 +80,3 @@ function requestMFA(p) {
80
80
  };
81
81
  });
82
82
  }
83
- exports.requestMFA = requestMFA;
@@ -12,7 +12,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.tryExistingCredentials = exports.getSamlAssertion = exports.appInstances = exports.getOIDCCredentialsFromAccessToken = exports.getAssumedRole = void 0;
15
+ exports.tryExistingCredentials = exports.getOIDCCredentialsFromAccessToken = exports.getAssumedRole = void 0;
16
+ exports.appInstances = appInstances;
17
+ exports.getSamlAssertion = getSamlAssertion;
16
18
  const client_sso_1 = require("@aws-sdk/client-sso");
17
19
  const log_1 = require("ag-common/dist/common/helpers/log");
18
20
  const string_1 = require("ag-common/dist/common/helpers/string");
@@ -73,7 +75,6 @@ function appInstances(p) {
73
75
  return ai.result.sort((a, b) => (a.name < b.name ? -1 : 1));
74
76
  });
75
77
  }
76
- exports.appInstances = appInstances;
77
78
  function getSamlAssertion(p, instance) {
78
79
  return __awaiter(this, void 0, void 0, function* () {
79
80
  var _a;
@@ -94,9 +95,8 @@ function getSamlAssertion(p, instance) {
94
95
  return { samlAssertion: assertion.encodedResponse, providerArn, roleArn };
95
96
  });
96
97
  }
97
- exports.getSamlAssertion = getSamlAssertion;
98
98
  const tryExistingCredentials = () => __awaiter(void 0, void 0, void 0, function* () {
99
- var _e;
99
+ var _a;
100
100
  const credraw = yield (0, awsconfig_1.getAwsCredentials)();
101
101
  if (!credraw.default.aws_access_token) {
102
102
  return undefined;
@@ -126,7 +126,7 @@ const tryExistingCredentials = () => __awaiter(void 0, void 0, void 0, function*
126
126
  //
127
127
  const em = e.toString();
128
128
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
129
- if ((_e = em.includes('is expired')) !== null && _e !== void 0 ? _e : em.includes('or invalid')) {
129
+ if ((_a = em.includes('is expired')) !== null && _a !== void 0 ? _a : em.includes('or invalid')) {
130
130
  (0, log_1.info)('access token or sso expired, need to wipe');
131
131
  }
132
132
  else {
@@ -9,7 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.directStsAssume = exports.getApplicationCreds = exports.validateCredentials = void 0;
12
+ exports.validateCredentials = validateCredentials;
13
+ exports.getApplicationCreds = getApplicationCreds;
14
+ exports.directStsAssume = directStsAssume;
13
15
  const client_sts_1 = require("@aws-sdk/client-sts");
14
16
  const log_1 = require("ag-common/dist/common/helpers/log");
15
17
  const config_1 = require("../config");
@@ -41,7 +43,6 @@ function validateCredentials(credentials) {
41
43
  }
42
44
  });
43
45
  }
44
- exports.validateCredentials = validateCredentials;
45
46
  function getApplicationCreds(p) {
46
47
  return __awaiter(this, void 0, void 0, function* () {
47
48
  var _a, _b;
@@ -67,7 +68,6 @@ function getApplicationCreds(p) {
67
68
  return Object.assign(Object.assign({}, p.originCreds), { region: p.targetRegion, accessKeyId: ret.Credentials.AccessKeyId, secretAccessKey: ret.Credentials.SecretAccessKey, sessionToken: ret.Credentials.SessionToken });
68
69
  });
69
70
  }
70
- exports.getApplicationCreds = getApplicationCreds;
71
71
  function directStsAssume(p) {
72
72
  return __awaiter(this, void 0, void 0, function* () {
73
73
  var _a, _b;
@@ -95,4 +95,3 @@ function directStsAssume(p) {
95
95
  return Object.assign(Object.assign({}, p.credentials), { region: p.targetRegion, accessKeyId: ar.Credentials.AccessKeyId, secretAccessKey: ar.Credentials.SecretAccessKey, sessionToken: ar.Credentials.SessionToken });
96
96
  });
97
97
  }
98
- exports.directStsAssume = directStsAssume;
package/dist/index.js CHANGED
@@ -12,7 +12,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.run = exports.main = exports.globalargs = void 0;
15
+ exports.globalargs = void 0;
16
+ exports.main = main;
17
+ exports.run = run;
16
18
  /* eslint-disable padding-line-between-statements */
17
19
  const log_1 = require("ag-common/dist/common/helpers/log");
18
20
  const dotenv_1 = require("dotenv");
@@ -102,7 +104,6 @@ function main(args) {
102
104
  (0, log_1.warn)(`successfully authed into ${debugRole}`);
103
105
  });
104
106
  }
105
- exports.main = main;
106
107
  function run() {
107
108
  return __awaiter(this, void 0, void 0, function* () {
108
109
  try {
@@ -117,4 +118,3 @@ function run() {
117
118
  }
118
119
  });
119
120
  }
120
- exports.run = run;
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.256",
8
+ "version": "0.0.258",
9
9
  "preferGlobal": true,
10
10
  "scripts": {
11
11
  "format": "eslint --ext .ts,.tsx src --fix",
@@ -26,24 +26,24 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@aws-sdk/client-sso": "3.598.0",
29
- "@aws-sdk/client-sso-oidc": "3.598.0",
30
- "@aws-sdk/client-sts": "3.598.0",
29
+ "@aws-sdk/client-sso-oidc": "3.600.0",
30
+ "@aws-sdk/client-sts": "3.600.0",
31
31
  "@aws-sdk/shared-ini-file-loader": "^3.374.0",
32
- "ag-common": "0.0.718",
32
+ "ag-common": "0.0.719",
33
33
  "cli-select": "1.1.2",
34
34
  "dotenv": "16.4.5",
35
35
  "envfile": "7.1.0",
36
36
  "eslint-config-e7npm": "0.0.107",
37
37
  "ini": "4.1.3",
38
38
  "node-fetch": "2.7.0",
39
- "puppeteer": "22.11.0",
39
+ "puppeteer": "22.12.0",
40
40
  "readline-sync": "1.4.10",
41
- "typescript": "5.4.5",
41
+ "typescript": "5.5.2",
42
42
  "yargs": "17.7.2"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/ini": "4.1.1",
46
- "@types/node": "20.14.2",
46
+ "@types/node": "20.14.8",
47
47
  "@types/node-fetch": "2.6.11",
48
48
  "@types/readline-sync": "1.4.8",
49
49
  "@types/yargs": "17.0.32"