opal-security 3.2.3 → 3.2.4

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/README.md CHANGED
@@ -22,7 +22,7 @@ $ npm install -g opal-security
22
22
  $ opal COMMAND
23
23
  running command...
24
24
  $ opal (--version)
25
- opal-security/3.2.3 darwin-arm64 node-v18.20.4
25
+ opal-security/3.2.4 darwin-arm64 node-v18.20.4
26
26
  $ opal --help [COMMAND]
27
27
  USAGE
28
28
  $ opal COMMAND
@@ -106,7 +106,7 @@ EXAMPLES
106
106
  $ opal aws:identity
107
107
  ```
108
108
 
109
- _See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/aws/identity.ts)_
109
+ _See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/aws/identity.ts)_
110
110
 
111
111
  ## `opal clear-auth-provider`
112
112
 
@@ -126,7 +126,7 @@ EXAMPLES
126
126
  $ opal clear-auth-provider
127
127
  ```
128
128
 
129
- _See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/clear-auth-provider.ts)_
129
+ _See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/clear-auth-provider.ts)_
130
130
 
131
131
  ## `opal curl-example`
132
132
 
@@ -143,7 +143,7 @@ DESCRIPTION
143
143
  Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.
144
144
  ```
145
145
 
146
- _See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/curl-example.ts)_
146
+ _See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/curl-example.ts)_
147
147
 
148
148
  ## `opal groups get`
149
149
 
@@ -164,7 +164,7 @@ EXAMPLES
164
164
  $ opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
165
165
  ```
166
166
 
167
- _See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/groups/get.ts)_
167
+ _See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/groups/get.ts)_
168
168
 
169
169
  ## `opal help [COMMANDS]`
170
170
 
@@ -214,7 +214,7 @@ EXAMPLES
214
214
  $ opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName "custom-profile"
215
215
  ```
216
216
 
217
- _See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/iam-roles/start.ts)_
217
+ _See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/iam-roles/start.ts)_
218
218
 
219
219
  ## `opal kube-roles start`
220
220
 
@@ -245,7 +245,7 @@ EXAMPLES
245
245
  $ opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId "arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role"
246
246
  ```
247
247
 
248
- _See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/kube-roles/start.ts)_
248
+ _See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/kube-roles/start.ts)_
249
249
 
250
250
  ## `opal login`
251
251
 
@@ -266,7 +266,7 @@ EXAMPLES
266
266
  $ opal login
267
267
  ```
268
268
 
269
- _See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/login.ts)_
269
+ _See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/login.ts)_
270
270
 
271
271
  ## `opal logout`
272
272
 
@@ -286,7 +286,7 @@ EXAMPLES
286
286
  $ opal logout
287
287
  ```
288
288
 
289
- _See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/logout.ts)_
289
+ _See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/logout.ts)_
290
290
 
291
291
  ## `opal postgres-instances start`
292
292
 
@@ -324,7 +324,7 @@ EXAMPLES
324
324
  $ opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId fullaccess --action view
325
325
  ```
326
326
 
327
- _See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/postgres-instances/start.ts)_
327
+ _See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/postgres-instances/start.ts)_
328
328
 
329
329
  ## `opal request create`
330
330
 
@@ -350,7 +350,7 @@ DESCRIPTION
350
350
  Creates an Opal access request via an interactive form
351
351
  ```
352
352
 
353
- _See code: [src/commands/request/create.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/request/create.ts)_
353
+ _See code: [src/commands/request/create.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/request/create.ts)_
354
354
 
355
355
  ## `opal request get`
356
356
 
@@ -374,7 +374,7 @@ EXAMPLES
374
374
  $ opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4 --verbose
375
375
  ```
376
376
 
377
- _See code: [src/commands/request/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/request/get.ts)_
377
+ _See code: [src/commands/request/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/request/get.ts)_
378
378
 
379
379
  ## `opal request list`
380
380
 
@@ -406,7 +406,7 @@ EXAMPLES
406
406
  $ opal request list --n 5 --pending --verbose
407
407
  ```
408
408
 
409
- _See code: [src/commands/request/list.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/request/list.ts)_
409
+ _See code: [src/commands/request/list.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/request/list.ts)_
410
410
 
411
411
  ## `opal request ls`
412
412
 
@@ -457,7 +457,7 @@ EXAMPLES
457
457
  $ opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
458
458
  ```
459
459
 
460
- _See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/resources/get.ts)_
460
+ _See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/resources/get.ts)_
461
461
 
462
462
  ## `opal set-auth-provider`
463
463
 
@@ -483,7 +483,7 @@ EXAMPLES
483
483
  $ opal set-auth-provider --clientID 1234asdf --issuerUrl https://auth.example.com
484
484
  ```
485
485
 
486
- _See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/set-auth-provider.ts)_
486
+ _See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/set-auth-provider.ts)_
487
487
 
488
488
  ## `opal set-custom-header`
489
489
 
