opal-security 3.1.1-beta.7610828 β†’ 3.1.1-beta.e3941e0

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.1.1-beta.7610828 linux-x64 node-v20.19.1
25
+ opal-security/3.1.1-beta.e3941e0 linux-x64 node-v20.19.1
26
26
  $ opal --help [COMMAND]
27
27
  USAGE
28
28
  $ opal COMMAND
@@ -101,7 +101,7 @@ EXAMPLES
101
101
  $ opal aws:identity
102
102
  ```
103
103
 
104
- _See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/aws/identity.ts)_
104
+ _See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/aws/identity.ts)_
105
105
 
106
106
  ## `opal clear-auth-provider`
107
107
 
@@ -121,7 +121,7 @@ EXAMPLES
121
121
  $ opal clear-auth-provider
122
122
  ```
123
123
 
124
- _See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/clear-auth-provider.ts)_
124
+ _See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/clear-auth-provider.ts)_
125
125
 
126
126
  ## `opal curl-example`
127
127
 
@@ -138,7 +138,7 @@ DESCRIPTION
138
138
  Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.
139
139
  ```
140
140
 
141
- _See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/curl-example.ts)_
141
+ _See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/curl-example.ts)_
142
142
 
143
143
  ## `opal groups get`
144
144
 
@@ -159,7 +159,7 @@ EXAMPLES
159
159
  $ opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
160
160
  ```
161
161
 
162
- _See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/groups/get.ts)_
162
+ _See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/groups/get.ts)_
163
163
 
164
164
  ## `opal help [COMMANDS]`
165
165
 
@@ -209,7 +209,7 @@ EXAMPLES
209
209
  $ opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName "custom-profile"
210
210
  ```
211
211
 
212
- _See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/iam-roles/start.ts)_
212
+ _See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/iam-roles/start.ts)_
213
213
 
214
214
  ## `opal kube-roles start`
215
215
 
@@ -240,7 +240,7 @@ EXAMPLES
240
240
  $ opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId "arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role"
241
241
  ```
242
242
 
243
- _See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/kube-roles/start.ts)_
243
+ _See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/kube-roles/start.ts)_
244
244
 
245
245
  ## `opal login`
246
246
 
@@ -261,7 +261,7 @@ EXAMPLES
261
261
  $ opal login
262
262
  ```
263
263
 
264
- _See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/login.ts)_
264
+ _See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/login.ts)_
265
265
 
266
266
  ## `opal logout`
267
267
 
@@ -281,7 +281,7 @@ EXAMPLES
281
281
  $ opal logout
282
282
  ```
283
283
 
284
- _See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/logout.ts)_
284
+ _See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/logout.ts)_
285
285
 
286
286
  ## `opal postgres-instances start`
287
287
 
@@ -318,7 +318,7 @@ EXAMPLES
318
318
  $ opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId fullaccess --action view
319
319
  ```
320
320
 
321
- _See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/postgres-instances/start.ts)_
321
+ _See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/postgres-instances/start.ts)_
322
322
 
323
323
  ## `opal resources get`
324
324
 
@@ -339,7 +339,7 @@ EXAMPLES
339
339
  $ opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
340
340
  ```
341
341
 
342
- _See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/resources/get.ts)_
342
+ _See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/resources/get.ts)_
343
343
 
344
344
  ## `opal set-auth-provider`
345
345
 
@@ -365,7 +365,7 @@ EXAMPLES
365
365
  $ opal set-auth-provider --clientID 1234asdf --issuerUrl https://auth.example.com
366
366
  ```
367
367
 
368
- _See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/set-auth-provider.ts)_
368
+ _See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/set-auth-provider.ts)_
369
369
 
370
370
  ## `opal set-custom-header`
371
371
 
@@ -386,7 +386,7 @@ EXAMPLES
386
386
  $ opal set-custom-header --header 'cf-access-token: $TOKEN'
387
387
  ```
388
388
 
389
- _See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/set-custom-header.ts)_
389
+ _See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/set-custom-header.ts)_
390
390
 
391
391
  ## `opal set-token`
392
392
 
@@ -406,7 +406,7 @@ EXAMPLES
406
406
  $ opal set-token
407
407
  ```
408
408
 
409
- _See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/set-token.ts)_
409
+ _See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/set-token.ts)_
410
410
 
411
411
  ## `opal set-url [URL]`
412
412
 
@@ -430,7 +430,7 @@ EXAMPLES
430
430
  $ opal set-url
431
431
  ```
432
432
 
433
- _See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/set-url.ts)_
433
+ _See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/set-url.ts)_
434
434
 
435
435
  ## `opal ssh copyFrom`
436
436
 
@@ -461,7 +461,7 @@ EXAMPLES
461
461
  $ opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
