opal-security 3.2.1 → 3.2.2

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.
Files changed (56) hide show
  1. package/README.md +28 -25
  2. package/lib/commands/login.js +8 -1
  3. package/lib/commands/request/create.d.ts +2 -0
  4. package/lib/commands/request/create.js +41 -20
  5. package/lib/commands/request/get.js +5 -57
  6. package/lib/commands/request/list.js +3 -60
  7. package/lib/graphql/gql.d.ts +35 -15
  8. package/lib/graphql/gql.js +9 -5
  9. package/lib/graphql/graphql.d.ts +286 -228
  10. package/lib/graphql/graphql.js +1674 -1095
  11. package/lib/labels.d.ts +3 -0
  12. package/lib/labels.js +37 -0
  13. package/lib/lib/request/api/index.d.ts +6 -0
  14. package/lib/lib/request/api/index.js +20 -0
  15. package/lib/lib/request/api/mutations/create-request.d.ts +8 -0
  16. package/lib/lib/request/api/mutations/create-request.js +159 -0
  17. package/lib/lib/request/api/queries/apps.d.ts +4 -0
  18. package/lib/lib/request/api/queries/apps.js +73 -0
  19. package/lib/lib/request/api/queries/assets.d.ts +6 -0
  20. package/lib/lib/request/api/queries/assets.js +136 -0
  21. package/lib/lib/request/api/queries/request-defaults.d.ts +5 -0
  22. package/lib/lib/request/api/queries/request-defaults.js +51 -0
  23. package/lib/lib/request/api/queries/requests.d.ts +4 -0
  24. package/lib/lib/request/api/queries/requests.js +163 -0
  25. package/lib/lib/request/api/queries/roles.d.ts +5 -0
  26. package/lib/lib/request/api/queries/roles.js +239 -0
  27. package/lib/{utils → lib/request}/displays.d.ts +4 -2
  28. package/lib/{utils → lib/request}/displays.js +41 -19
  29. package/lib/lib/request/prompts/apps-prompt.d.ts +4 -0
  30. package/lib/lib/request/prompts/apps-prompt.js +35 -0
  31. package/lib/lib/request/prompts/asset-prompt.d.ts +5 -0
  32. package/lib/lib/request/prompts/asset-prompt.js +81 -0
  33. package/lib/lib/request/prompts/duration-prompt.d.ts +2 -0
  34. package/lib/lib/request/prompts/duration-prompt.js +122 -0
  35. package/lib/lib/request/prompts/index.d.ts +8 -0
  36. package/lib/lib/request/prompts/index.js +20 -0
  37. package/lib/lib/request/prompts/reason-prompt.d.ts +2 -0
  38. package/lib/lib/request/prompts/reason-prompt.js +20 -0
  39. package/lib/lib/request/prompts/role-prompt.d.ts +4 -0
  40. package/lib/lib/request/prompts/role-prompt.js +44 -0
  41. package/lib/lib/request/prompts/validate-prompt.d.ts +4 -0
  42. package/lib/lib/request/prompts/validate-prompt.js +29 -0
  43. package/lib/lib/request/request-utils.d.ts +15 -0
  44. package/lib/lib/request/request-utils.js +467 -0
  45. package/lib/lib/request/types.d.ts +55 -0
  46. package/lib/lib/request/types.js +15 -0
  47. package/lib/lib/util.d.ts +1 -0
  48. package/lib/lib/util.js +16 -0
  49. package/lib/types.d.ts +19 -3
  50. package/lib/types.js +18 -2
  51. package/oclif.manifest.json +54 -38
  52. package/package.json +1 -1
  53. package/lib/lib/requests.d.ts +0 -54
  54. package/lib/lib/requests.js +0 -1160
  55. package/lib/utils/utils.d.ts +0 -1
  56. package/lib/utils/utils.js +0 -18
@@ -376,14 +376,12 @@
376
376
  "identity.js"
377
377
  ]
378
378
  },