@@ -504,7 +504,7 @@ EXAMPLES
504
504
  $ opal set-custom-header --header 'cf-access-token: $TOKEN'
505
505
  ```
506
506
 
507
- _See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/set-custom-header.ts)_
507
+ _See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/set-custom-header.ts)_
508
508
 
509
509
  ## `opal set-token`
510
510
 
@@ -524,7 +524,7 @@ EXAMPLES
524
524
  $ opal set-token
525
525
  ```
526
526
 
527
- _See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/set-token.ts)_
527
+ _See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/set-token.ts)_
528
528
 
529
529
  ## `opal set-url [URL]`
530
530
 
@@ -548,7 +548,7 @@ EXAMPLES
548
548
  $ opal set-url
549
549
  ```
550
550
 
551
- _See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/set-url.ts)_
551
+ _See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/set-url.ts)_
552
552
 
553
553
  ## `opal ssh copyFrom`
554
554
 
@@ -579,7 +579,7 @@ EXAMPLES
579
579
  $ opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
580
580
  ```
581
581
 
582
- _See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/ssh/copyFrom.ts)_
582
+ _See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/ssh/copyFrom.ts)_
583
583
 
584
584
  ## `opal ssh copyTo`
585
585
 
@@ -610,7 +610,7 @@ EXAMPLES
610
610
  $ opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
611
611
  ```
612
612
 
613
- _See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/ssh/copyTo.ts)_
613
+ _See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/ssh/copyTo.ts)_
614
614
 
615
615
  ## `opal ssh start`
616
616
 
@@ -637,7 +637,7 @@ EXAMPLES
637
637
  $ opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398
638
638
  ```
639
639
 
640
- _See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/ssh/start.ts)_
640
+ _See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/ssh/start.ts)_
641
641
 
642
642
  ## `opal version`
643
643
 
@@ -674,5 +674,5 @@ DESCRIPTION
674
674
  Describes current url set, organization name, and logged in user if applicable.
