opal-security 3.1.1-beta.b652df3 ā 3.1.1-beta.e1a2332
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 +99 -21
- package/lib/commands/request/create.d.ts +0 -1
- package/lib/commands/request/create.js +2 -3
- package/lib/commands/request/get.d.ts +0 -1
- package/lib/commands/request/get.js +1 -4
- package/lib/commands/request/list.d.ts +0 -1
- package/lib/commands/request/list.js +0 -3
- package/lib/commands/whoami.js +1 -1
- package/lib/lib/requests.d.ts +1 -0
- package/lib/lib/requests.js +6 -2
- package/lib/utils/displays.js +6 -1
- package/oclif.manifest.json +2 -5
- package/package.json +4 -5
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.
|
|
25
|
+
opal-security/3.1.1-beta.e1a2332 linux-x64 node-v20.19.2
|
|
26
26
|
$ opal --help [COMMAND]
|
|
27
27
|
USAGE
|
|
28
28
|
$ opal COMMAND
|
|
@@ -44,6 +44,9 @@ USAGE
|
|
|
44
44
|
* [`opal login`](#opal-login)
|
|
45
45
|
* [`opal logout`](#opal-logout)
|
|
46
46
|
* [`opal postgres-instances start`](#opal-postgres-instances-start)
|
|
47
|
+
* [`opal request create`](#opal-request-create)
|
|
48
|
+
* [`opal request get`](#opal-request-get)
|
|
49
|
+
* [`opal request list`](#opal-request-list)
|
|
47
50
|
* [`opal resources get`](#opal-resources-get)
|
|
48
51
|
* [`opal set-auth-provider`](#opal-set-auth-provider)
|
|
49
52
|
* [`opal set-custom-header`](#opal-set-custom-header)
|
|
@@ -102,7 +105,7 @@ EXAMPLES
|
|
|
102
105
|
$ opal aws:identity
|
|
103
106
|
```
|
|
104
107
|
|
|
105
|
-
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
108
|
+
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/aws/identity.ts)_
|
|
106
109
|
|
|
107
110
|
## `opal clear-auth-provider`
|
|
108
111
|
|
|
@@ -122,7 +125,7 @@ EXAMPLES
|
|
|
122
125
|
$ opal clear-auth-provider
|
|
123
126
|
```
|
|
124
127
|
|
|
125
|
-
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
128
|
+
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/clear-auth-provider.ts)_
|
|
126
129
|
|
|
127
130
|
## `opal curl-example`
|
|
128
131
|
|
|
@@ -139,7 +142,7 @@ DESCRIPTION
|
|
|
139
142
|
Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.
|
|
140
143
|
```
|
|
141
144
|
|
|
142
|
-
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
145
|
+
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/curl-example.ts)_
|
|
143
146
|
|
|
144
147
|
## `opal groups get`
|
|
145
148
|
|
|
@@ -160,7 +163,7 @@ EXAMPLES
|
|
|
160
163
|
$ opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
161
164
|
```
|
|
162
165
|
|
|
163
|
-
_See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
166
|
+
_See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/groups/get.ts)_
|
|
164
167
|
|
|
165
168
|
## `opal help [COMMANDS]`
|
|
166
169
|
|
|
@@ -210,7 +213,7 @@ EXAMPLES
|
|
|
210
213
|
$ opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName "custom-profile"
|
|
211
214
|
```
|
|
212
215
|
|
|
213
|
-
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
216
|
+
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/iam-roles/start.ts)_
|
|
214
217
|
|
|
215
218
|
## `opal kube-roles start`
|
|
216
219
|
|
|
@@ -241,7 +244,7 @@ EXAMPLES
|
|
|
241
244
|
$ opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId "arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role"
|
|
242
245
|
```
|
|
243
246
|
|
|
244
|
-
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
247
|
+
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/kube-roles/start.ts)_
|
|
245
248
|
|
|
246
249
|
## `opal login`
|
|
247
250
|
|
|
@@ -262,7 +265,7 @@ EXAMPLES
|
|
|
262
265
|
$ opal login
|
|
263
266
|
```
|
|
264
267
|
|
|
265
|
-
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
268
|
+
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/login.ts)_
|
|
266
269
|
|
|
267
270
|
## `opal logout`
|
|
268
271
|
|
|
@@ -282,7 +285,7 @@ EXAMPLES
|
|
|
282
285
|
$ opal logout
|
|
283
286
|
```
|
|
284
287
|
|
|
285
|
-
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
288
|
+
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/logout.ts)_
|
|
286
289
|
|
|
287
290
|
## `opal postgres-instances start`
|
|
288
291
|
|
|
@@ -319,7 +322,82 @@ EXAMPLES
|
|
|
319
322
|
$ opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId fullaccess --action view
|
|
320
323
|
```
|
|
321
324
|
|
|
322
|
-
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
325
|
+
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/postgres-instances/start.ts)_
|
|
326
|
+
|
|
327
|
+
## `opal request create`
|
|
328
|
+
|
|
329
|
+
Creates an Opal access request via an interactive form
|
|
330
|
+
|
|
331
|
+
```
|
|
332
|
+
USAGE
|
|
333
|
+
$ opal request create [-h] [-a <value>...] [-r <value>] [-d <value>]
|
|
334
|
+
|
|
335
|
+
FLAGS
|
|
336
|
+
-a, --assets=<value>... The ids of the assets (resource, group) to request access to. Append a role ID using a colon
|
|
337
|
+
if needed, e.g. `--assets 123:456`.
|
|
338
|
+
If not provided, an interactive selection flow will be available to select assets to request.
|
|
339
|
+
-d, --duration=<value> The duration of access for the request in minutes. If not provided, you will be prompted.
|
|
340
|
+
-h, --help Show CLI help.
|
|
341
|
+
-r, --reason=<value> The reason for the request, contained in quotes. If not provided, you will be prompted.
|
|
342
|
+
|
|
343
|
+
DESCRIPTION
|
|
344
|
+
Creates an Opal access request via an interactive form
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
_See code: [src/commands/request/create.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/request/create.ts)_
|
|
348
|
+
|
|
349
|
+
## `opal request get`
|
|
350
|
+
|
|
351
|
+
Lists access requests
|
|
352
|
+
|
|
353
|
+
```
|
|
354
|
+
USAGE
|
|
355
|
+
$ opal request get [-h] [-i <value>] [-v]
|
|
356
|
+
|
|
357
|
+
FLAGS
|
|
358
|
+
-h, --help Show CLI help.
|
|
359
|
+
-i, --id=<value> The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]
|
|
360
|
+
-v, --verbose Enable verbose output, prints full response in JSON format. Defaults to false.
|
|
361
|
+
|
|
362
|
+
DESCRIPTION
|
|
363
|
+
Lists access requests
|
|
364
|
+
|
|
365
|
+
EXAMPLES
|
|
366
|
+
$ opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
367
|
+
|
|
368
|
+
$ opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4 --verbose
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
_See code: [src/commands/request/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/request/get.ts)_
|
|
372
|
+
|
|
373
|
+
## `opal request list`
|
|
374
|
+
|
|
375
|
+
Lists your n recent outgoing access requests
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
USAGE
|
|
379
|
+
$ opal request list [-h] [-n <value>] [-p] [-v]
|
|
380
|
+
|
|
381
|
+
FLAGS
|
|
382
|
+
-h, --help Show CLI help.
|
|
383
|
+
-n, --n=<value> [default: 10] Defines number of requests to be returned. 1 <= n <= 100.
|
|
384
|
+
-p, --pending Show only pending requests. Defaults to false.
|
|
385
|
+
-v, --verbose Enable verbose output, prints full response in JSON format. Defaults to false.
|
|
386
|
+
|
|
387
|
+
DESCRIPTION
|
|
388
|
+
Lists your n recent outgoing access requests
|
|
389
|
+
|
|
390
|
+
EXAMPLES
|
|
391
|
+
$ opal request list --n 5
|
|
392
|
+
|
|
393
|
+
$ opal request list --n 5 --pending
|
|
394
|
+
|
|
395
|
+
$ opal request list --n 5 --verbose
|
|
396
|
+
|
|
397
|
+
$ opal request list --n 5 --pending --verbose
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
_See code: [src/commands/request/list.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/request/list.ts)_
|
|
323
401
|
|
|
324
402
|
## `opal resources get`
|
|
325
403
|
|
|
@@ -340,7 +418,7 @@ EXAMPLES
|
|
|
340
418
|
$ opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
341
419
|
```
|
|
342
420
|
|
|
343
|
-
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
421
|
+
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/resources/get.ts)_
|
|
344
422
|
|
|
345
423
|
## `opal set-auth-provider`
|
|
346
424
|
|
|
@@ -366,7 +444,7 @@ EXAMPLES
|
|
|
366
444
|
$ opal set-auth-provider --clientID 1234asdf --issuerUrl https://auth.example.com
|
|
367
445
|
```
|
|
368
446
|
|
|
369
|
-
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
447
|
+
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/set-auth-provider.ts)_
|
|
370
448
|
|
|
371
449
|
## `opal set-custom-header`
|
|
372
450
|
|
|
@@ -387,7 +465,7 @@ EXAMPLES
|
|
|
387
465
|
$ opal set-custom-header --header 'cf-access-token: $TOKEN'
|
|
388
466
|
```
|
|
389
467
|
|
|
390
|
-
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
468
|
+
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/set-custom-header.ts)_
|
|
391
469
|
|
|
392
470
|
## `opal set-token`
|
|
393
471
|
|
|
@@ -407,7 +485,7 @@ EXAMPLES
|
|
|
407
485
|
$ opal set-token
|
|
408
486
|
```
|
|
409
487
|
|
|
410
|
-
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
488
|
+
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/set-token.ts)_
|
|
411
489
|
|
|
412
490
|
## `opal set-url [URL]`
|
|
413
491
|
|
|
@@ -431,7 +509,7 @@ EXAMPLES
|
|
|
431
509
|
$ opal set-url
|
|
432
510
|
```
|
|
433
511
|
|
|
434
|
-
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
512
|
+
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/set-url.ts)_
|
|
435
513
|
|
|
436
514
|
## `opal ssh copyFrom`
|
|
437
515
|
|
|
@@ -462,7 +540,7 @@ EXAMPLES
|
|
|
462
540
|
$ opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
463
541
|
```
|
|
464
542
|
|
|
465
|
-
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
543
|
+
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/ssh/copyFrom.ts)_
|
|
466
544
|
|
|
467
545
|
## `opal ssh copyTo`
|
|
468
546
|
|
|
@@ -493,7 +571,7 @@ EXAMPLES
|
|
|
493
571
|
$ opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
494
572
|
```
|
|
495
573
|
|
|
496
|
-
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
574
|
+
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/ssh/copyTo.ts)_
|
|
497
575
|
|
|
498
576
|
## `opal ssh start`
|
|
499
577
|
|
|
@@ -520,7 +598,7 @@ EXAMPLES
|
|
|
520
598
|
$ opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
521
599
|
```
|
|
522
600
|
|
|
523
|
-
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
601
|
+
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/ssh/start.ts)_
|
|
524
602
|
|
|
525
603
|
## `opal version`
|
|
526
604
|
|
|
@@ -544,7 +622,7 @@ _See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/
|
|
|
544
622
|
|
|
545
623
|
## `opal whoami`
|
|
546
624
|
|
|
547
|
-
Describes current url set, organization name, and logged in user if
|
|
625
|
+
Describes current url set, organization name, and logged in user if applicable.
|
|
548
626
|
|
|
549
627
|
```
|
|
550
628
|
USAGE
|
|
@@ -554,8 +632,8 @@ FLAGS
|
|
|
554
632
|
-h, --help Show CLI help.
|
|
555
633
|
|
|
556
634
|
DESCRIPTION
|
|
557
|
-
Describes current url set, organization name, and logged in user if
|
|
635
|
+
Describes current url set, organization name, and logged in user if applicable.
|
|
558
636
|
```
|
|
559
637
|
|
|
560
|
-
_See code: [src/commands/whoami.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.
|
|
638
|
+
_See code: [src/commands/whoami.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.e1a2332/src/commands/whoami.ts)_
|
|
561
639
|
<!-- commandsstop -->
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const apollo_1 = require("../../lib/apollo");
|
|
5
|
+
const cmd_1 = require("../../lib/cmd");
|
|
5
6
|
const flags_1 = require("../../lib/flags");
|
|
6
7
|
const requests_1 = require("../../lib/requests");
|
|
7
8
|
const displays_1 = require("../../utils/displays");
|
|
8
|
-
const utils_1 = require("../../utils/utils");
|
|
9
9
|
class RequestCreate extends core_1.Command {
|
|
10
10
|
async run() {
|
|
11
|
+
(0, cmd_1.setMostRecentCommand)(this);
|
|
11
12
|
await (0, apollo_1.initClient)(this, true);
|
|
12
13
|
const client = await (0, apollo_1.getClient)(this, true);
|
|
13
|
-
(0, utils_1.restrictToDev)(); //TODO: Remove after development is complete
|
|
14
14
|
const { flags } = await this.parse(RequestCreate);
|
|
15
15
|
const metadata = (0, requests_1.initEmptyRequestMetadata)();
|
|
16
16
|
if (flags.assets) {
|
|
@@ -60,7 +60,6 @@ class RequestCreate extends core_1.Command {
|
|
|
60
60
|
await (0, requests_1.submitFinalRequest)(this, client, metadata);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
RequestCreate.hidden = true;
|
|
64
63
|
RequestCreate.description = "Creates an Opal access request via an interactive form";
|
|
65
64
|
RequestCreate.flags = {
|
|
66
65
|
help: flags_1.SHARED_FLAGS.help,
|
|
@@ -8,7 +8,6 @@ const cmd_1 = require("../../lib/cmd");
|
|
|
8
8
|
const config_1 = require("../../lib/config");
|
|
9
9
|
const flags_1 = require("../../lib/flags");
|
|
10
10
|
const displays_1 = require("../../utils/displays");
|
|
11
|
-
const utils_1 = require("../../utils/utils");
|
|
12
11
|
const GET_REQUEST = (0, graphql_1.graphql)(`
|
|
13
12
|
query GetRequest(
|
|
14
13
|
$id: RequestId!
|
|
@@ -58,14 +57,13 @@ const GET_REQUEST = (0, graphql_1.graphql)(`
|
|
|
58
57
|
`);
|
|
59
58
|
class GetRequest extends core_1.Command {
|
|
60
59
|
async run() {
|
|
61
|
-
(0, utils_1.restrictToDev)(); //TODO: Remove after development is complete
|
|
62
60
|
(0, cmd_1.setMostRecentCommand)(this);
|
|
63
61
|
const configData = (0, config_1.getOrCreateConfigData)(this.config.configDir);
|
|
64
62
|
const client = await (0, apollo_1.getClient)(this, true);
|
|
65
63
|
// Verify id tag was provided
|
|
66
64
|
const { flags } = await this.parse(GetRequest);
|
|
67
65
|
if (!flags.id) {
|
|
68
|
-
this.log("Error: Please provide a
|
|
66
|
+
this.log("Error: Please provide a request ID using the --id flag.");
|
|
69
67
|
this.log("ex. opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4");
|
|
70
68
|
return;
|
|
71
69
|
}
|
|
@@ -96,7 +94,6 @@ class GetRequest extends core_1.Command {
|
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
|
-
GetRequest.hidden = true;
|
|
100
97
|
GetRequest.description = "Lists access requests";
|
|
101
98
|
GetRequest.flags = {
|
|
102
99
|
help: flags_1.SHARED_FLAGS.help,
|
|
@@ -6,7 +6,6 @@ const apollo_1 = require("../../lib/apollo");
|
|
|
6
6
|
const cmd_1 = require("../../lib/cmd");
|
|
7
7
|
const flags_1 = require("../../lib/flags");
|
|
8
8
|
const displays_1 = require("../../utils/displays");
|
|
9
|
-
const utils_1 = require("../../utils/utils");
|
|
10
9
|
// Add date filters, search query,
|
|
11
10
|
const GET_REQUESTS = (0, graphql_1.graphql)(`
|
|
12
11
|
query GetRequests($pageSize: Int, $showPendingOnly: Boolean!) {
|
|
@@ -59,7 +58,6 @@ const GET_REQUESTS = (0, graphql_1.graphql)(`
|
|
|
59
58
|
}`);
|
|
60
59
|
class ListRequests extends core_1.Command {
|
|
61
60
|
async run() {
|
|
62
|
-
(0, utils_1.restrictToDev)(); //TODO: Remove after development is complete
|
|
63
61
|
(0, cmd_1.setMostRecentCommand)(this);
|
|
64
62
|
const client = await (0, apollo_1.getClient)(this, true);
|
|
65
63
|
let pageSize = 10;
|
|
@@ -88,7 +86,6 @@ class ListRequests extends core_1.Command {
|
|
|
88
86
|
}
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
ListRequests.hidden = true;
|
|
92
89
|
ListRequests.description = "Lists your n recent outgoing access requests";
|
|
93
90
|
ListRequests.examples = [
|
|
94
91
|
"opal request list --n 5",
|
package/lib/commands/whoami.js
CHANGED
|
@@ -27,7 +27,7 @@ class WhoAmI extends core_1.Command {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
WhoAmI.description = "Describes current url set, organization name, and logged in user if
|
|
30
|
+
WhoAmI.description = "Describes current url set, organization name, and logged in user if applicable.";
|
|
31
31
|
WhoAmI.flags = {
|
|
32
32
|
help: flags_1.SHARED_FLAGS.help,
|
|
33
33
|
};
|
package/lib/lib/requests.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare function promptForReason(metadata: RequestMetadata): Promise<void
|
|
|
48
48
|
export declare function promptForExpiration(metadata: RequestMetadata): Promise<void>;
|
|
49
49
|
export declare function promptRequestSubmission(cmd: Command, metadata: RequestMetadata): Promise<boolean>;
|
|
50
50
|
export declare function submitFinalRequest(cmd: Command, client: ApolloClient<NormalizedCacheObject>, metadata: RequestMetadata): Promise<void>;
|
|
51
|
+
export declare function getRequestLink(cmd: Command, id: string): string;
|
|
51
52
|
export declare function bypassRequestSelection(cmd: Command, client: ApolloClient<NormalizedCacheObject>, flagValue: string[], metadata: RequestMetadata): Promise<void>;
|
|
52
53
|
export declare function bypassDuration(cmd: Command, duration: number, metadata: RequestMetadata): void;
|
|
53
54
|
export {};
|
package/lib/lib/requests.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.promptForReason = promptForReason;
|
|
|
9
9
|
exports.promptForExpiration = promptForExpiration;
|
|
10
10
|
exports.promptRequestSubmission = promptRequestSubmission;
|
|
11
11
|
exports.submitFinalRequest = submitFinalRequest;
|
|
12
|
+
exports.getRequestLink = getRequestLink;
|
|
12
13
|
exports.bypassRequestSelection = bypassRequestSelection;
|
|
13
14
|
exports.bypassDuration = bypassDuration;
|
|
14
15
|
const chalk_1 = require("chalk");
|
|
@@ -1058,18 +1059,21 @@ async function submitFinalRequest(cmd, client, metadata) {
|
|
|
1058
1059
|
}
|
|
1059
1060
|
const resp = await createRequest(cmd, client, requestedResources, requestedGroups, metadata.reason, metadata.durationInMinutes);
|
|
1060
1061
|
// Build link to request
|
|
1061
|
-
const configData = (0, config_1.getOrCreateConfigData)(cmd.config.configDir);
|
|
1062
1062
|
if (resp === null || resp === void 0 ? void 0 : resp.id) {
|
|
1063
1063
|
cmd.log("\nš Your Access Request has been submitted!\n");
|
|
1064
1064
|
cmd.log(`${chalk_1.default.bold("ID: ")} ${chalk_1.default.cyan(resp === null || resp === void 0 ? void 0 : resp.id)}`);
|
|
1065
1065
|
if (resp === null || resp === void 0 ? void 0 : resp.status) {
|
|
1066
1066
|
cmd.log((0, displays_1.getStyledStatus)(resp === null || resp === void 0 ? void 0 : resp.status));
|
|
1067
1067
|
}
|
|
1068
|
-
const requestLink =
|
|
1068
|
+
const requestLink = getRequestLink(cmd, resp.id);
|
|
1069
1069
|
cmd.log(`${chalk_1.default.bold("Link:")} ${chalk_1.default.underline(requestLink)}\n`);
|
|
1070
1070
|
}
|
|
1071
1071
|
return;
|
|
1072
1072
|
}
|
|
1073
|
+
function getRequestLink(cmd, id) {
|
|
1074
|
+
const configData = (0, config_1.getOrCreateConfigData)(cmd.config.configDir);
|
|
1075
|
+
return `${configData[config_1.urlKey]}/requests/sent/${id}`;
|
|
1076
|
+
}
|
|
1073
1077
|
async function bypassRequestSelection(cmd, client, flagValue, metadata) {
|
|
1074
1078
|
var _a, _b;
|
|
1075
1079
|
try {
|
package/lib/utils/displays.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.getStyledStatus = getStyledStatus;
|
|
|
7
7
|
exports.displayRequestDetails = displayRequestDetails;
|
|
8
8
|
exports.displayRequestListTable = displayRequestListTable;
|
|
9
9
|
const chalk_1 = require("chalk");
|
|
10
|
+
const terminal_link_1 = require("terminal-link");
|
|
10
11
|
const requests_1 = require("../lib/requests");
|
|
11
12
|
const Table = require("cli-table3");
|
|
12
13
|
const treeify = require("object-treeify").default;
|
|
@@ -172,8 +173,12 @@ function displayRequestListTable(cmd, requestResp) {
|
|
|
172
173
|
...requestedResources,
|
|
173
174
|
...requestedGroups,
|
|
174
175
|
].join(", ");
|
|
176
|
+
const requestLink = (0, requests_1.getRequestLink)(cmd, request.id);
|
|
177
|
+
const clickableId = (0, terminal_link_1.default)(request.id, requestLink, {
|
|
178
|
+
fallback: false,
|
|
179
|
+
});
|
|
175
180
|
table.push([
|
|
176
|
-
|
|
181
|
+
clickableId,
|
|
177
182
|
status,
|
|
178
183
|
targetUser,
|
|
179
184
|
formattedDuration,
|
package/oclif.manifest.json
CHANGED
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
"whoami": {
|
|
320
320
|
"aliases": [],
|
|
321
321
|
"args": {},
|
|
322
|
-
"description": "Describes current url set, organization name, and logged in user if
|
|
322
|
+
"description": "Describes current url set, organization name, and logged in user if applicable.",
|
|
323
323
|
"flags": {
|
|
324
324
|
"help": {
|
|
325
325
|
"char": "h",
|
|
@@ -660,7 +660,6 @@
|
|
|
660
660
|
}
|
|
661
661
|
},
|
|
662
662
|
"hasDynamicHelp": false,
|
|
663
|
-
"hidden": true,
|
|
664
663
|
"hiddenAliases": [],
|
|
665
664
|
"id": "request:create",
|
|
666
665
|
"pluginAlias": "opal-security",
|
|
@@ -709,7 +708,6 @@
|
|
|
709
708
|
}
|
|
710
709
|
},
|
|
711
710
|
"hasDynamicHelp": false,
|
|
712
|
-
"hidden": true,
|
|
713
711
|
"hiddenAliases": [],
|
|
714
712
|
"id": "request:get",
|
|
715
713
|
"pluginAlias": "opal-security",
|
|
@@ -768,7 +766,6 @@
|
|
|
768
766
|
}
|
|
769
767
|
},
|
|
770
768
|
"hasDynamicHelp": false,
|
|
771
|
-
"hidden": true,
|
|
772
769
|
"hiddenAliases": [],
|
|
773
770
|
"id": "request:list",
|
|
774
771
|
"pluginAlias": "opal-security",
|
|
@@ -1031,5 +1028,5 @@
|
|
|
1031
1028
|
]
|
|
1032
1029
|
}
|
|
1033
1030
|
},
|
|
1034
|
-
"version": "3.1.1-beta.
|
|
1031
|
+
"version": "3.1.1-beta.e1a2332"
|
|
1035
1032
|
}
|
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.
|
|
4
|
+
"version": "3.1.1-beta.e1a2332",
|
|
5
5
|
"author": "Stephen Cobbe",
|
|
6
6
|
"bin": {
|
|
7
7
|
"opal": "./bin/run"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"openid-client": "^5.6.5",
|
|
30
30
|
"prettyjson": "^1.2.1",
|
|
31
31
|
"semver": "^7.5.4",
|
|
32
|
+
"terminal-link": "^4.0.0",
|
|
32
33
|
"tslib": "^2.8.1"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
@@ -63,9 +64,7 @@
|
|
|
63
64
|
"/scripts"
|
|
64
65
|
],
|
|
65
66
|
"homepage": "https://github.com/opalsecurity/opal-cli/",
|
|
66
|
-
"keywords": [
|
|
67
|
-
"oclif"
|
|
68
|
-
],
|
|
67
|
+
"keywords": ["oclif"],
|
|
69
68
|
"license": "MIT",
|
|
70
69
|
"main": "lib/index.js",
|
|
71
70
|
"oclif": {
|
|
@@ -91,7 +90,7 @@
|
|
|
91
90
|
"prepack": "npm run build && oclif manifest && oclif readme",
|
|
92
91
|
"test": "vitest",
|
|
93
92
|
"coverage": "vitest run --coverage",
|
|
94
|
-
"version": "oclif readme && git add README.md",
|
|
93
|
+
"version": "oclif readme && git add README.md && biome check --write",
|
|
95
94
|
"posttest": "biome check",
|
|
96
95
|
"biome-ci": "biome ci --reporter=github",
|
|
97
96
|
"gql-codegen": "graphql-codegen",
|