379
- "iam-roles:start": {
379
+ "groups:get": {
380
380
  "aliases": [],
381
381
  "args": {},
382
- "description": "Starts a session to assume an IAM role.",
382
+ "description": "Get group info for a particular group.",
383
383
  "examples": [
384
- "opal iam-roles:start",
385
- "opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398",
386
- "opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName \"custom-profile\""
384
+ "opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4"
387
385
  ],
388
386
  "flags": {
389
387
  "help": {
@@ -400,33 +398,11 @@
400
398
  "hasDynamicHelp": false,
401
399
  "multiple": false,
402
400
  "type": "option"
403
- },
404
- "sessionId": {
405
- "char": "s",
406
- "description": "The Opal ID of the session to connect to. Uses an existing session that was created via the web flow.",
407
- "name": "sessionId",
408
- "hasDynamicHelp": false,
409
- "multiple": false,
410
- "type": "option"
411
- },
412
- "refresh": {
413
- "char": "r",
414
- "description": "Starts a new session even if one already exists. Useful if a session is about to expire.",
415
- "name": "refresh",
416
- "allowNo": false,
417
- "type": "boolean"
418
- },
419
- "profileName": {
420
- "description": "Uses a custom AWS profile name for the IAM role. Default value is the role's name.",
421
- "name": "profileName",
422
- "hasDynamicHelp": false,
423
- "multiple": false,
424
- "type": "option"
425
401
  }
426
402
  },
427
403
  "hasDynamicHelp": false,
428
404
  "hiddenAliases": [],
429
- "id": "iam-roles:start",
405
+ "id": "groups:get",
430
406
  "pluginAlias": "opal-security",
431
407
  "pluginName": "opal-security",
432
408
  "pluginType": "core",
@@ -436,16 +412,18 @@
436
412
  "relativePath": [
437
413
  "lib",
438
414
  "commands",
439
- "iam-roles",
440
- "start.js"
415
+ "groups",
416
+ "get.js"
441
417
  ]
442
418
  },
443
- "groups:get": {
419
+ "iam-roles:start": {
444
420
  "aliases": [],
445
421
  "args": {},
446
- "description": "Get group info for a particular group.",
422
+ "description": "Starts a session to assume an IAM role.",
447
423
  "examples": [
448
- "opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4"
424
+ "opal iam-roles:start",
425
+ "opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398",
426
+ "opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName \"custom-profile\""
449
427
  ],
450
428
  "flags": {
451
429
  "help": {
@@ -462,11 +440,33 @@
462
440
  "hasDynamicHelp": false,
463
441
  "multiple": false,
464
442
  "type": "option"
443
+ },
444
+ "sessionId": {
445
+ "char": "s",
446
+ "description": "The Opal ID of the session to connect to. Uses an existing session that was created via the web flow.",
447
+ "name": "sessionId",
448
+ "hasDynamicHelp": false,
449
+ "multiple": false,
450
+ "type": "option"
451
+ },
452
+ "refresh": {
453
+ "char": "r",
454
+ "description": "Starts a new session even if one already exists. Useful if a session is about to expire.",
455
+ "name": "refresh",
456
+ "allowNo": false,
457
+ "type": "boolean"
458
+ },
459
+ "profileName": {
460
+ "description": "Uses a custom AWS profile name for the IAM role. Default value is the role's name.",
461
+ "name": "profileName",
462
+ "hasDynamicHelp": false,
463
+ "multiple": false,
464
+ "type": "option"
465
465
  }
466
466
  },
467
467
  "hasDynamicHelp": false,
468
468
  "hiddenAliases": [],
469
- "id": "groups:get",
469
+ "id": "iam-roles:start",
470
470
  "pluginAlias": "opal-security",
471
471
  "pluginName": "opal-security",
472
472
  "pluginType": "core",
@@ -476,8 +476,8 @@
476
476
  "relativePath": [
477
477
  "lib",
478
478
  "commands",
479
- "groups",
480
- "get.js"
479
+ "iam-roles",
480
+ "start.js"
481
481
  ]
482
482
  },
483
483
  "kube-roles:start": {
@@ -658,6 +658,22 @@
658
658
  "hasDynamicHelp": false,
659
659
  "multiple": false,
660
660
  "type": "option"
661
+ },
662
+ "template": {
663
+ "char": "t",
664
+ "description": "A request ID of a previously finished request (cancelled/denied/approved) to create a new request based on the completed request.",
665
+ "name": "template",
666
+ "hasDynamicHelp": false,
667
+ "multiple": false,
668
+ "type": "option"
669
+ },
670
+ "bundle": {
671
+ "char": "b",
672
+ "description": "A bundle ID to create a new request based on the assets in the bundle.",
673
+ "name": "bundle",
674
+ "hasDynamicHelp": false,
675
+ "multiple": false,
676
+ "type": "option"
661
677
  }
662
678
  },
663
679
  "hasDynamicHelp": false,
@@ -679,7 +695,7 @@
679
695
  "request:get": {
680
696
  "aliases": [],
681
697
  "args": {},
682
- "description": "Lists access requests",
698
+ "description": "Fetch details of an access request by request ID",
683
699
  "examples": [
684
700
  "opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4",
685
701
  "opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4 --verbose"
@@ -1031,5 +1047,5 @@
1031
1047
  ]
1032
1048
  }
1033
1049
  },
