opal-security 3.1.0 → 3.1.1-beta.778ef29
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 +18 -34
- package/lib/commands/request/list.d.ts +0 -1
- package/lib/commands/request/list.js +1 -1
- package/lib/graphql/gql.d.ts +7 -2
- package/lib/graphql/gql.js +2 -1
- package/lib/graphql/graphql.d.ts +19 -0
- package/lib/graphql/graphql.js +152 -1
- package/lib/lib/requests.d.ts +1 -1
- package/lib/lib/requests.js +116 -42
- package/lib/utils/displays.js +4 -4
- package/oclif.manifest.json +2 -4
- package/package.json +1 -1
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.
|
|
25
|
+
opal-security/3.1.1-beta.778ef29 linux-x64 node-v20.19.1
|
|
26
26
|
$ opal --help [COMMAND]
|
|
27
27
|
USAGE
|
|
28
28
|
$ opal COMMAND
|
|
@@ -44,7 +44,6 @@ 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 ls`](#opal-request-ls)
|
|
48
47
|
* [`opal resources get`](#opal-resources-get)
|
|
49
48
|
* [`opal set-auth-provider`](#opal-set-auth-provider)
|
|
50
49
|
* [`opal set-custom-header`](#opal-set-custom-header)
|
|
@@ -102,7 +101,7 @@ EXAMPLES
|
|
|
102
101
|
$ opal aws:identity
|
|
103
102
|
```
|
|
104
103
|
|
|
105
|
-
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
104
|
+
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/aws/identity.ts)_
|
|
106
105
|
|
|
107
106
|
## `opal clear-auth-provider`
|
|
108
107
|
|
|
@@ -122,7 +121,7 @@ EXAMPLES
|
|
|
122
121
|
$ opal clear-auth-provider
|
|
123
122
|
```
|
|
124
123
|
|
|
125
|
-
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
124
|
+
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/clear-auth-provider.ts)_
|
|
126
125
|
|
|
127
126
|
## `opal curl-example`
|
|
128
127
|
|
|
@@ -139,7 +138,7 @@ DESCRIPTION
|
|
|
139
138
|
Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.
|
|
140
139
|
```
|
|
141
140
|
|
|
142
|
-
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
141
|
+
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/curl-example.ts)_
|
|
143
142
|
|
|
144
143
|
## `opal groups get`
|
|
145
144
|
|
|
@@ -160,7 +159,7 @@ EXAMPLES
|
|
|
160
159
|
$ opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
161
160
|
```
|
|
162
161
|
|
|
163
|
-
_See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
162
|
+
_See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/groups/get.ts)_
|
|
164
163
|
|
|
165
164
|
## `opal help [COMMANDS]`
|
|
166
165
|
|
|
@@ -210,7 +209,7 @@ EXAMPLES
|
|
|
210
209
|
$ opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName "custom-profile"
|
|
211
210
|
```
|
|
212
211
|
|
|
213
|
-
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
212
|
+
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/iam-roles/start.ts)_
|
|
214
213
|
|
|
215
214
|
## `opal kube-roles start`
|
|
216
215
|
|
|
@@ -241,7 +240,7 @@ EXAMPLES
|
|
|
241
240
|
$ opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId "arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role"
|
|
242
241
|
```
|
|
243
242
|
|
|
244
|
-
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
243
|
+
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/kube-roles/start.ts)_
|
|
245
244
|
|
|
246
245
|
## `opal login`
|
|
247
246
|
|
|
@@ -262,7 +261,7 @@ EXAMPLES
|
|
|
262
261
|
$ opal login
|
|
263
262
|
```
|
|
264
263
|
|
|
265
|
-
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
264
|
+
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/login.ts)_
|
|
266
265
|
|
|
267
266
|
## `opal logout`
|
|
268
267
|
|
|
@@ -282,7 +281,7 @@ EXAMPLES
|
|
|
282
281
|
$ opal logout
|
|
283
282
|
```
|
|
284
283
|
|
|
285
|
-
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
284
|
+
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/logout.ts)_
|
|
286
285
|
|
|
287
286
|
## `opal postgres-instances start`
|
|
288
287
|
|
|
@@ -319,22 +318,7 @@ EXAMPLES
|
|
|
319
318
|
$ opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId fullaccess --action view
|
|
320
319
|
```
|
|
321
320
|
|
|
322
|
-
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
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
|
-
```
|
|
321
|
+
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/postgres-instances/start.ts)_
|
|
338
322
|
|
|
339
323
|
## `opal resources get`
|
|
340
324
|
|
|
@@ -355,7 +339,7 @@ EXAMPLES
|
|
|
355
339
|
$ opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
356
340
|
```
|
|
357
341
|
|
|
358
|
-
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
342
|
+
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/resources/get.ts)_
|
|
359
343
|
|
|
360
344
|
## `opal set-auth-provider`
|
|
361
345
|
|
|
@@ -381,7 +365,7 @@ EXAMPLES
|
|
|
381
365
|
$ opal set-auth-provider --clientID 1234asdf --issuerUrl https://auth.example.com
|
|
382
366
|
```
|
|
383
367
|
|
|
384
|
-
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
368
|
+
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/set-auth-provider.ts)_
|
|
385
369
|
|
|
386
370
|
## `opal set-custom-header`
|
|
387
371
|
|
|
@@ -402,7 +386,7 @@ EXAMPLES
|
|
|
402
386
|
$ opal set-custom-header --header 'cf-access-token: $TOKEN'
|
|
403
387
|
```
|
|
404
388
|
|
|
405
|
-
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
389
|
+
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/set-custom-header.ts)_
|
|
406
390
|
|
|
407
391
|
## `opal set-token`
|
|
408
392
|
|
|
@@ -422,7 +406,7 @@ EXAMPLES
|
|
|
422
406
|
$ opal set-token
|
|
423
407
|
```
|
|
424
408
|
|
|
425
|
-
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
409
|
+
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/set-token.ts)_
|
|
426
410
|
|
|
427
411
|
## `opal set-url [URL]`
|
|
428
412
|
|
|
@@ -446,7 +430,7 @@ EXAMPLES
|
|
|
446
430
|
$ opal set-url
|
|
447
431
|
```
|
|
448
432
|
|
|
449
|
-
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
433
|
+
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/set-url.ts)_
|
|
450
434
|
|
|
451
435
|
## `opal ssh copyFrom`
|
|
452
436
|
|
|
@@ -477,7 +461,7 @@ EXAMPLES
|
|
|
477
461
|
$ opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
478
462
|
```
|
|
479
463
|
|
|
480
|
-
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
464
|
+
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/ssh/copyFrom.ts)_
|
|
481
465
|
|
|
482
466
|
## `opal ssh copyTo`
|
|
483
467
|
|
|
@@ -508,7 +492,7 @@ EXAMPLES
|
|
|
508
492
|
$ opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
509
493
|
```
|
|
510
494
|
|
|
511
|
-
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
495
|
+
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/ssh/copyTo.ts)_
|
|
512
496
|
|
|
513
497
|
## `opal ssh start`
|
|
514
498
|
|
|
@@ -535,7 +519,7 @@ EXAMPLES
|
|
|
535
519
|
$ opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
536
520
|
```
|
|
537
521
|
|
|
538
|
-
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.
|
|
522
|
+
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.1.1-beta.778ef29/src/commands/ssh/start.ts)_
|
|
539
523
|
|
|
540
524
|
## `opal version`
|
|
541
525
|
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const utils_1 = require("../../utils/utils");
|
|
5
5
|
class RequestList extends core_1.Command {
|
|
6
|
+
// static aliases = ["request:ls"];
|
|
6
7
|
async run() {
|
|
7
8
|
(0, utils_1.restrictToDev)(); //TODO: Remove after development is complete
|
|
8
9
|
this.log("Running the list command");
|
|
@@ -10,5 +11,4 @@ class RequestList extends core_1.Command {
|
|
|
10
11
|
}
|
|
11
12
|
RequestList.hidden = true;
|
|
12
13
|
RequestList.description = "Lists access requests";
|
|
13
|
-
RequestList.aliases = ["request:ls"];
|
|
14
14
|
exports.default = RequestList;
|
package/lib/graphql/gql.d.ts
CHANGED
|
@@ -15,7 +15,8 @@ type Documents = {
|
|
|
15
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;
|
|
16
16
|
"\nquery CheckAuthSessionQuery {\n organizationSettings {\n ... on OrganizationSettingsResult {\n settings {\n id\n }\n }\n }\n}\n": typeof types.CheckAuthSessionQueryDocument;
|
|
17
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;
|
|
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 ... on AppNotFoundError {\n message\n }\n }\n}\n": typeof types.PaginatedEntityDropdownDocument;
|
|
19
|
+
"\n query ResourceAccessLevels($resourceId: ResourceId!) {\n accessLevels(input: {\n resourceId: $resourceId,\n onlyMine: false,\n }) {\n __typename\n ... on ResourceAccessLevelsResult {\n accessLevels {\n __typename\n ... on ResourceAccessLevel {\n accessLevelName\n accessLevelRemoteId\n }\n }\n }\n ... on ResourceNotFoundError {\n message\n }\n }\n }\n": typeof types.ResourceAccessLevelsDocument;
|
|
19
20
|
};
|
|
20
21
|
declare const documents: Documents;
|
|
21
22
|
/**
|
|
@@ -46,6 +47,10 @@ export declare function graphql(source: '\n query GetRequestableAppsQuery($sear
|
|
|
46
47
|
/**
|
|
47
48
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
48
49
|
*/
|
|
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"];
|
|
50
|
+
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 ... on AppNotFoundError {\n message\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 ... on AppNotFoundError {\n message\n }\n }\n}\n"];
|
|
51
|
+
/**
|
|
52
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
53
|
+
*/
|
|
54
|
+
export declare function graphql(source: "\n query ResourceAccessLevels($resourceId: ResourceId!) {\n accessLevels(input: {\n resourceId: $resourceId,\n onlyMine: false,\n }) {\n __typename\n ... on ResourceAccessLevelsResult {\n accessLevels {\n __typename\n ... on ResourceAccessLevel {\n accessLevelName\n accessLevelRemoteId\n }\n }\n }\n ... on ResourceNotFoundError {\n message\n }\n }\n }\n"): (typeof documents)["\n query ResourceAccessLevels($resourceId: ResourceId!) {\n accessLevels(input: {\n resourceId: $resourceId,\n onlyMine: false,\n }) {\n __typename\n ... on ResourceAccessLevelsResult {\n accessLevels {\n __typename\n ... on ResourceAccessLevel {\n accessLevelName\n accessLevelRemoteId\n }\n }\n }\n ... on ResourceNotFoundError {\n message\n }\n }\n }\n"];
|
|
50
55
|
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|
|
51
56
|
export {};
|
package/lib/graphql/gql.js
CHANGED
|
@@ -7,7 +7,8 @@ const documents = {
|
|
|
7
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,
|
|
8
8
|
"\nquery CheckAuthSessionQuery {\n organizationSettings {\n ... on OrganizationSettingsResult {\n settings {\n id\n }\n }\n }\n}\n": types.CheckAuthSessionQueryDocument,
|
|
9
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,
|
|
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 ... on AppNotFoundError {\n message\n }\n }\n}\n": types.PaginatedEntityDropdownDocument,
|
|
11
|
+
"\n query ResourceAccessLevels($resourceId: ResourceId!) {\n accessLevels(input: {\n resourceId: $resourceId,\n onlyMine: false,\n }) {\n __typename\n ... on ResourceAccessLevelsResult {\n accessLevels {\n __typename\n ... on ResourceAccessLevel {\n accessLevelName\n accessLevelRemoteId\n }\n }\n }\n ... on ResourceNotFoundError {\n message\n }\n }\n }\n": types.ResourceAccessLevelsDocument,
|
|
11
12
|
};
|
|
12
13
|
function graphql(source) {
|
|
13
14
|
var _a;
|
package/lib/graphql/graphql.d.ts
CHANGED
|
@@ -11514,9 +11514,28 @@ export type PaginatedEntityDropdownQuery = {
|
|
|
11514
11514
|
};
|
|
11515
11515
|
} | {
|
|
11516
11516
|
__typename: "AppNotFoundError";
|
|
11517
|
+
message: string;
|
|
11518
|
+
};
|
|
11519
|
+
};
|
|
11520
|
+
export type ResourceAccessLevelsQueryVariables = Exact<{
|
|
11521
|
+
resourceId: Scalars["ResourceId"]["input"];
|
|
11522
|
+
}>;
|
|
11523
|
+
export type ResourceAccessLevelsQuery = {
|
|
11524
|
+
__typename?: "Query";
|
|
11525
|
+
accessLevels: {
|
|
11526
|
+
__typename: "ResourceAccessLevelsResult";
|
|
11527
|
+
accessLevels: Array<{
|
|
11528
|
+
__typename: "ResourceAccessLevel";
|
|
11529
|
+
accessLevelName: string;
|
|
11530
|
+
accessLevelRemoteId: string;
|
|
11531
|
+
}>;
|
|
11532
|
+
} | {
|
|
11533
|
+
__typename: "ResourceNotFoundError";
|
|
11534
|
+
message: string;
|
|
11517
11535
|
};
|
|
11518
11536
|
};
|
|
11519
11537
|
export declare const GetGroupDocument: DocumentNode<GetGroupQuery, GetGroupQueryVariables>;
|
|
11520
11538
|
export declare const CheckAuthSessionQueryDocument: DocumentNode<CheckAuthSessionQueryQuery, CheckAuthSessionQueryQueryVariables>;
|
|
11521
11539
|
export declare const GetRequestableAppsQueryDocument: DocumentNode<GetRequestableAppsQueryQuery, GetRequestableAppsQueryQueryVariables>;
|
|
11522
11540
|
export declare const PaginatedEntityDropdownDocument: DocumentNode<PaginatedEntityDropdownQuery, PaginatedEntityDropdownQueryVariables>;
|
|
11541
|
+
export declare const ResourceAccessLevelsDocument: DocumentNode<ResourceAccessLevelsQuery, ResourceAccessLevelsQueryVariables>;
|
package/lib/graphql/graphql.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HealthStatus = exports.GroupUserSource = exports.GroupUserSortByField = exports.GroupType = exports.GroupResourceSource = exports.GroupBindingsSortByField = exports.GroupBindingSuggestionsSortByField = exports.GeneralSettingType = exports.FiltersMatchMode = exports.FactorType = exports.EventType = exports.EventSeverity = exports.ErrorNotificationSettingType = exports.EntityType = exports.ConnectionValidationStatus = exports.ConnectionValidationSeverity = exports.ConnectionType = exports.BundlesSortByField = exports.BundleItemsSortByField = exports.AuthType = exports.AuthSessionStatus = exports.AuthFlowType = exports.AssociatedItemsSortByField = exports.AssignmentsSortByField = exports.AppsSortByField = exports.AppType = exports.AppItemsSortByField = exports.AppCategory = exports.ApiAuthType = exports.ApiAccessLevel = exports.AldwinRole = exports.AccessType = exports.AccessRuleStatus = exports.AccessReviewUserWarningType = exports.AccessReviewType = exports.AccessReviewTab = exports.AccessReviewSummaryStatus = exports.AccessReviewStatus = exports.AccessReviewReviewerAssignmentPolicy = exports.AccessReviewItemsSortByField = exports.AccessReviewItemStatus = exports.AccessReviewItemOutcome = exports.AccessReviewGroupResourceVisibilityPolicy = exports.AccessReviewGroupItemKind = exports.AccessReviewEndUserView = exports.AccessReviewAssignedStatus = exports.AccessReviewAction = exports.AccessOption = exports.AccessChangeType = exports.AwsIdentityCenterImportSetting = void 0;
|
|
4
4
|
exports.TaskTrigger = exports.TagsSortByField = exports.TagFilterMatchMode = exports.SyncType = exports.SyncTaskStatus = exports.SubEventsSortByField = exports.StringFormatType = exports.SortDirection = exports.ServiceType = exports.SearchType = exports.RolePermissionTargetType = exports.RolePermission = exports.RoleAssignmentsSortByField = exports.RoleAssignmentSource = exports.RiskLevel = exports.ReviewerUserStatus = exports.ReviewerAction = exports.ReviewStageOperator = exports.ResourceUserSource = exports.ResourceUserSortByField = exports.ResourceType = exports.RequestsSortByField = exports.RequestType = exports.RequestTemplateCustomFieldType = exports.RequestStatus = exports.RequestMessageLevel = exports.RequestMessageCode = exports.RequestApprovalType = exports.RecommendationsSubscoreType = exports.RecommendationsMetricType = exports.RecommendationsFeedbackType = exports.RecommendationsEntityType = exports.PubsubPublishMessageType = exports.PubsubPublishMessageStatusCode = exports.PubsubPublishConnectionType = exports.ProvisionSource = exports.PropagationTaskType = exports.PropagationStatusCode = exports.OwnersSortByField = exports.OrganizationType = exports.OidcProviderType = exports.NotificationType = exports.MessageChannelType = exports.MfaProvider = exports.IntegrationType = exports.ImportSetting = exports.IdpConnectionUserAttributeUseAs = exports.IdpConnectionType = exports.IdentityCategory = exports.HrIdpStatus = void 0;
|
|
5
|
-
exports.PaginatedEntityDropdownDocument = exports.GetRequestableAppsQueryDocument = exports.CheckAuthSessionQueryDocument = exports.GetGroupDocument = exports.RequestDecisionLevel = exports.WebhookPubsubPublishConnectionAuthType = exports.WebhookPubsubPublishConnectionApiKeyLocation = exports.Visibility = exports.VerifyFactorStatus = exports.UsersSortByField = exports.UserProductRole = exports.UserErrorType = exports.UsageAttributionType = exports.UiSource = exports.TimePeriod = exports.TimeBucket = exports.ThirdPartyProvider = void 0;
|
|
5
|
+
exports.ResourceAccessLevelsDocument = exports.PaginatedEntityDropdownDocument = exports.GetRequestableAppsQueryDocument = exports.CheckAuthSessionQueryDocument = exports.GetGroupDocument = exports.RequestDecisionLevel = exports.WebhookPubsubPublishConnectionAuthType = exports.WebhookPubsubPublishConnectionApiKeyLocation = exports.Visibility = exports.VerifyFactorStatus = exports.UsersSortByField = exports.UserProductRole = exports.UserErrorType = exports.UsageAttributionType = exports.UiSource = exports.TimePeriod = exports.TimeBucket = exports.ThirdPartyProvider = void 0;
|
|
6
6
|
var AwsIdentityCenterImportSetting;
|
|
7
7
|
(function (AwsIdentityCenterImportSetting) {
|
|
8
8
|
AwsIdentityCenterImportSetting["All"] = "ALL";
|
|
@@ -2026,6 +2026,157 @@ exports.PaginatedEntityDropdownDocument = {
|
|
|
2026
2026
|
],
|
|
2027
2027
|
},
|
|
2028
2028
|
},
|
|
2029
|
+
{
|
|
2030
|
+
kind: "InlineFragment",
|
|
2031
|
+
typeCondition: {
|
|
2032
|
+
kind: "NamedType",
|
|
2033
|
+
name: { kind: "Name", value: "AppNotFoundError" },
|
|
2034
|
+
},
|
|
2035
|
+
selectionSet: {
|
|
2036
|
+
kind: "SelectionSet",
|
|
2037
|
+
selections: [
|
|
2038
|
+
{
|
|
2039
|
+
kind: "Field",
|
|
2040
|
+
name: { kind: "Name", value: "message" },
|
|
2041
|
+
},
|
|
2042
|
+
],
|
|
2043
|
+
},
|
|
2044
|
+
},
|
|
2045
|
+
],
|
|
2046
|
+
},
|
|
2047
|
+
},
|
|
2048
|
+
],
|
|
2049
|
+
},
|
|
2050
|
+
},
|
|
2051
|
+
],
|
|
2052
|
+
};
|
|
2053
|
+
exports.ResourceAccessLevelsDocument = {
|
|
2054
|
+
kind: "Document",
|
|
2055
|
+
definitions: [
|
|
2056
|
+
{
|
|
2057
|
+
kind: "OperationDefinition",
|
|
2058
|
+
operation: "query",
|
|
2059
|
+
name: { kind: "Name", value: "ResourceAccessLevels" },
|
|
2060
|
+
variableDefinitions: [
|
|
2061
|
+
{
|
|
2062
|
+
kind: "VariableDefinition",
|
|
2063
|
+
variable: {
|
|
2064
|
+
kind: "Variable",
|
|
2065
|
+
name: { kind: "Name", value: "resourceId" },
|
|
2066
|
+
},
|
|
2067
|
+
type: {
|
|
2068
|
+
kind: "NonNullType",
|
|
2069
|
+
type: {
|
|
2070
|
+
kind: "NamedType",
|
|
2071
|
+
name: { kind: "Name", value: "ResourceId" },
|
|
2072
|
+
},
|
|
2073
|
+
},
|
|
2074
|
+
},
|
|
2075
|
+
],
|
|
2076
|
+
selectionSet: {
|
|
2077
|
+
kind: "SelectionSet",
|
|
2078
|
+
selections: [
|
|
2079
|
+
{
|
|
2080
|
+
kind: "Field",
|
|
2081
|
+
name: { kind: "Name", value: "accessLevels" },
|
|
2082
|
+
arguments: [
|
|
2083
|
+
{
|
|
2084
|
+
kind: "Argument",
|
|
2085
|
+
name: { kind: "Name", value: "input" },
|
|
2086
|
+
value: {
|
|
2087
|
+
kind: "ObjectValue",
|
|
2088
|
+
fields: [
|
|
2089
|
+
{
|
|
2090
|
+
kind: "ObjectField",
|
|
2091
|
+
name: { kind: "Name", value: "resourceId" },
|
|
2092
|
+
value: {
|
|
2093
|
+
kind: "Variable",
|
|
2094
|
+
name: { kind: "Name", value: "resourceId" },
|
|
2095
|
+
},
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
kind: "ObjectField",
|
|
2099
|
+
name: { kind: "Name", value: "onlyMine" },
|
|
2100
|
+
value: { kind: "BooleanValue", value: false },
|
|
2101
|
+
},
|
|
2102
|
+
],
|
|
2103
|
+
},
|
|
2104
|
+
},
|
|
2105
|
+
],
|
|
2106
|
+
selectionSet: {
|
|
2107
|
+
kind: "SelectionSet",
|
|
2108
|
+
selections: [
|
|
2109
|
+
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
|
|
2110
|
+
{
|
|
2111
|
+
kind: "InlineFragment",
|
|
2112
|
+
typeCondition: {
|
|
2113
|
+
kind: "NamedType",
|
|
2114
|
+
name: { kind: "Name", value: "ResourceAccessLevelsResult" },
|
|
2115
|
+
},
|
|
2116
|
+
selectionSet: {
|
|
2117
|
+
kind: "SelectionSet",
|
|
2118
|
+
selections: [
|
|
2119
|
+
{
|
|
2120
|
+
kind: "Field",
|
|
2121
|
+
name: { kind: "Name", value: "accessLevels" },
|
|
2122
|
+
selectionSet: {
|
|
2123
|
+
kind: "SelectionSet",
|
|
2124
|
+
selections: [
|
|
2125
|
+
{
|
|
2126
|
+
kind: "Field",
|
|
2127
|
+
name: { kind: "Name", value: "__typename" },
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
kind: "InlineFragment",
|
|
2131
|
+
typeCondition: {
|
|
2132
|
+
kind: "NamedType",
|
|
2133
|
+
name: {
|
|
2134
|
+
kind: "Name",
|
|
2135
|
+
value: "ResourceAccessLevel",
|
|
2136
|
+
},
|
|
2137
|
+
},
|
|
2138
|
+
selectionSet: {
|
|
2139
|
+
kind: "SelectionSet",
|
|
2140
|
+
selections: [
|
|
2141
|
+
{
|
|
2142
|
+
kind: "Field",
|
|
2143
|
+
name: {
|
|
2144
|
+
kind: "Name",
|
|
2145
|
+
value: "accessLevelName",
|
|
2146
|
+
},
|
|
2147
|
+
},
|
|
2148
|
+
{
|
|
2149
|
+
kind: "Field",
|
|
2150
|
+
name: {
|
|
2151
|
+
kind: "Name",
|
|
2152
|
+
value: "accessLevelRemoteId",
|
|
2153
|
+
},
|
|
2154
|
+
},
|
|
2155
|
+
],
|
|
2156
|
+
},
|
|
2157
|
+
},
|
|
2158
|
+
],
|
|
2159
|
+
},
|
|
2160
|
+
},
|
|
2161
|
+
],
|
|
2162
|
+
},
|
|
2163
|
+
},
|
|
2164
|
+
{
|
|
2165
|
+
kind: "InlineFragment",
|
|
2166
|
+
typeCondition: {
|
|
2167
|
+
kind: "NamedType",
|
|
2168
|
+
name: { kind: "Name", value: "ResourceNotFoundError" },
|
|
2169
|
+
},
|
|
2170
|
+
selectionSet: {
|
|
2171
|
+
kind: "SelectionSet",
|
|
2172
|
+
selections: [
|
|
2173
|
+
{
|
|
2174
|
+
kind: "Field",
|
|
2175
|
+
name: { kind: "Name", value: "message" },
|
|
2176
|
+
},
|
|
2177
|
+
],
|
|
2178
|
+
},
|
|
2179
|
+
},
|
|
2029
2180
|
],
|
|
2030
2181
|
},
|
|
2031
2182
|
},
|
package/lib/lib/requests.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface RoleNode {
|
|
|
15
15
|
export type RequestMap = Map<string, AppNode>;
|
|
16
16
|
export declare function selectRequestableItems(cmd: Command, client: ApolloClient<NormalizedCacheObject>, requestMap: RequestMap): Promise<void>;
|
|
17
17
|
export declare function chooseAssets(cmd: Command, client: ApolloClient<NormalizedCacheObject>, appId: string, requestMap: RequestMap): Promise<void>;
|
|
18
|
-
export declare function chooseRoles(appId: string, assetId: string, requestMap: RequestMap): Promise<void>;
|
|
18
|
+
export declare function chooseRoles(cmd: Command, client: ApolloClient<NormalizedCacheObject>, appId: string, assetId: string, requestMap: RequestMap): Promise<void>;
|
|
19
19
|
export declare function doneSelectingAssets(): Promise<boolean>;
|
|
20
20
|
export declare function promptForReason(): Promise<any>;
|
|
21
21
|
export declare function promptForExpiration(): Promise<any>;
|
package/lib/lib/requests.js
CHANGED
|
@@ -11,6 +11,7 @@ const inquirer = require("inquirer");
|
|
|
11
11
|
const graphql_1 = require("../graphql");
|
|
12
12
|
inquirer.registerPrompt("autocomplete", require("inquirer-autocomplete-prompt"));
|
|
13
13
|
// Queries and Mutations
|
|
14
|
+
// TODO: add pagination ability from CLI. (Load more...) option
|
|
14
15
|
const GET_REQUESTABLE_APPS_QUERY = (0, graphql_1.graphql)(`
|
|
15
16
|
query GetRequestableAppsQuery($searchQuery: String) {
|
|
16
17
|
appsV2(
|
|
@@ -40,39 +41,6 @@ const GET_REQUESTABLE_APPS_QUERY = (0, graphql_1.graphql)(`
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
`);
|
|
43
|
-
const GET_ASSETS_QUERY = (0, graphql_1.graphql)(`
|
|
44
|
-
query PaginatedEntityDropdown(
|
|
45
|
-
$id: UUID!
|
|
46
|
-
$searchQuery: String
|
|
47
|
-
) {
|
|
48
|
-
app(id: $id) {
|
|
49
|
-
__typename
|
|
50
|
-
... on App {
|
|
51
|
-
id
|
|
52
|
-
items(
|
|
53
|
-
input: {
|
|
54
|
-
access: REQUESTABLE
|
|
55
|
-
searchQuery: $searchQuery
|
|
56
|
-
includeOnlyRequestable: true
|
|
57
|
-
}
|
|
58
|
-
) {
|
|
59
|
-
items {
|
|
60
|
-
key
|
|
61
|
-
resource {
|
|
62
|
-
id
|
|
63
|
-
name
|
|
64
|
-
}
|
|
65
|
-
group {
|
|
66
|
-
id
|
|
67
|
-
name
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
cursor
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
`);
|
|
76
44
|
async function queryRequestableApps(cmd, client, input) {
|
|
77
45
|
var _a, _b;
|
|
78
46
|
try {
|
|
@@ -107,8 +75,44 @@ async function queryRequestableApps(cmd, client, input) {
|
|
|
107
75
|
}
|
|
108
76
|
}
|
|
109
77
|
}
|
|
78
|
+
const GET_ASSETS_QUERY = (0, graphql_1.graphql)(`
|
|
79
|
+
query PaginatedEntityDropdown(
|
|
80
|
+
$id: UUID!
|
|
81
|
+
$searchQuery: String
|
|
82
|
+
) {
|
|
83
|
+
app(id: $id) {
|
|
84
|
+
__typename
|
|
85
|
+
... on App {
|
|
86
|
+
id
|
|
87
|
+
items(
|
|
88
|
+
input: {
|
|
89
|
+
access: REQUESTABLE
|
|
90
|
+
searchQuery: $searchQuery
|
|
91
|
+
includeOnlyRequestable: true
|
|
92
|
+
}
|
|
93
|
+
) {
|
|
94
|
+
items {
|
|
95
|
+
key
|
|
96
|
+
resource {
|
|
97
|
+
id
|
|
98
|
+
name
|
|
99
|
+
}
|
|
100
|
+
group {
|
|
101
|
+
id
|
|
102
|
+
name
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
cursor
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
... on AppNotFoundError {
|
|
109
|
+
message
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`);
|
|
110
114
|
async function queryRequestableAssets(cmd, client, appId, input) {
|
|
111
|
-
var _a, _b, _c, _d;
|
|
115
|
+
var _a, _b, _c, _d, _e, _f;
|
|
112
116
|
try {
|
|
113
117
|
const resp = await client.query({
|
|
114
118
|
query: GET_ASSETS_QUERY,
|
|
@@ -137,10 +141,68 @@ async function queryRequestableAssets(cmd, client, appId, input) {
|
|
|
137
141
|
};
|
|
138
142
|
});
|
|
139
143
|
case "AppNotFoundError":
|
|
140
|
-
x = cmd.error(
|
|
144
|
+
x = cmd.error((_f = (_e = resp.data) === null || _e === void 0 ? void 0 : _e.app) === null || _f === void 0 ? void 0 : _f.message);
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
cmd.error(resp.error || "Unknown error occurred.");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
if (error instanceof Error || typeof error === "string") {
|
|
152
|
+
cmd.error(error);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const RESOURCE_ROLES_QUERY = (0, graphql_1.graphql)(`
|
|
157
|
+
query ResourceAccessLevels($resourceId: ResourceId!) {
|
|
158
|
+
accessLevels(input: {
|
|
159
|
+
resourceId: $resourceId,
|
|
160
|
+
onlyMine: false,
|
|
161
|
+
}) {
|
|
162
|
+
__typename
|
|
163
|
+
... on ResourceAccessLevelsResult {
|
|
164
|
+
accessLevels {
|
|
165
|
+
__typename
|
|
166
|
+
... on ResourceAccessLevel {
|
|
167
|
+
accessLevelName
|
|
168
|
+
accessLevelRemoteId
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
... on ResourceNotFoundError {
|
|
173
|
+
message
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`);
|
|
178
|
+
async function queryResourceRoles(cmd, client, resourceId) {
|
|
179
|
+
var _a, _b, _c, _d, _e;
|
|
180
|
+
try {
|
|
181
|
+
const resp = await client.query({
|
|
182
|
+
query: RESOURCE_ROLES_QUERY,
|
|
183
|
+
variables: {
|
|
184
|
+
resourceId: resourceId,
|
|
185
|
+
},
|
|
186
|
+
fetchPolicy: "network-only", // to avoid caching
|
|
187
|
+
});
|
|
188
|
+
// no fall through doesn't consider process.exit();
|
|
189
|
+
let x;
|
|
190
|
+
switch (resp.data.accessLevels.__typename) {
|
|
191
|
+
case "ResourceAccessLevelsResult":
|
|
192
|
+
return (_c = (_b = (_a = resp.data) === null || _a === void 0 ? void 0 : _a.accessLevels) === null || _b === void 0 ? void 0 : _b.accessLevels) === null || _c === void 0 ? void 0 : _c.map((role) => {
|
|
193
|
+
return {
|
|
194
|
+
name: role.accessLevelName,
|
|
195
|
+
value: {
|
|
196
|
+
name: role.accessLevelName,
|
|
197
|
+
id: role.accessLevelRemoteId,
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
case "ResourceNotFoundError":
|
|
202
|
+
x = cmd.error((_e = (_d = resp.data) === null || _d === void 0 ? void 0 : _d.accessLevels) === null || _e === void 0 ? void 0 : _e.message);
|
|
141
203
|
break;
|
|
142
204
|
default:
|
|
143
|
-
cmd.error("Unknown error occurred.");
|
|
205
|
+
cmd.error(resp.error || "Unknown error occurred.");
|
|
144
206
|
}
|
|
145
207
|
}
|
|
146
208
|
catch (error) {
|
|
@@ -198,16 +260,28 @@ async function chooseAssets(cmd, client, appId, requestMap) {
|
|
|
198
260
|
roles: new Map(),
|
|
199
261
|
});
|
|
200
262
|
}
|
|
201
|
-
await chooseRoles(appId, asset.id, requestMap);
|
|
263
|
+
await chooseRoles(cmd, client, appId, asset.id, requestMap);
|
|
202
264
|
}
|
|
203
265
|
}
|
|
204
|
-
async function chooseRoles(appId, assetId, requestMap) {
|
|
205
|
-
var _a;
|
|
266
|
+
async function chooseRoles(cmd, client, appId, assetId, requestMap) {
|
|
267
|
+
var _a, _b;
|
|
268
|
+
const resourceRoles = (_a = (await queryResourceRoles(cmd, client, assetId))) !== null && _a !== void 0 ? _a : [];
|
|
269
|
+
if (resourceRoles !== undefined &&
|
|
270
|
+
(resourceRoles.length === 0 ||
|
|
271
|
+
(resourceRoles.length === 1 && resourceRoles[0].name === ""))) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
206
274
|
const { roles } = await inquirer.prompt({
|
|
207
275
|
name: "roles",
|
|
208
276
|
type: "checkbox",
|
|
209
277
|
message: `Select one or more roles for ${assetId}:`,
|
|
210
|
-
choices:
|
|
278
|
+
choices: resourceRoles,
|
|
279
|
+
validate: (answer) => {
|
|
280
|
+
if ((resourceRoles === null || resourceRoles === void 0 ? void 0 : resourceRoles.length) > 1 && answer.length < 1) {
|
|
281
|
+
return "You must select at least one role.";
|
|
282
|
+
}
|
|
283
|
+
return true;
|
|
284
|
+
},
|
|
211
285
|
});
|
|
212
286
|
const entry = requestMap.get(appId);
|
|
213
287
|
const assetEntry = entry === null || entry === void 0 ? void 0 : entry.assets.get(assetId);
|
|
@@ -215,8 +289,8 @@ async function chooseRoles(appId, assetId, requestMap) {
|
|
|
215
289
|
throw new Error(`App ${appId} or Asset ${assetId} not found in requestMap`);
|
|
216
290
|
}
|
|
217
291
|
for (const role of roles) {
|
|
218
|
-
(
|
|
219
|
-
roleName: role,
|
|
292
|
+
(_b = assetEntry.roles) === null || _b === void 0 ? void 0 : _b.set(role.id, {
|
|
293
|
+
roleName: role.name,
|
|
220
294
|
});
|
|
221
295
|
}
|
|
222
296
|
}
|
package/lib/utils/displays.js
CHANGED
|
@@ -32,18 +32,18 @@ function treeifyRequestMap(requestMap) {
|
|
|
32
32
|
const requestTree = {};
|
|
33
33
|
// Create a tree structure from the requestMap
|
|
34
34
|
// Iterate over apps
|
|
35
|
-
for (const
|
|
35
|
+
for (const appNode of requestMap.values()) {
|
|
36
36
|
const appKey = `🔧${appNode.appName}`;
|
|
37
37
|
requestTree[appKey] = {}; // Initialize the app key
|
|
38
38
|
// Iterate over assets
|
|
39
|
-
for (const
|
|
39
|
+
for (const assetNode of appNode.assets.values()) {
|
|
40
40
|
const assetKey = `📦${assetNode.assetName}`;
|
|
41
41
|
if (assetNode.roles !== undefined) {
|
|
42
42
|
// If no roles were previously selected
|
|
43
43
|
requestTree[appKey][assetKey] = {}; // Initialize the asset key
|
|
44
44
|
// Iterate over roles
|
|
45
|
-
for (const
|
|
46
|
-
requestTree[appKey][assetKey][roleName] = null; // Initialize the role key
|
|
45
|
+
for (const roleNode of assetNode.roles.values()) {
|
|
46
|
+
requestTree[appKey][assetKey][roleNode.roleName] = null; // Initialize the role key
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
else {
|
package/oclif.manifest.json
CHANGED
|
@@ -639,9 +639,7 @@
|
|
|
639
639
|
]
|
|
640
640
|
},
|
|
641
641
|
"request:list": {
|
|
642
|
-
"aliases": [
|
|
643
|
-
"request:ls"
|
|
644
|
-
],
|
|
642
|
+
"aliases": [],
|
|
645
643
|
"args": {},
|
|
646
644
|
"description": "Lists access requests",
|
|
647
645
|
"flags": {},
|
|
@@ -909,5 +907,5 @@
|
|
|
909
907
|
]
|
|
910
908
|
}
|
|
911
909
|
},
|
|
912
|
-
"version": "3.1.
|
|
910
|
+
"version": "3.1.1-beta.778ef29"
|
|
913
911
|
}
|
package/package.json
CHANGED