675
675
  ```
676
676
 
677
- _See code: [src/commands/whoami.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.3/src/commands/whoami.ts)_
677
+ _See code: [src/commands/whoami.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.4/src/commands/whoami.ts)_
678
678
  <!-- commandsstop -->
@@ -11,71 +11,55 @@ async function chooseOktaAzureRoles(cmd, client, app, requestMap) {
11
11
  const rolePrompt = new AutoComplete({
12
12
  name: "Roles",
13
13
  message: `Select a role for ${app.name}:`,
14
- hint: _1.multiSelectInstructions,
14
+ hint: _1.selectInstructions,
15
15
  limit: 15,
16
- multiple: true,
17
- async choices(input) {
16
+ choices: associatedItems,
17
+ async suggest(input) {
18
18
  if (!input)
19
19
  return associatedItems;
20
20
  const filteredChoices = await (0, api_1.queryAssociatedItems)(cmd, client, app.id, input);
21
21
  return filteredChoices || associatedItems;
22
22
  },
23
- validate: (answer) => {
24
- if (answer.length !== 1) {
25
- return "Only one role is allowed to be requested for on Okta or Azure apps.";
26
- }
27
- return true;
28
- },
29
23
  });
30
- const Roles = await rolePrompt.run();
24
+ const selectedRole = await rolePrompt.run();
31
25
  const entry = requestMap[app.id];
32
- for (const role of Roles) {
33
- if (!(role.id in entry.assets)) {
34
- entry.assets[role.id] = {
35
- assetId: role.id,
36
- assetName: role.name,
37
- type: (0, types_1.entityTypeFromString)(role.type),
38
- roles: {},
39
- };
40
- }
26
+ if (!(selectedRole.id in entry.assets)) {
27
+ entry.assets[selectedRole.id] = {
28
+ assetId: selectedRole.id,
29
+ assetName: selectedRole.name,
30
+ type: (0, types_1.entityTypeFromString)(selectedRole.type),
31
+ roles: {},
32
+ };
41
33
  }
42
34
  }
43
35
  async function chooseAssets(cmd, client, appId, requestMap) {
44
36
  const initial = (await (0, api_1.queryRequestableAssets)(cmd, client, appId, "")) || [];
45
37
  const assetPrompt = new AutoComplete({
46
38
  name: "Assets",
47
- message: "Select one or more assets:",
48
- hint: _1.multiSelectInstructions,
39
+ message: "Select an asset to request:",
40
+ hint: _1.selectInstructions,
49
41
  limit: 15,
50
- multiple: true,
51
- async choices(input) {
42
+ async suggest(input, choices) {
52
43
  if (!input) {
53
44
  return initial;
54
45
  }
55
46
  const filteredChoices = await (0, api_1.queryRequestableAssets)(cmd, client, appId, input);
56
47
  return filteredChoices || initial;
57
48
  },
58
- validate: (answer) => {
59
- if (answer.length < 1) {
60
- return "You must select at least one item.";
61
- }
62
- return true;
63
- },
49
+ choices: initial,
64
50
  });
65
- const Assets = await assetPrompt.run();
51
+ const selectedAsset = await assetPrompt.run();
66
52
  const entry = requestMap[appId];
67
- for (const asset of Assets) {
68
- if (entry === undefined) {
69
- throw new Error(`Error formatting app ${appId} in request`);
70
- }
71
- if (!(asset.id in entry.assets)) {
72
- entry.assets[asset.id] = {
73
- assetId: asset.id,
74
- assetName: asset.name,
75
- type: asset.type,
76
- roles: {},
77
- };
78
- }
79
- await (0, _1.chooseRoles)(cmd, client, appId, asset.id, requestMap);
53
+ if (entry === undefined) {
54
+ throw new Error(`Error formatting app ${appId} in request`);
55
+ }
56
+ if (!(selectedAsset.id in entry.assets)) {
57
+ entry.assets[selectedAsset.id] = {
58
+ assetId: selectedAsset.id,
59
+ assetName: selectedAsset.name,
60
+ type: selectedAsset.type,
61
+ roles: {},
62
+ };
80
63
  }
64
+ await (0, _1.chooseRoles)(cmd, client, appId, selectedAsset.id, requestMap);
81
65
  }
@@ -5,4 +5,3 @@ export { promptForReason } from "./reason-prompt";
5
5
  export { promptForDuration } from "./duration-prompt";
6
6
  export { doneSelectingAssets, promptRequestSubmission, } from "./validate-prompt";
7
7
  export declare const selectInstructions: string;
8
- export declare const multiSelectInstructions: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.multiSelectInstructions = exports.selectInstructions = exports.promptRequestSubmission = exports.doneSelectingAssets = exports.promptForDuration = exports.promptForReason = exports.chooseRoles = exports.chooseAssets = exports.chooseOktaAzureRoles = exports.selectRequestableItems = void 0;
3
+ exports.selectInstructions = exports.promptRequestSubmission = exports.doneSelectingAssets = exports.promptForDuration = exports.promptForReason = exports.chooseRoles = exports.chooseAssets = exports.chooseOktaAzureRoles = exports.selectRequestableItems = void 0;
4
4
  const chalk_1 = require("chalk");
5
5
  var apps_prompt_1 = require("./apps-prompt");
6
6
  Object.defineProperty(exports, "selectRequestableItems", { enumerable: true, get: function () { return apps_prompt_1.selectRequestableItems; } });
@@ -17,4 +17,3 @@ var validate_prompt_1 = require("./validate-prompt");
17
17
  Object.defineProperty(exports, "doneSelectingAssets", { enumerable: true, get: function () { return validate_prompt_1.doneSelectingAssets; } });
18
18
  Object.defineProperty(exports, "promptRequestSubmission", { enumerable: true, get: function () { return validate_prompt_1.promptRequestSubmission; } });
19
19
  exports.selectInstructions = chalk_1.default.dim("[↑↓] Navigate · [Enter] Select · Type to filter");
20
- exports.multiSelectInstructions = chalk_1.default.dim("[↑↓] Navigate · [Space] Select · [Enter] Confirm · Type to filter");
@@ -19,26 +19,17 @@ async function chooseRoles(cmd, client, appId, assetId, requestMap) {
19
19
  }
20
20
  const rolePrompt = new AutoComplete({
21
21
  name: "Roles",
22
- message: `Select one or more roles for ${assetEntry.assetName}:`,
23
- hint: _1.multiSelectInstructions,
22
+ message: `Select a role for ${assetEntry.assetName}:`,
23
+ hint: _1.selectInstructions,
24
24
  limit: 15,
25
- multiple: true,
26
25
  choices: assetRoles,
27
- validate: (answer) => {
28
- if (answer.length < 1) {
29
- return "You must select at least one item.";
30
- }
31
- return true;
32
- },
33
26
  });
34
- const roles = await rolePrompt.run();
27
+ const selectedRole = await rolePrompt.run();
35
28
  if (!assetEntry.roles) {
36
29
  assetEntry.roles = {};
37
30
  }
38
- for (const role of roles) {
39
- assetEntry.roles[role.id] = {
40
- roleId: role.id,
41
- roleName: role.name,
42
- };
43
- }
31
+ assetEntry.roles[selectedRole.id] = {
32
+ roleId: selectedRole.id,
33
+ roleName: selectedRole.name,
34
+ };
44
35
  }
@@ -1047,5 +1047,5 @@
1047
1047
  ]
1048
1048
  }
1049
1049
  },
1050
- "version": "3.2.3"
1050
+ "version": "3.2.4"
1051
1051
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opal-security",
3
3
  "description": "Opal allows you to centrally manage access to all of your sensitive systems.",
4
- "version": "3.2.3",
4
+ "version": "3.2.4",
5
5
  "author": "Stephen Cobbe",
6
6
  "bin": {
7
7
  "opal": "./bin/run"