opal-security 3.0.1-beta.4262451 → 3.0.1-beta.9068705
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 +80 -42
- package/bin/run +1 -1
- package/lib/commands/groups/get.d.ts +10 -0
- package/lib/commands/groups/get.js +79 -0
- 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 +15 -0
- package/lib/graphql/gql.js +3 -0
- package/lib/graphql/graphql.d.ts +109 -0
- package/lib/graphql/graphql.js +546 -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 +109 -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.9068705 linux-x64 node-v20.19.0
|
|
26
26
|
$ opal --help [COMMAND]
|
|
27
27
|
USAGE
|
|
28
28
|
$ opal COMMAND
|
|
@@ -34,23 +34,25 @@ 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
|
+
* [`opal groups get`](#opal-groups-get)
|
|
40
41
|
* [`opal help [COMMANDS]`](#opal-help-commands)
|
|
41
|
-
* [`opal iam-roles
|
|
42
|
-
* [`opal kube-roles
|
|
42
|
+
* [`opal iam-roles start`](#opal-iam-roles-start)
|
|
43
|
+
* [`opal kube-roles start`](#opal-kube-roles-start)
|
|
43
44
|
* [`opal login`](#opal-login)
|
|
44
45
|
* [`opal logout`](#opal-logout)
|
|
45
|
-
* [`opal postgres-instances
|
|
46
|
-
* [`opal
|
|
46
|
+
* [`opal postgres-instances start`](#opal-postgres-instances-start)
|
|
47
|
+
* [`opal request ls`](#opal-request-ls)
|
|
48
|
+
* [`opal resources get`](#opal-resources-get)
|
|
47
49
|
* [`opal set-auth-provider`](#opal-set-auth-provider)
|
|
48
50
|
* [`opal set-custom-header`](#opal-set-custom-header)
|
|
49
51
|
* [`opal set-token`](#opal-set-token)
|
|
50
52
|
* [`opal set-url [URL]`](#opal-set-url-url)
|
|
51
|
-
* [`opal ssh
|
|
52
|
-
* [`opal ssh
|
|
53
|
-
* [`opal ssh
|
|
53
|
+
* [`opal ssh copyFrom`](#opal-ssh-copyfrom)
|
|
54
|
+
* [`opal ssh copyTo`](#opal-ssh-copyto)
|
|
55
|
+
* [`opal ssh start`](#opal-ssh-start)
|
|
54
56
|
* [`opal version`](#opal-version)
|
|
55
57
|
|
|
56
58
|
## `opal autocomplete [SHELL]`
|
|
@@ -82,13 +84,13 @@ EXAMPLES
|
|
|
82
84
|
|
|
83
85
|
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.4.6/src/commands/autocomplete/index.ts)_
|
|
84
86
|
|
|
85
|
-
## `opal aws
|
|
87
|
+
## `opal aws identity`
|
|
86
88
|
|
|
87
89
|
Gets the current caller identity for the "opal" AWS profile.
|
|
88
90
|
|
|
89
91
|
```
|
|
90
92
|
USAGE
|
|
91
|
-
$ opal aws
|
|
93
|
+
$ opal aws identity [-h]
|
|
92
94
|
|
|
93
95
|
FLAGS
|
|
94
96
|
-h, --help Show CLI help.
|
|
@@ -100,7 +102,7 @@ EXAMPLES
|
|
|
100
102
|
$ opal aws:identity
|
|
101
103
|
```
|
|
102
104
|
|
|
103
|
-
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
105
|
+
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/aws/identity.ts)_
|
|
104
106
|
|
|
105
107
|
## `opal clear-auth-provider`
|
|
106
108
|
|
|
@@ -120,7 +122,7 @@ EXAMPLES
|
|
|
120
122
|
$ opal clear-auth-provider
|
|
121
123
|
```
|
|
122
124
|
|
|
123
|
-
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
125
|
+
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/clear-auth-provider.ts)_
|
|
124
126
|
|
|
125
127
|
## `opal curl-example`
|
|
126
128
|
|
|
@@ -137,7 +139,28 @@ DESCRIPTION
|
|
|
137
139
|
Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.
|
|
138
140
|
```
|
|
139
141
|
|
|
140
|
-
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
142
|
+
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/curl-example.ts)_
|
|
143
|
+
|
|
144
|
+
## `opal groups get`
|
|
145
|
+
|
|
146
|
+
Get group info for a particular group.
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
USAGE
|
|
150
|
+
$ opal groups get [-h] [-i <value>]
|
|
151
|
+
|
|
152
|
+
FLAGS
|
|
153
|
+
-h, --help Show CLI help.
|
|
154
|
+
-i, --id=<value> The Opal ID of the resource. You can find this from the URL, e.g. https://opal.dev/resources/[ID]
|
|
155
|
+
|
|
156
|
+
DESCRIPTION
|
|
157
|
+
Get group info for a particular group.
|
|
158
|
+
|
|
159
|
+
EXAMPLES
|
|
160
|
+
$ opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
_See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/groups/get.ts)_
|
|
141
164
|
|
|
142
165
|
## `opal help [COMMANDS]`
|
|
143
166
|
|
|
@@ -159,13 +182,13 @@ DESCRIPTION
|
|
|
159
182
|
|
|
160
183
|
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
|
|
161
184
|
|
|
162
|
-
## `opal iam-roles
|
|
185
|
+
## `opal iam-roles start`
|
|
163
186
|
|
|
164
187
|
Starts a session to assume an IAM role.
|
|
165
188
|
|
|
166
189
|
```
|
|
167
190
|
USAGE
|
|
168
|
-
$ opal iam-roles
|
|
191
|
+
$ opal iam-roles start [-h] [-i <value>] [-s <value>] [-r] [--profileName <value>]
|
|
169
192
|
|
|
170
193
|
FLAGS
|
|
171
194
|
-h, --help Show CLI help.
|
|
@@ -187,15 +210,15 @@ EXAMPLES
|
|
|
187
210
|
$ opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName "custom-profile"
|
|
188
211
|
```
|
|
189
212
|
|
|
190
|
-
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
213
|
+
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/iam-roles/start.ts)_
|
|
191
214
|
|
|
192
|
-
## `opal kube-roles
|
|
215
|
+
## `opal kube-roles start`
|
|
193
216
|
|
|
194
217
|
Starts a session to assume a Kubernetes cluster IAM role.
|
|
195
218
|
|
|
196
219
|
```
|
|
197
220
|
USAGE
|
|
198
|
-
$ opal kube-roles
|
|
221
|
+
$ opal kube-roles start [-h] [-i <value>] [-a <value>] [-s <value>] [-r]
|
|
199
222
|
|
|
200
223
|
FLAGS
|
|
201
224
|
-a, --accessLevelRemoteId=<value> The remote ID of the access level with which to access the resource.
|
|
@@ -218,7 +241,7 @@ EXAMPLES
|
|
|
218
241
|
$ opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId "arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role"
|
|
219
242
|
```
|
|
220
243
|
|
|
221
|
-
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
244
|
+
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/kube-roles/start.ts)_
|
|
222
245
|
|
|
223
246
|
## `opal login`
|
|
224
247
|
|
|
@@ -239,7 +262,7 @@ EXAMPLES
|
|
|
239
262
|
$ opal login
|
|
240
263
|
```
|
|
241
264
|
|
|
242
|
-
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
265
|
+
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/login.ts)_
|
|
243
266
|
|
|
244
267
|
## `opal logout`
|
|
245
268
|
|
|
@@ -259,15 +282,15 @@ EXAMPLES
|
|
|
259
282
|
$ opal logout
|
|
260
283
|
```
|
|
261
284
|
|
|
262
|
-
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
285
|
+
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/logout.ts)_
|
|
263
286
|
|
|
264
|
-
## `opal postgres-instances
|
|
287
|
+
## `opal postgres-instances start`
|
|
265
288
|
|
|
266
289
|
Starts a session to connect to a Postgres database.
|
|
267
290
|
|
|
268
291
|
```
|
|
269
292
|
USAGE
|
|
270
|
-
$ opal postgres-instances
|
|
293
|
+
$ opal postgres-instances start [-h] [-i <value>] [-a <value>] [-s <value>] [-r] [--action psql|view]
|
|
271
294
|
|
|
272
295
|
FLAGS
|
|
273
296
|
-a, --accessLevelRemoteId=<value> The remote ID of the access level with which to access the resource.
|
|
@@ -296,15 +319,30 @@ EXAMPLES
|
|
|
296
319
|
$ opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId fullaccess --action view
|
|
297
320
|
```
|
|
298
321
|
|
|
299
|
-
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
322
|
+
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/postgres-instances/start.ts)_
|
|
323
|
+
|
|
324
|
+
## `opal request ls`
|
|
325
|
+
|
|
326
|
+
Lists access requests
|
|
327
|
+
|
|
328
|
+
```
|
|
329
|
+
USAGE
|
|
330
|
+
$ opal request ls
|
|
331
|
+
|
|
332
|
+
DESCRIPTION
|
|
333
|
+
Lists access requests
|
|
334
|
+
|
|
335
|
+
ALIASES
|
|
336
|
+
$ opal request ls
|
|
337
|
+
```
|
|
300
338
|
|
|
301
|
-
## `opal resources
|
|
339
|
+
## `opal resources get`
|
|
302
340
|
|
|
303
341
|
Get resource info for a particular resource.
|
|
304
342
|
|
|
305
343
|
```
|
|
306
344
|
USAGE
|
|
307
|
-
$ opal resources
|
|
345
|
+
$ opal resources get [-h] [-i <value>]
|
|
308
346
|
|
|
309
347
|
FLAGS
|
|
310
348
|
-h, --help Show CLI help.
|
|
@@ -317,7 +355,7 @@ EXAMPLES
|
|
|
317
355
|
$ opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
318
356
|
```
|
|
319
357
|
|
|
320
|
-
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
358
|
+
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/resources/get.ts)_
|
|
321
359
|
|
|
322
360
|
## `opal set-auth-provider`
|
|
323
361
|
|
|
@@ -343,7 +381,7 @@ EXAMPLES
|
|
|
343
381
|
$ opal set-auth-provider --clientID 1234asdf --issuerUrl https://auth.example.com
|
|
344
382
|
```
|
|
345
383
|
|
|
346
|
-
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
384
|
+
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/set-auth-provider.ts)_
|
|
347
385
|
|
|
348
386
|
## `opal set-custom-header`
|
|
349
387
|
|
|
@@ -364,7 +402,7 @@ EXAMPLES
|
|
|
364
402
|
$ opal set-custom-header --header 'cf-access-token: $TOKEN'
|
|
365
403
|
```
|
|
366
404
|
|
|
367
|
-
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
405
|
+
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/set-custom-header.ts)_
|
|
368
406
|
|
|
369
407
|
## `opal set-token`
|
|
370
408
|
|
|
@@ -384,7 +422,7 @@ EXAMPLES
|
|
|
384
422
|
$ opal set-token
|
|
385
423
|
```
|
|
386
424
|
|
|
387
|
-
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
425
|
+
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/set-token.ts)_
|
|
388
426
|
|
|
389
427
|
## `opal set-url [URL]`
|
|
390
428
|
|
|
@@ -408,15 +446,15 @@ EXAMPLES
|
|
|
408
446
|
$ opal set-url
|
|
409
447
|
```
|
|
410
448
|
|
|
411
|
-
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
449
|
+
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/set-url.ts)_
|
|
412
450
|
|
|
413
|
-
## `opal ssh
|
|
451
|
+
## `opal ssh copyFrom`
|
|
414
452
|
|
|
415
453
|
Use SCP to copy files from a compute instance.
|
|
416
454
|
|
|
417
455
|
```
|
|
418
456
|
USAGE
|
|
419
|
-
$ opal ssh
|
|
457
|
+
$ opal ssh copyFrom --src <value> [-h] [--dest <value>] [--user <value>] [-i <value>] [-s <value>]
|
|
420
458
|
|
|
421
459
|
FLAGS
|
|
422
460
|
-h, --help Show CLI help.
|
|
@@ -439,15 +477,15 @@ EXAMPLES
|
|
|
439
477
|
$ opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
440
478
|
```
|
|
441
479
|
|
|
442
|
-
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
480
|
+
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/ssh/copyFrom.ts)_
|
|
443
481
|
|
|
444
|
-
## `opal ssh
|
|
482
|
+
## `opal ssh copyTo`
|
|
445
483
|
|
|
446
484
|
Use SCP to copy files to a compute instance.
|
|
447
485
|
|
|
448
486
|
```
|
|
449
487
|
USAGE
|
|
450
|
-
$ opal ssh
|
|
488
|
+
$ opal ssh copyTo --src <value> [-h] [--dest <value>] [--user <value>] [-i <value>] [-s <value>]
|
|
451
489
|
|
|
452
490
|
FLAGS
|
|
453
491
|
-h, --help Show CLI help.
|
|
@@ -470,15 +508,15 @@ EXAMPLES
|
|
|
470
508
|
$ opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
471
509
|
```
|
|
472
510
|
|
|
473
|
-
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
511
|
+
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/ssh/copyTo.ts)_
|
|
474
512
|
|
|
475
|
-
## `opal ssh
|
|
513
|
+
## `opal ssh start`
|
|
476
514
|
|
|
477
515
|
Starts an SSH session to access a compute instance.
|
|
478
516
|
|
|
479
517
|
```
|
|
480
518
|
USAGE
|
|
481
|
-
$ opal ssh
|
|
519
|
+
$ opal ssh start [-h] [-i <value>] [-s <value>] [-r]
|
|
482
520
|
|
|
483
521
|
FLAGS
|
|
484
522
|
-h, --help Show CLI help.
|
|
@@ -497,7 +535,7 @@ EXAMPLES
|
|
|
497
535
|
$ opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
498
536
|
```
|
|
499
537
|
|
|
500
|
-
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.
|
|
538
|
+
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.0.1-beta.9068705/src/commands/ssh/start.ts)_
|
|
501
539
|
|
|
502
540
|
## `opal version`
|
|
503
541
|
|
|
@@ -517,5 +555,5 @@ FLAG DESCRIPTIONS
|
|
|
517
555
|
Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.
|
|
518
556
|
```
|
|
519
557
|
|
|
520
|
-
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v2.
|
|
558
|
+
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v2.2.27/src/commands/version.ts)_
|
|
521
559
|
<!-- 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,10 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class GetGroup extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
7
|
+
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const parseAndCheckHttpResponse_1 = require("@apollo/client/link/http/parseAndCheckHttpResponse");
|
|
5
|
+
const graphql_1 = require("../../graphql");
|
|
6
|
+
const apollo_1 = require("../../lib/apollo");
|
|
7
|
+
const cmd_1 = require("../../lib/cmd");
|
|
8
|
+
const flags_1 = require("../../lib/flags");
|
|
9
|
+
const GET_GROUP_QUERY = (0, graphql_1.graphql)(`
|
|
10
|
+
query GetGroup($id: GroupId!) {
|
|
11
|
+
group(input: { id: $id }) {
|
|
12
|
+
__typename
|
|
13
|
+
... on GroupResult {
|
|
14
|
+
group {
|
|
15
|
+
name
|
|
16
|
+
id
|
|
17
|
+
description
|
|
18
|
+
groupType
|
|
19
|
+
adminOwnerId
|
|
20
|
+
groupLeaders {
|
|
21
|
+
fullName
|
|
22
|
+
email
|
|
23
|
+
id
|
|
24
|
+
}
|
|
25
|
+
connection {
|
|
26
|
+
name
|
|
27
|
+
id
|
|
28
|
+
connectionType
|
|
29
|
+
}
|
|
30
|
+
paginatedGroupUsers {
|
|
31
|
+
totalNumGroupUsers
|
|
32
|
+
groupUsers {
|
|
33
|
+
user {
|
|
34
|
+
fullName
|
|
35
|
+
email
|
|
36
|
+
id
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
... on GroupNotFoundError {
|
|
43
|
+
message
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}`);
|
|
47
|
+
class GetGroup extends core_1.Command {
|
|
48
|
+
async run() {
|
|
49
|
+
(0, cmd_1.setMostRecentCommand)(this);
|
|
50
|
+
const { flags } = await this.parse(GetGroup);
|
|
51
|
+
if (!flags.id) {
|
|
52
|
+
this.log("Error: Please provide a group ID using the --id flag.");
|
|
53
|
+
this.log("ex. opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const client = await (0, apollo_1.getClient)(this);
|
|
58
|
+
const resp = await client.query({
|
|
59
|
+
query: GET_GROUP_QUERY,
|
|
60
|
+
variables: {
|
|
61
|
+
id: flags.id,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
(0, apollo_1.printResponse)(this, resp);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return (0, parseAndCheckHttpResponse_1.handleError)(this, error);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
GetGroup.description = "Get group info for a particular group.";
|
|
72
|
+
GetGroup.examples = [
|
|
73
|
+
"opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4",
|
|
74
|
+
];
|
|
75
|
+
GetGroup.flags = {
|
|
76
|
+
help: flags_1.SHARED_FLAGS.help,
|
|
77
|
+
id: flags_1.SHARED_FLAGS.id,
|
|
78
|
+
};
|
|
79
|
+
exports.default = GetGroup;
|
|
@@ -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
|
@@ -12,7 +12,10 @@ import * as types from "./graphql";
|
|
|
12
12
|
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
|
|
13
13
|
*/
|
|
14
14
|
type Documents = {
|
|
15
|
+
"\nquery GetGroup($id: GroupId!) {\n group(input: { id: $id }) {\n __typename\n ... on GroupResult {\n group {\n name\n id\n description\n groupType\n adminOwnerId\n groupLeaders {\n fullName\n email\n id\n }\n connection {\n name\n id\n connectionType\n }\n paginatedGroupUsers {\n totalNumGroupUsers\n groupUsers {\n user {\n fullName\n email\n id\n }\n }\n }\n }\n }\n ... on GroupNotFoundError {\n message\n }\n }\n}": typeof types.GetGroupDocument;
|
|
15
16
|
"\nquery CheckAuthSessionQuery {\n organizationSettings {\n ... on OrganizationSettingsResult {\n settings {\n id\n }\n }\n }\n}\n": typeof types.CheckAuthSessionQueryDocument;
|
|
17
|
+
'\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;
|
|
18
|
+
"\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
19
|
};
|
|
17
20
|
declare const documents: Documents;
|
|
18
21
|
/**
|
|
@@ -28,9 +31,21 @@ declare const documents: Documents;
|
|
|
28
31
|
* Please regenerate the types.
|
|
29
32
|
*/
|
|
30
33
|
export declare function graphql(source: string): unknown;
|
|
34
|
+
/**
|
|
35
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
36
|
+
*/
|
|
37
|
+
export declare function graphql(source: "\nquery GetGroup($id: GroupId!) {\n group(input: { id: $id }) {\n __typename\n ... on GroupResult {\n group {\n name\n id\n description\n groupType\n adminOwnerId\n groupLeaders {\n fullName\n email\n id\n }\n connection {\n name\n id\n connectionType\n }\n paginatedGroupUsers {\n totalNumGroupUsers\n groupUsers {\n user {\n fullName\n email\n id\n }\n }\n }\n }\n }\n ... on GroupNotFoundError {\n message\n }\n }\n}"): (typeof documents)["\nquery GetGroup($id: GroupId!) {\n group(input: { id: $id }) {\n __typename\n ... on GroupResult {\n group {\n name\n id\n description\n groupType\n adminOwnerId\n groupLeaders {\n fullName\n email\n id\n }\n connection {\n name\n id\n connectionType\n }\n paginatedGroupUsers {\n totalNumGroupUsers\n groupUsers {\n user {\n fullName\n email\n id\n }\n }\n }\n }\n }\n ... on GroupNotFoundError {\n message\n }\n }\n}"];
|
|
31
38
|
/**
|
|
32
39
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
33
40
|
*/
|
|
34
41
|
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"];
|
|
42
|
+
/**
|
|
43
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
44
|
+
*/
|
|
45
|
+
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 '];
|
|
46
|
+
/**
|
|
47
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
48
|
+
*/
|
|
49
|
+
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
50
|
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|
|
36
51
|
export {};
|
package/lib/graphql/gql.js
CHANGED
|
@@ -4,7 +4,10 @@ exports.graphql = graphql;
|
|
|
4
4
|
/* eslint-disable */
|
|
5
5
|
const types = require("./graphql");
|
|
6
6
|
const documents = {
|
|
7
|
+
"\nquery GetGroup($id: GroupId!) {\n group(input: { id: $id }) {\n __typename\n ... on GroupResult {\n group {\n name\n id\n description\n groupType\n adminOwnerId\n groupLeaders {\n fullName\n email\n id\n }\n connection {\n name\n id\n connectionType\n }\n paginatedGroupUsers {\n totalNumGroupUsers\n groupUsers {\n user {\n fullName\n email\n id\n }\n }\n }\n }\n }\n ... on GroupNotFoundError {\n message\n }\n }\n}": types.GetGroupDocument,
|
|
7
8
|
"\nquery CheckAuthSessionQuery {\n organizationSettings {\n ... on OrganizationSettingsResult {\n settings {\n id\n }\n }\n }\n}\n": types.CheckAuthSessionQueryDocument,
|
|
9
|
+
'\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,
|
|
10
|
+
"\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
11
|
};
|
|
9
12
|
function graphql(source) {
|
|
10
13
|
var _a;
|