opal-security 3.0.1-beta.4262451 → 3.0.1-beta.4f1a7ce
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 +58 -42
- package/bin/run +1 -1
- package/lib/commands/request/create.d.ts +6 -0
- package/lib/commands/request/create.js +37 -0
- package/lib/commands/request/get.d.ts +6 -0
- package/lib/commands/request/get.js +13 -0
- package/lib/commands/request/list.d.ts +7 -0
- package/lib/commands/request/list.js +14 -0
- package/lib/commands/resources/get.js +5 -0
- package/lib/commands/set-token.js +1 -1
- package/lib/graphql/gql.d.ts +10 -0
- package/lib/graphql/gql.js +2 -0
- package/lib/graphql/graphql.d.ts +63 -0
- package/lib/graphql/graphql.js +329 -1
- package/lib/lib/requests.d.ts +22 -0
- package/lib/lib/requests.js +274 -0
- package/lib/utils/displays.d.ts +5 -0
- package/lib/utils/displays.js +65 -0
- package/lib/utils/utils.d.ts +1 -0
- package/lib/utils/utils.js +18 -0
- package/oclif.manifest.json +69 -1
- package/package.json +4 -2
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.0.1-beta.
|
|
25
|
+
opal-security/3.0.1-beta.4f1a7ce linux-x64 node-v20.19.0
|
|
26
26
|
$ opal --help [COMMAND]
|
|
27
27
|
USAGE
|
|
28
28
|
$ opal COMMAND
|
|
@@ -34,23 +34,24 @@ USAGE
|
|
|
34
34
|
|
|
35
35
|
<!-- commands -->
|
|
36
36
|
* [`opal autocomplete [SHELL]`](#opal-autocomplete-shell)
|
|
37
|
-
* [`opal aws
|
|
37
|
+
* [`opal aws identity`](#opal-aws-identity)
|
|
38
38
|
* [`opal clear-auth-provider`](#opal-clear-auth-provider)
|
|
39
39
|
* [`opal curl-example`](#opal-curl-example)
|
|
40
40
|
* [`opal help [COMMANDS]`](#opal-help-commands)
|
|
41
|
-
* [`opal iam-roles
|
|
42
|
-
* [`opal kube-roles
|
|
41
|
+
* [`opal iam-roles start`](#opal-iam-roles-start)
|
|
42
|
+
* [`opal kube-roles start`](#opal-kube-roles-start)
|
|
43
43
|
* [`opal login`](#opal-login)
|
|
44
44
|
* [`opal logout`](#opal-logout)
|
|
45
|
-
* [`opal postgres-instances
|
|
46
|
-
* [`opal
|
|
45
|
+
* [`opal postgres-instances start`](#opal-postgres-instances-start)
|
|
46
|
+
* [`opal request ls`](#opal-request-ls)
|
|
47
|
+
* [`opal resources get`](#opal-resources-get)
|
|
47
48
|
* [`opal set-auth-provider`](#opal-set-auth-provider)
|
|
48
49
|
* [`opal set-custom-header`](#opal-set-custom-header)
|
|
49
50
|
* [`opal set-token`](#opal-set-token)
|
|
50
51
|
* [`opal set-url [URL]`](#opal-set-url-url)
|
|
51
|
-
* [`opal ssh
|
|
52
|
-
* [`opal ssh
|
|
53
|
-
* [`opal ssh
|
|
52
|
+
* [`opal ssh copyFrom`](#opal-ssh-copyfrom)
|
|
53
|
+
* [`opal ssh copyTo`](#opal-ssh-copyto)
|
|
54
|
+
* [`opal ssh start`](#opal-ssh-start)
|
|
54
55
|
* [`opal version`](#opal-version)
|
|
55
56
|
|
|
56
57
|
## `opal autocomplete [SHELL]`
|
|
@@ -82,13 +83,13 @@ EXAMPLES
|
|
|
82
83
|
|
|
83
84
|
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.4.6/src/commands/autocomplete/index.ts)_
|
|
84
85
|
|
|
85
|
-
## `opal aws
|
|
86
|
+
## `opal aws identity`
|
|
86
87
|
|
|
87
88
|
Gets the current caller identity for the "opal" AWS profile.
|
|
88
89
|
|
|
89
90
|
```
|
|
90
91
|
USAGE
|
|
91
|
-
$ opal aws
|
|
92
|
+
$ opal aws identity [-h]
|
|
92
93
|
|
|
93
94
|
FLAGS
|
|
94
95
|
-h, --help Show CLI help.
|
|
@@ -100,7 +101,7 @@ EXAMPLES
|
|
|
100
101
|
$ opal aws:identity
|
|
101
102
|
```
|
|
102
103
|
|
|
103
|
-
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
104
|
+
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/aws/identity.ts)_
|
|
104
105
|
|
|
105
106
|
## `opal clear-auth-provider`
|
|
106
107
|
|
|
@@ -120,7 +121,7 @@ EXAMPLES
|
|
|
120
121
|
$ opal clear-auth-provider
|
|
121
122
|
```
|
|
122
123
|
|
|
123
|
-
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
124
|
+
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/clear-auth-provider.ts)_
|
|
124
125
|
|
|
125
126
|
## `opal curl-example`
|
|
126
127
|
|
|
@@ -137,7 +138,7 @@ DESCRIPTION
|
|
|
137
138
|
Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.
|
|
138
139
|
```
|
|
139
140
|
|
|
140
|
-
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
141
|
+
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/curl-example.ts)_
|
|
141
142
|
|
|
142
143
|
## `opal help [COMMANDS]`
|
|
143
144
|
|
|
@@ -159,13 +160,13 @@ DESCRIPTION
|
|
|
159
160
|
|
|
160
161
|
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
|
|
161
162
|
|
|
162
|
-
## `opal iam-roles
|
|
163
|
+
## `opal iam-roles start`
|
|
163
164
|
|
|
164
165
|
Starts a session to assume an IAM role.
|
|
165
166
|
|
|
166
167
|
```
|
|
167
168
|
USAGE
|
|
168
|
-
$ opal iam-roles
|
|
169
|
+
$ opal iam-roles start [-h] [-i <value>] [-s <value>] [-r] [--profileName <value>]
|
|
169
170
|
|
|
170
171
|
FLAGS
|
|
171
172
|
-h, --help Show CLI help.
|
|
@@ -187,15 +188,15 @@ EXAMPLES
|
|
|
187
188
|
$ opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName "custom-profile"
|
|
188
189
|
```
|
|
189
190
|
|
|
190
|
-
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
191
|
+
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/iam-roles/start.ts)_
|
|
191
192
|
|
|
192
|
-
## `opal kube-roles
|
|
193
|
+
## `opal kube-roles start`
|
|
193
194
|
|
|
194
195
|
Starts a session to assume a Kubernetes cluster IAM role.
|
|
195
196
|
|
|
196
197
|
```
|
|
197
198
|
USAGE
|
|
198
|
-
$ opal kube-roles
|
|
199
|
+
$ opal kube-roles start [-h] [-i <value>] [-a <value>] [-s <value>] [-r]
|
|
199
200
|
|
|
200
201
|
FLAGS
|
|
201
202
|
-a, --accessLevelRemoteId=<value> The remote ID of the access level with which to access the resource.
|
|
@@ -218,7 +219,7 @@ EXAMPLES
|
|
|
218
219
|
$ opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId "arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role"
|
|
219
220
|
```
|
|
220
221
|
|
|
221
|
-
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
222
|
+
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/kube-roles/start.ts)_
|
|
222
223
|
|
|
223
224
|
## `opal login`
|
|
224
225
|
|
|
@@ -239,7 +240,7 @@ EXAMPLES
|
|
|
239
240
|
$ opal login
|
|
240
241
|
```
|
|
241
242
|
|
|
242
|
-
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
243
|
+
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/login.ts)_
|
|
243
244
|
|
|
244
245
|
## `opal logout`
|
|
245
246
|
|
|
@@ -259,15 +260,15 @@ EXAMPLES
|
|
|
259
260
|
$ opal logout
|
|
260
261
|
```
|
|
261
262
|
|
|
262
|
-
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
263
|
+
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/logout.ts)_
|
|
263
264
|
|
|
264
|
-
## `opal postgres-instances
|
|
265
|
+
## `opal postgres-instances start`
|
|
265
266
|
|
|
266
267
|
Starts a session to connect to a Postgres database.
|
|
267
268
|
|
|
268
269
|
```
|
|
269
270
|
USAGE
|
|
270
|
-
$ opal postgres-instances
|
|
271
|
+
$ opal postgres-instances start [-h] [-i <value>] [-a <value>] [-s <value>] [-r] [--action psql|view]
|
|
271
272
|
|
|
272
273
|
FLAGS
|
|
273
274
|
-a, --accessLevelRemoteId=<value> The remote ID of the access level with which to access the resource.
|
|
@@ -296,15 +297,30 @@ EXAMPLES
|
|
|
296
297
|
$ opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId fullaccess --action view
|
|
297
298
|
```
|
|
298
299
|
|
|
299
|
-
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
300
|
+
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/postgres-instances/start.ts)_
|
|
300
301
|
|
|
301
|
-
## `opal
|
|
302
|
+
## `opal request ls`
|
|
303
|
+
|
|
304
|
+
Lists access requests
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
USAGE
|
|
308
|
+
$ opal request ls
|
|
309
|
+
|
|
310
|
+
DESCRIPTION
|
|
311
|
+
Lists access requests
|
|
312
|
+
|
|
313
|
+
ALIASES
|
|
314
|
+
$ opal request ls
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## `opal resources get`
|
|
302
318
|
|
|
303
319
|
Get resource info for a particular resource.
|
|
304
320
|
|
|
305
321
|
```
|
|
306
322
|
USAGE
|
|
307
|
-
$ opal resources
|
|
323
|
+
$ opal resources get [-h] [-i <value>]
|
|
308
324
|
|
|
309
325
|
FLAGS
|
|
310
326
|
-h, --help Show CLI help.
|
|
@@ -317,7 +333,7 @@ EXAMPLES
|
|
|
317
333
|
$ opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
318
334
|
```
|
|
319
335
|
|
|
320
|
-
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
336
|
+
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/resources/get.ts)_
|
|
321
337
|
|
|
322
338
|
## `opal set-auth-provider`
|
|
323
339
|
|
|
@@ -343,7 +359,7 @@ EXAMPLES
|
|
|
343
359
|
$ opal set-auth-provider --clientID 1234asdf --issuerUrl https://auth.example.com
|
|
344
360
|
```
|
|
345
361
|
|
|
346
|
-
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
362
|
+
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/set-auth-provider.ts)_
|
|
347
363
|
|
|
348
364
|
## `opal set-custom-header`
|
|
349
365
|
|
|
@@ -364,7 +380,7 @@ EXAMPLES
|
|
|
364
380
|
$ opal set-custom-header --header 'cf-access-token: $TOKEN'
|
|
365
381
|
```
|
|
366
382
|
|
|
367
|
-
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
383
|
+
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/set-custom-header.ts)_
|
|
368
384
|
|
|
369
385
|
## `opal set-token`
|
|
370
386
|
|
|
@@ -384,7 +400,7 @@ EXAMPLES
|
|
|
384
400
|
$ opal set-token
|
|
385
401
|
```
|
|
386
402
|
|
|
387
|
-
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
403
|
+
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/set-token.ts)_
|
|
388
404
|
|
|
389
405
|
## `opal set-url [URL]`
|
|
390
406
|
|
|
@@ -408,15 +424,15 @@ EXAMPLES
|
|
|
408
424
|
$ opal set-url
|
|
409
425
|
```
|
|
410
426
|
|
|
411
|
-
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
427
|
+
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/set-url.ts)_
|
|
412
428
|
|
|
413
|
-
## `opal ssh
|
|
429
|
+
## `opal ssh copyFrom`
|
|
414
430
|
|
|
415
431
|
Use SCP to copy files from a compute instance.
|
|
416
432
|
|
|
417
433
|
```
|
|
418
434
|
USAGE
|
|
419
|
-
$ opal ssh
|
|
435
|
+
$ opal ssh copyFrom --src <value> [-h] [--dest <value>] [--user <value>] [-i <value>] [-s <value>]
|
|
420
436
|
|
|
421
437
|
FLAGS
|
|
422
438
|
-h, --help Show CLI help.
|
|
@@ -439,15 +455,15 @@ EXAMPLES
|
|
|
439
455
|
$ opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
440
456
|
```
|
|
441
457
|
|
|
442
|
-
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
458
|
+
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/ssh/copyFrom.ts)_
|
|
443
459
|
|
|
444
|
-
## `opal ssh
|
|
460
|
+
## `opal ssh copyTo`
|
|
445
461
|
|
|
446
462
|
Use SCP to copy files to a compute instance.
|
|
447
463
|
|
|
448
464
|
```
|
|
449
465
|
USAGE
|
|
450
|
-
$ opal ssh
|
|
466
|
+
$ opal ssh copyTo --src <value> [-h] [--dest <value>] [--user <value>] [-i <value>] [-s <value>]
|
|
451
467
|
|
|
452
468
|
FLAGS
|
|
453
469
|
-h, --help Show CLI help.
|
|
@@ -470,15 +486,15 @@ EXAMPLES
|
|
|
470
486
|
$ opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
471
487
|
```
|
|
472
488
|
|
|
473
|
-
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
489
|
+
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/ssh/copyTo.ts)_
|
|
474
490
|
|
|
475
|
-
## `opal ssh
|
|
491
|
+
## `opal ssh start`
|
|
476
492
|
|
|
477
493
|
Starts an SSH session to access a compute instance.
|
|
478
494
|
|
|
479
495
|
```
|
|
480
496
|
USAGE
|
|
481
|
-
$ opal ssh
|
|
497
|
+
$ opal ssh start [-h] [-i <value>] [-s <value>] [-r]
|
|
482
498
|
|
|
483
499
|
FLAGS
|
|
484
500
|
-h, --help Show CLI help.
|
|
@@ -497,7 +513,7 @@ EXAMPLES
|
|
|
497
513
|
$ opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
498
514
|
```
|
|
499
515
|
|
|
500
|
-
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
516
|
+
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.4f1a7ce/src/commands/ssh/start.ts)_
|
|
501
517
|
|
|
502
518
|
## `opal version`
|
|
503
519
|
|
|
@@ -517,5 +533,5 @@ FLAG DESCRIPTIONS
|
|
|
517
533
|
Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.
|
|
518
534
|
```
|
|
519
535
|
|
|
520
|
-
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v2.
|
|
536
|
+
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v2.2.27/src/commands/version.ts)_
|
|
521
537
|
<!-- commandsstop -->
|
package/bin/run
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const engineMajorVersion = parseInt(process.version.slice(1).split('.'));
|
|
3
|
+
const engineMajorVersion = Number.parseInt(process.version.slice(1).split('.'));
|
|
4
4
|
if (engineMajorVersion < 18) {
|
|
5
5
|
console.log("Opal CLI requires Node v18.0.0 or later to run.")
|
|
6
6
|
process.exit(1)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const apollo_1 = require("../../lib/apollo");
|
|
5
|
+
const requests_1 = require("../../lib/requests");
|
|
6
|
+
const displays_1 = require("../../utils/displays");
|
|
7
|
+
const utils_1 = require("../../utils/utils");
|
|
8
|
+
class RequestCreate extends core_1.Command {
|
|
9
|
+
async run() {
|
|
10
|
+
await (0, apollo_1.initClient)(this, true);
|
|
11
|
+
const client = await (0, apollo_1.getClient)(this, true);
|
|
12
|
+
(0, utils_1.restrictToDev)(); //TODO: Remove after development is complete
|
|
13
|
+
const requestMap = new Map();
|
|
14
|
+
(0, displays_1.headerMessage)(this);
|
|
15
|
+
let shouldProceed = false;
|
|
16
|
+
while (!shouldProceed) {
|
|
17
|
+
// Step 1: Select first round of assets from an app
|
|
18
|
+
await (0, requests_1.selectRequestableItems)(this, client, requestMap);
|
|
19
|
+
// Step 2: Display the selected items in a tree format
|
|
20
|
+
(0, displays_1.headerMessage)(this);
|
|
21
|
+
this.log((0, displays_1.treeifyRequestMap)(requestMap), "\n");
|
|
22
|
+
// Step 3: Prompt to add more items, repeat 1-3 if needed
|
|
23
|
+
shouldProceed = await (0, requests_1.doneSelectingAssets)();
|
|
24
|
+
}
|
|
25
|
+
// Step 4: Prompt for request reason
|
|
26
|
+
const { reason } = await (0, requests_1.promptForReason)();
|
|
27
|
+
// Step 5: Prompt for expiration
|
|
28
|
+
const { expiration } = await (0, requests_1.promptForExpiration)();
|
|
29
|
+
// Step 6: Display final summary of request
|
|
30
|
+
(0, displays_1.displayFinalRequestSummary)(this, requestMap, reason, expiration);
|
|
31
|
+
// Step 7: Prompt for final submition
|
|
32
|
+
await (0, requests_1.submitFinalRequest)(this);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
RequestCreate.hidden = true;
|
|
36
|
+
RequestCreate.description = "Opens an Opal access request";
|
|
37
|
+
exports.default = RequestCreate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const utils_1 = require("../../utils/utils");
|
|
5
|
+
class RequestGet extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
(0, utils_1.restrictToDev)(); //TODO: Remove after development is complete
|
|
8
|
+
this.log("Running the get command");
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
RequestGet.hidden = true;
|
|
12
|
+
RequestGet.description = "Lists access requests";
|
|
13
|
+
exports.default = RequestGet;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const utils_1 = require("../../utils/utils");
|
|
5
|
+
class RequestList extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
(0, utils_1.restrictToDev)(); //TODO: Remove after development is complete
|
|
8
|
+
this.log("Running the list command");
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
RequestList.hidden = true;
|
|
12
|
+
RequestList.description = "Lists access requests";
|
|
13
|
+
RequestList.aliases = ["request:ls"];
|
|
14
|
+
exports.default = RequestList;
|
|
@@ -44,6 +44,11 @@ class GetResource extends core_1.Command {
|
|
|
44
44
|
async run() {
|
|
45
45
|
(0, cmd_1.setMostRecentCommand)(this);
|
|
46
46
|
const { flags } = await this.parse(GetResource);
|
|
47
|
+
if (!flags.id) {
|
|
48
|
+
this.log("Error: Please provide a resource ID using the --id flag.");
|
|
49
|
+
this.log("ex. opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
47
52
|
const { resp, error } = await (0, handler_1.runQueryDeprecated)({
|
|
48
53
|
command: this,
|
|
49
54
|
query: exports.GetResourceDocument,
|
|
@@ -34,7 +34,7 @@ class SetToken extends core_1.Command {
|
|
|
34
34
|
const existingCreds = await (0, credentials_1.getOpalCredentials)(this, false);
|
|
35
35
|
await (0, credentials_1.setOpalCredentials)(this, existingCreds === null || existingCreds === void 0 ? void 0 : existingCreds.email, (existingCreds === null || existingCreds === void 0 ? void 0 : existingCreds.organizationID) || "unset-org-id", existingCreds === null || existingCreds === void 0 ? void 0 : existingCreds.clientIDCandidate, apiToken || "", credentials_1.SecretType.ApiToken);
|
|
36
36
|
// "Representative" authenticated call to check the log-in worked as expected.
|
|
37
|
-
const client = await (0, apollo_1.getClient)(this,
|
|
37
|
+
const client = await (0, apollo_1.getClient)(this, true);
|
|
38
38
|
const resp = await client.query({
|
|
39
39
|
query: CHECK_AUTH_SESSION_QUERY,
|
|
40
40
|
});
|
package/lib/graphql/gql.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ import * as types from "./graphql";
|
|
|
13
13
|
*/
|
|
14
14
|
type Documents = {
|
|
15
15
|
"\nquery CheckAuthSessionQuery {\n organizationSettings {\n ... on OrganizationSettingsResult {\n settings {\n id\n }\n }\n }\n}\n": typeof types.CheckAuthSessionQueryDocument;
|
|
16
|
+
'\n query GetRequestableAppsQuery($searchQuery: String) {\n appsV2(\n filters: {\n access: REQUESTABLE\n searchQuery: $searchQuery\n }\n ) @connection(key: "paginated-app-dropdown") {\n edges {\n node {\n id\n displayName\n ... on Connection {\n connectionType\n }\n ... on Resource {\n resourceType\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n ': typeof types.GetRequestableAppsQueryDocument;
|
|
17
|
+
"\n query PaginatedEntityDropdown(\n $id: UUID!\n $searchQuery: String\n) {\n app(id: $id) {\n __typename\n ... on App {\n id\n items(\n input: {\n access: REQUESTABLE\n searchQuery: $searchQuery\n includeOnlyRequestable: true\n }\n ) {\n items {\n key\n resource {\n id\n name\n }\n group {\n id\n name\n }\n }\n cursor\n }\n }\n }\n}\n": typeof types.PaginatedEntityDropdownDocument;
|
|
16
18
|
};
|
|
17
19
|
declare const documents: Documents;
|
|
18
20
|
/**
|
|
@@ -32,5 +34,13 @@ export declare function graphql(source: string): unknown;
|
|
|
32
34
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
33
35
|
*/
|
|
34
36
|
export declare function graphql(source: "\nquery CheckAuthSessionQuery {\n organizationSettings {\n ... on OrganizationSettingsResult {\n settings {\n id\n }\n }\n }\n}\n"): (typeof documents)["\nquery CheckAuthSessionQuery {\n organizationSettings {\n ... on OrganizationSettingsResult {\n settings {\n id\n }\n }\n }\n}\n"];
|
|
37
|
+
/**
|
|
38
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
39
|
+
*/
|
|
40
|
+
export declare function graphql(source: '\n query GetRequestableAppsQuery($searchQuery: String) {\n appsV2(\n filters: {\n access: REQUESTABLE\n searchQuery: $searchQuery\n }\n ) @connection(key: "paginated-app-dropdown") {\n edges {\n node {\n id\n displayName\n ... on Connection {\n connectionType\n }\n ... on Resource {\n resourceType\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n '): (typeof documents)['\n query GetRequestableAppsQuery($searchQuery: String) {\n appsV2(\n filters: {\n access: REQUESTABLE\n searchQuery: $searchQuery\n }\n ) @connection(key: "paginated-app-dropdown") {\n edges {\n node {\n id\n displayName\n ... on Connection {\n connectionType\n }\n ... on Resource {\n resourceType\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n '];
|
|
41
|
+
/**
|
|
42
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
43
|
+
*/
|
|
44
|
+
export declare function graphql(source: "\n query PaginatedEntityDropdown(\n $id: UUID!\n $searchQuery: String\n) {\n app(id: $id) {\n __typename\n ... on App {\n id\n items(\n input: {\n access: REQUESTABLE\n searchQuery: $searchQuery\n includeOnlyRequestable: true\n }\n ) {\n items {\n key\n resource {\n id\n name\n }\n group {\n id\n name\n }\n }\n cursor\n }\n }\n }\n}\n"): (typeof documents)["\n query PaginatedEntityDropdown(\n $id: UUID!\n $searchQuery: String\n) {\n app(id: $id) {\n __typename\n ... on App {\n id\n items(\n input: {\n access: REQUESTABLE\n searchQuery: $searchQuery\n includeOnlyRequestable: true\n }\n ) {\n items {\n key\n resource {\n id\n name\n }\n group {\n id\n name\n }\n }\n cursor\n }\n }\n }\n}\n"];
|
|
35
45
|
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|
|
36
46
|
export {};
|
package/lib/graphql/gql.js
CHANGED
|
@@ -5,6 +5,8 @@ exports.graphql = graphql;
|
|
|
5
5
|
const types = require("./graphql");
|
|
6
6
|
const documents = {
|
|
7
7
|
"\nquery CheckAuthSessionQuery {\n organizationSettings {\n ... on OrganizationSettingsResult {\n settings {\n id\n }\n }\n }\n}\n": types.CheckAuthSessionQueryDocument,
|
|
8
|
+
'\n query GetRequestableAppsQuery($searchQuery: String) {\n appsV2(\n filters: {\n access: REQUESTABLE\n searchQuery: $searchQuery\n }\n ) @connection(key: "paginated-app-dropdown") {\n edges {\n node {\n id\n displayName\n ... on Connection {\n connectionType\n }\n ... on Resource {\n resourceType\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n ': types.GetRequestableAppsQueryDocument,
|
|
9
|
+
"\n query PaginatedEntityDropdown(\n $id: UUID!\n $searchQuery: String\n) {\n app(id: $id) {\n __typename\n ... on App {\n id\n items(\n input: {\n access: REQUESTABLE\n searchQuery: $searchQuery\n includeOnlyRequestable: true\n }\n ) {\n items {\n key\n resource {\n id\n name\n }\n group {\n id\n name\n }\n }\n cursor\n }\n }\n }\n}\n": types.PaginatedEntityDropdownDocument,
|
|
8
10
|
};
|
|
9
11
|
function graphql(source) {
|
|
10
12
|
var _a;
|
package/lib/graphql/graphql.d.ts
CHANGED
|
@@ -11410,4 +11410,67 @@ export type CheckAuthSessionQueryQuery = {
|
|
|
11410
11410
|
};
|
|
11411
11411
|
};
|
|
11412
11412
|
};
|
|
11413
|
+
export type GetRequestableAppsQueryQueryVariables = Exact<{
|
|
11414
|
+
searchQuery?: InputMaybe<Scalars["String"]["input"]>;
|
|
11415
|
+
}>;
|
|
11416
|
+
export type GetRequestableAppsQueryQuery = {
|
|
11417
|
+
__typename?: "Query";
|
|
11418
|
+
appsV2: {
|
|
11419
|
+
__typename?: "AppConnection";
|
|
11420
|
+
edges: Array<{
|
|
11421
|
+
__typename?: "AppEdge";
|
|
11422
|
+
node: {
|
|
11423
|
+
__typename?: "Connection";
|
|
11424
|
+
connectionType: ConnectionType;
|
|
11425
|
+
id: string;
|
|
11426
|
+
displayName: string;
|
|
11427
|
+
} | {
|
|
11428
|
+
__typename?: "Resource";
|
|
11429
|
+
resourceType: ResourceType;
|
|
11430
|
+
id: string;
|
|
11431
|
+
displayName: string;
|
|
11432
|
+
};
|
|
11433
|
+
}>;
|
|
11434
|
+
pageInfo: {
|
|
11435
|
+
__typename?: "PageInfo";
|
|
11436
|
+
hasNextPage: boolean;
|
|
11437
|
+
hasPreviousPage: boolean;
|
|
11438
|
+
startCursor?: string | null;
|
|
11439
|
+
endCursor?: string | null;
|
|
11440
|
+
};
|
|
11441
|
+
};
|
|
11442
|
+
};
|
|
11443
|
+
export type PaginatedEntityDropdownQueryVariables = Exact<{
|
|
11444
|
+
id: Scalars["UUID"]["input"];
|
|
11445
|
+
searchQuery?: InputMaybe<Scalars["String"]["input"]>;
|
|
11446
|
+
}>;
|
|
11447
|
+
export type PaginatedEntityDropdownQuery = {
|
|
11448
|
+
__typename?: "Query";
|
|
11449
|
+
app: {
|
|
11450
|
+
__typename: "App";
|
|
11451
|
+
id: string;
|
|
11452
|
+
items: {
|
|
11453
|
+
__typename?: "AppItemsOutput";
|
|
11454
|
+
cursor?: string | null;
|
|
11455
|
+
items?: Array<{
|
|
11456
|
+
__typename?: "AppItem";
|
|
11457
|
+
key: string;
|
|
11458
|
+
resource?: {
|
|
11459
|
+
__typename?: "Resource";
|
|
11460
|
+
id: string;
|
|
11461
|
+
name: string;
|
|
11462
|
+
} | null;
|
|
11463
|
+
group?: {
|
|
11464
|
+
__typename?: "Group";
|
|
11465
|
+
id: string;
|
|
11466
|
+
name: string;
|
|
11467
|
+
} | null;
|
|
11468
|
+
}> | null;
|
|
11469
|
+
};
|
|
11470
|
+
} | {
|
|
11471
|
+
__typename: "AppNotFoundError";
|
|
11472
|
+
};
|
|
11473
|
+
};
|
|
11413
11474
|
export declare const CheckAuthSessionQueryDocument: DocumentNode<CheckAuthSessionQueryQuery, CheckAuthSessionQueryQueryVariables>;
|
|
11475
|
+
export declare const GetRequestableAppsQueryDocument: DocumentNode<GetRequestableAppsQueryQuery, GetRequestableAppsQueryQueryVariables>;
|
|
11476
|
+
export declare const PaginatedEntityDropdownDocument: DocumentNode<PaginatedEntityDropdownQuery, PaginatedEntityDropdownQueryVariables>;
|