462
462
  ```
463
463
 
464
- _See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/ssh/copyFrom.ts)_
464
+ _See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/ssh/copyFrom.ts)_
465
465
 
466
466
  ## `opal ssh copyTo`
467
467
 
@@ -492,7 +492,7 @@ EXAMPLES
492
492
  $ opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
493
493
  ```
494
494
 
495
- _See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/ssh/copyTo.ts)_
495
+ _See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/ssh/copyTo.ts)_
496
496
 
497
497
  ## `opal ssh start`
498
498
 
@@ -519,7 +519,7 @@ EXAMPLES
519
519
  $ opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398
520
520
  ```
521
521
 
522
- _See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.7610828/src/commands/ssh/start.ts)_
522
+ _See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e3941e0/src/commands/ssh/start.ts)_
523
523
 
524
524
  ## `opal version`
525
525
 
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const chalk_1 = require("chalk");
4
5
  const graphql_1 = require("../../graphql");
5
6
  const apollo_1 = require("../../lib/apollo");
6
7
  const cmd_1 = require("../../lib/cmd");
@@ -76,15 +77,17 @@ class GetRequest extends core_1.Command {
76
77
  fetchPolicy: "network-only", // to avoid caching
77
78
  });
78
79
  switch (resp.data.request.__typename) {
79
- case "RequestResult":
80
+ case "RequestResult": {
80
81
  if (flags.verbose) {
81
82
  (0, apollo_1.printResponse)(this, resp);
82
83
  }
83
84
  else {
84
85
  (0, displays_1.displayRequestDetails)(this, resp);
85
86
  }
86
- this.log(`\nπŸ’‘Click to see request details on web: ${configData[config_1.urlKey]}/requests/sent/${flags.id}`);
87
+ const url = `${configData[config_1.urlKey]}/requests/sent/${flags.id}`;
88
+ this.log(`\nπŸ’‘Link to request details: ${chalk_1.default.underline(url)}`);
87
89
  return;
90
+ }
88
91
  case "RequestNotFoundError":
89
92
  this.log(`🚫 Request with id ${flags.id} was not found`);
90
93
  return;
@@ -6,7 +6,6 @@ exports.displayFinalRequestSummary = displayFinalRequestSummary;
6
6
  exports.displayRequestDetails = displayRequestDetails;
7
7
  exports.displayRequestList = displayRequestList;
8
8
  const chalk_1 = require("chalk");
9
- const prettyjson_1 = require("prettyjson");
10
9
  const treeify = require("object-treeify");
11
10
  const Table = require("cli-table3");
12
11
  const tableStyle = {
@@ -28,7 +27,7 @@ const tableStyle = {
28
27
  };
29
28
  function headerMessage(cmd) {
30
29
  console.clear();
31
- cmd.log("============================================================");
30
+ cmd.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
32
31
  cmd.log("Opal Access Request ✏️");
33
32
  cmd.log("Press Ctrl+C to cancel at any time.\n");
34
33
  }
@@ -68,48 +67,57 @@ function displayFinalRequestSummary(cmd, requestMap, reason, expiration) {
68
67
  cmd.log(table.toString());
69
68
  }
70
69
  function displayRequestDetails(cmd, requestResp) {
71
- var _a, _b;
70
+ var _a, _b, _c, _d, _e, _f;
72
71
  switch (requestResp.data.request.__typename) {
73
72
  case "RequestResult": {
74
- cmd.log(`REQUEST ${requestResp.data.request.request.id}`);
73
+ cmd.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
74
+ cmd.log(`Request Details ${chalk_1.default.cyan(requestResp.data.request.request.id)}`);
75
+ cmd.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
75
76
  const status = requestResp.data.request.request.status;
76
77
  // If status is "PENDING" or "APPROVED", display it
77
78
  // If status is "DENIED", display it in red
78
79
  if (status === "PENDING") {
79
- cmd.log(`Status: ${chalk_1.default.yellowBright(status)}`);
80
+ cmd.log(`${chalk_1.default.bold("Status:")} ${chalk_1.default.blueBright(status)}`);
80
81
  }
81
82
  else if (status === "APPROVED") {
82
- cmd.log(`Status: ${chalk_1.default.greenBright(status)}`);
83
+ cmd.log(`${chalk_1.default.bold("Status:")} ${chalk_1.default.greenBright(status)}`);
83
84
  }
84
85
  else if (status === "DENIED") {
85
- cmd.log(`Status: ${chalk_1.default.redBright(status)}`);
86
+ cmd.log(`${chalk_1.default.bold("Status:")} ${chalk_1.default.redBright(status)}`);
86
87
  }
87
88
  else if (status === "CANCELED") {
88
- cmd.log(`Status: ${chalk_1.default.redBright(status)}`);
89
+ cmd.log(`${chalk_1.default.bold("Status:")} ${chalk_1.default.redBright(status)}`);
89
90
  }
90
- // Request users "Requester: <requester> -> Target: <targetUser>"
91
+ // Request users "Requested by: <requester> -> Requested for: <targetUser>"
91
92
  const requester = (_a = requestResp.data.request.request.requester) === null || _a === void 0 ? void 0 : _a.displayName;
92
93
  const targetUser = (_b = requestResp.data.request.request.targetUser) === null || _b === void 0 ? void 0 : _b.displayName;
93
94
  if (requester && targetUser) {
94
- cmd.log(`Requester: ${requester} -> Target: ${targetUser}`);
95
+ cmd.log(`${chalk_1.default.bold("Requested by:")} ${requester} ${chalk_1.default.gray("->")} ${chalk_1.default.bold("Requested for:")} ${targetUser}`);
95
96
  }
96
97
  const durationInMinutes = requestResp.data.request.request.durationInMinutes;
97
98
  if (durationInMinutes) {
98
- cmd.log(`Duration: ${formatDuration(durationInMinutes)}`);
99
+ cmd.log(`${chalk_1.default.bold("Duration:")} ${formatDuration(durationInMinutes)}`);
99
100
  }
100
101
  const reason = requestResp.data.request.request.reason;
101
102
  if (reason) {
102
- cmd.log(`Reason: "${reason}"`);
103
+ cmd.log(`${chalk_1.default.bold("Reason:")} "${chalk_1.default.italic(reason)}"`);
103
104
  }
104
- const requestedResources = requestResp.data.request.request.requestedResources;
105
- const requestedGroups = requestResp.data.request.request.requestedGroups;
106
- if (requestedResources && requestedResources.length > 0) {
107
- cmd.log("Requested Resources:");
108
- cmd.log((0, prettyjson_1.render)(requestedResources));
109
- }
110
- if (requestedGroups && requestedGroups.length > 0) {
111
- cmd.log("Requested Groups:");
112
- cmd.log((0, prettyjson_1.render)(requestedGroups));
105
+ // Requested resources
106
+ const requestedResources = (_d = (_c = requestResp.data.request.request.requestedResources) === null || _c === void 0 ? void 0 : _c.map((resource) => {
107
+ var _a, _b, _c;
108
+ if (((_a = resource.resource) === null || _a === void 0 ? void 0 : _a.__typename) === "Resource") {
109
+ return formatAssetName((_b = resource.resource) === null || _b === void 0 ? void 0 : _b.displayName, ((_c = resource.accessLevel) === null || _c === void 0 ? void 0 : _c.accessLevelName) || "");
110
+ }
111
+ })) !== null && _d !== void 0 ? _d : [];
112
+ const requestedGroups = (_f = (_e = requestResp.data.request.request.requestedGroups) === null || _e === void 0 ? void 0 : _e.map((group) => {
113
+ var _a, _b, _c;
114
+ if (((_a = group.group) === null || _a === void 0 ? void 0 : _a.__typename) === "Group") {
115
+ return formatAssetName((_b = group.group) === null || _b === void 0 ? void 0 : _b.name, ((_c = group.accessLevel) === null || _c === void 0 ? void 0 : _c.accessLevelName) || "");
116
+ }
117
+ })) !== null && _f !== void 0 ? _f : [];
118
+ const requestedItems = [...requestedResources, ...requestedGroups].join(", ");
119
+ if (requestedItems) {
120
+ cmd.log(`${chalk_1.default.bold("Requested Items:")} ${chalk_1.default.cyan(requestedItems)}`);
113
121
  }
114
122
  }
115
123
  }
@@ -142,7 +150,6 @@ function displayRequestList(cmd, requestResp) {
142
150
  if (request.durationInMinutes) {
143
151
  formattedDuration = formatDuration(request.durationInMinutes);
144
152
  }
145
- // Requested resources
146
153
  const requestedResources = (_c = (_b = request.requestedResources) === null || _b === void 0 ? void 0 : _b.map((resource) => {
147
154
  var _a, _b, _c;
148
155
  if (((_a = resource.resource) === null || _a === void 0 ? void 0 : _a.__typename) === "Resource") {
@@ -966,5 +966,5 @@
966
966
  ]
967
967
  }
968
968
  },
969
- "version": "3.1.1-beta.7610828"
969
+ "version": "3.1.1-beta.e3941e0"
970
970
  }
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.1.1-beta.7610828",
4
+ "version": "3.1.1-beta.e3941e0",
5
5
  "author": "Stephen Cobbe",
6
6
  "bin": {
7
7
  "opal": "./bin/run"