1034
- "version": "3.2.1"
1050
+ "version": "3.2.2"
1035
1051
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opal-security",
3
3
  "description": "Opal allows you to centrally manage access to all of your sensitive systems.",
4
- "version": "3.2.1",
4
+ "version": "3.2.2",
5
5
  "author": "Stephen Cobbe",
6
6
  "bin": {
7
7
  "opal": "./bin/run"
@@ -1,54 +0,0 @@
1
- import type { NormalizedCacheObject } from "@apollo/client/core";
2
- import type { ApolloClient } from "@apollo/client/core/ApolloClient";
3
- import type { Command } from "@oclif/core/lib/command";
4
- import { type AppType, type ConnectionType, EntityType } from "../graphql/graphql";
5
- type AppNode = {
6
- appId: string;
7
- appName: string;
8
- appType?: AppType | ConnectionType;
9
- assets: Record<string, AssetNode>;
10
- };
11
- type AssetNode = {
12
- assetId: string;
13
- assetName: string;
14
- type: EntityType;
15
- roles?: Record<string, RoleNode>;
16
- };
17
- type RoleNode = {
18
- roleId: string;
19
- roleName: string;
20
- };
21
- export type RequestMap = Record<string, AppNode>;
22
- export declare const DISPLAY_LABELS: Partial<Record<EntityType, string>>;
23
- type DurationOption = {
24
- durationInMinutes: number;
25
- label: string;
26
- };
27
- type RequestDefaults = {
28
- durationOptions?: DurationOption[];
29
- recommendedDurationInMinutes?: number | null;
30
- defaultDurationInMinutes?: number;
31
- maxDurationInMinutes?: number | null;
32
- requireSupportTicket?: boolean;
33
- reasonOptional?: boolean;
34
- requesterIsAdmin?: boolean;
35
- };
36
- export type RequestMetadata = {
37
- requestMap: RequestMap;
38
- requestDefaults: RequestDefaults;
39
- durationLabel: string;
40
- durationInMinutes?: number;
41
- reason: string;
42
- };
43
- export declare function initEmptyRequestMetadata(): RequestMetadata;
44
- export declare function selectRequestableItems(cmd: Command, client: ApolloClient<NormalizedCacheObject>, requestMap: RequestMap): Promise<void>;
45
- export declare function doneSelectingAssets(): Promise<boolean>;
46
- export declare function setRequestDefaults(cmd: Command, client: ApolloClient<NormalizedCacheObject>, metadata: RequestMetadata): Promise<void>;
47
- export declare function promptForReason(metadata: RequestMetadata): Promise<void>;
48
- export declare function promptForExpiration(metadata: RequestMetadata): Promise<void>;
49
- export declare function promptRequestSubmission(cmd: Command, metadata: RequestMetadata): Promise<boolean>;
50
- export declare function submitFinalRequest(cmd: Command, client: ApolloClient<NormalizedCacheObject>, metadata: RequestMetadata): Promise<void>;
51
- export declare function getRequestLink(cmd: Command, id: string): string;
52
- export declare function bypassRequestSelection(cmd: Command, client: ApolloClient<NormalizedCacheObject>, flagValue: string[], metadata: RequestMetadata): Promise<void>;
53
- export declare function bypassDuration(cmd: Command, duration: number, metadata: RequestMetadata): void;
54
- export {};