@rockcarver/frodo-cli 0.10.4 → 0.11.1-0

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 (215) hide show
  1. package/.github/README.md +44 -104
  2. package/.github/workflows/pipeline.yml +9 -1
  3. package/CHANGELOG.md +5 -1
  4. package/README.md +3 -3
  5. package/package.json +8 -8
  6. package/src/app.js +5 -4
  7. package/src/cli/_template/cmd-delete.js +9 -8
  8. package/src/cli/_template/cmd-describe.js +9 -8
  9. package/src/cli/_template/cmd-export.js +9 -8
  10. package/src/cli/_template/cmd-import.js +9 -8
  11. package/src/cli/_template/cmd-list.js +9 -8
  12. package/src/cli/_template/cmd-sub1-delete.js +9 -8
  13. package/src/cli/_template/cmd-sub1-describe.js +9 -8
  14. package/src/cli/_template/cmd-sub1-export.js +9 -8
  15. package/src/cli/_template/cmd-sub1-import.js +9 -8
  16. package/src/cli/_template/cmd-sub1-list.js +9 -8
  17. package/src/cli/_template/cmd-sub2-delete.js +9 -8
  18. package/src/cli/_template/cmd-sub2-describe.js +9 -8
  19. package/src/cli/_template/cmd-sub2-export.js +9 -8
  20. package/src/cli/_template/cmd-sub2-import.js +9 -8
  21. package/src/cli/_template/cmd-sub2-list.js +9 -8
  22. package/src/cli/admin/admin-add-autoid-static-user-mapping.js +12 -12
  23. package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +15 -18
  24. package/src/cli/admin/admin-get-access-token.js +12 -12
  25. package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.js +13 -13
  26. package/src/cli/admin/admin-hide-generic-extension-attributes.js +13 -13
  27. package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +13 -13
  28. package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +14 -13
  29. package/src/cli/admin/admin-list-static-user-mappings.js +12 -12
  30. package/src/cli/admin/admin-remove-static-user-mapping.js +12 -12
  31. package/src/cli/admin/admin-repair-org-model.js +13 -13
  32. package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +13 -13
  33. package/src/cli/admin/admin-show-generic-extension-attributes.js +13 -13
  34. package/src/cli/app/app-delete.js +9 -8
  35. package/src/cli/app/app-describe.js +9 -8
  36. package/src/cli/app/app-export.js +15 -15
  37. package/src/cli/app/app-import.js +11 -11
  38. package/src/cli/app/app-list.js +11 -12
  39. package/src/cli/conn/conn-add.js +11 -11
  40. package/src/cli/conn/conn-delete.js +3 -1
  41. package/src/cli/conn/conn-describe.js +3 -1
  42. package/src/cli/conn/conn-list.js +3 -4
  43. package/src/cli/email/email-template-export.js +16 -16
  44. package/src/cli/email/email-template-import.js +16 -16
  45. package/src/cli/email/email-template-list.js +11 -11
  46. package/src/cli/esv/esv-apply.js +12 -12
  47. package/src/cli/esv/esv-secret-create.js +11 -11
  48. package/src/cli/esv/esv-secret-delete.js +13 -13
  49. package/src/cli/esv/esv-secret-describe.js +11 -11
  50. package/src/cli/esv/esv-secret-export.js +9 -8
  51. package/src/cli/esv/esv-secret-import.js +9 -8
  52. package/src/cli/esv/esv-secret-list.js +11 -11
  53. package/src/cli/esv/esv-secret-set.js +11 -11
  54. package/src/cli/esv/esv-secret-version-activate.js +12 -12
  55. package/src/cli/esv/esv-secret-version-create.js +11 -11
  56. package/src/cli/esv/esv-secret-version-deactivate.js +12 -12
  57. package/src/cli/esv/esv-secret-version-delete.js +13 -13
  58. package/src/cli/esv/esv-secret-version-list.js +11 -11
  59. package/src/cli/esv/esv-variable-create.js +11 -11
  60. package/src/cli/esv/esv-variable-delete.js +13 -16
  61. package/src/cli/esv/esv-variable-describe.js +11 -11
  62. package/src/cli/esv/esv-variable-export.js +9 -8
  63. package/src/cli/esv/esv-variable-import.js +9 -8
  64. package/src/cli/esv/esv-variable-list.js +11 -11
  65. package/src/cli/esv/esv-variable-set.js +13 -16
  66. package/src/cli/idm/idm-count.js +11 -11
  67. package/src/cli/idm/idm-export.js +16 -16
  68. package/src/cli/idm/idm-list.js +11 -11
  69. package/src/cli/idp/idp-export.js +15 -19
  70. package/src/cli/idp/idp-import.js +18 -18
  71. package/src/cli/idp/idp-list.js +12 -12
  72. package/src/cli/info/info.js +23 -19
  73. package/src/cli/journey/{journey-delete.e2e.test.js → journey-delete.e2e.test_.js} +0 -0
  74. package/src/cli/journey/journey-delete.js +14 -14
  75. package/src/cli/journey/journey-describe.js +26 -35
  76. package/src/cli/journey/journey-export.js +15 -18
  77. package/src/cli/journey/journey-import.js +17 -17
  78. package/src/cli/journey/{journey-list.e2e.test.js → journey-list.e2e.test_.js} +1 -0
  79. package/src/cli/journey/journey-list.js +12 -12
  80. package/src/cli/journey/journey-prune.js +12 -12
  81. package/src/cli/logging/logs-list.js +33 -28
  82. package/src/cli/logging/logs-tail.js +26 -22
  83. package/src/cli/realm/realm-add-custom-domain.js +13 -13
  84. package/src/cli/realm/realm-describe.js +14 -14
  85. package/src/cli/realm/realm-list.js +11 -11
  86. package/src/cli/realm/realm-remove-custom-domain.js +16 -13
  87. package/src/cli/saml/saml-cot-export.js +16 -16
  88. package/src/cli/saml/saml-cot-import.js +18 -18
  89. package/src/cli/saml/saml-cot-list.js +12 -12
  90. package/src/cli/saml/saml-describe.js +12 -12
  91. package/src/cli/saml/saml-export.js +16 -19
  92. package/src/cli/saml/saml-import.js +19 -18
  93. package/src/cli/saml/saml-list.js +12 -12
  94. package/src/cli/saml/saml-metadata-export.js +15 -19
  95. package/src/cli/script/script-delete.js +9 -8
  96. package/src/cli/script/script-describe.js +9 -8
  97. package/src/cli/script/script-export.js +18 -20
  98. package/src/cli/script/script-import.js +13 -12
  99. package/src/cli/script/script-list.js +12 -12
  100. package/src/cli/theme/{theme-delete.e2e.test.js → theme-delete.e2e.test_.js} +0 -0
  101. package/src/cli/theme/theme-delete.js +17 -21
  102. package/src/cli/theme/theme-export.js +19 -18
  103. package/src/cli/theme/theme-import.js +21 -20
  104. package/src/cli/theme/{theme-list.e2e.test.js → theme-list.e2e.test_.js} +0 -0
  105. package/src/cli/theme/theme-list.js +12 -12
  106. package/test/client_cli/en/conn-add.test.js +37 -0
  107. package/test/client_cli/en/conn-delete.test.js +37 -0
  108. package/test/client_cli/en/conn-list.test.js +37 -0
  109. package/test/client_cli/en/conn.test.js +65 -0
  110. package/test/client_cli/en/email-template-import.test.js +156 -0
  111. package/test/client_cli/en/email-template.test.js +79 -0
  112. package/test/client_cli/en/email-templates-export.test.js +208 -0
  113. package/test/client_cli/en/email-templates-list.test.js +139 -0
  114. package/test/client_cli/en/idm-count.test.js +131 -0
  115. package/test/client_cli/en/idm-export.test.js +149 -0
  116. package/test/client_cli/en/{idm_import.test_.js → idm-import.test_.js} +59 -61
  117. package/test/client_cli/en/idm-list.test.js +109 -0
  118. package/test/client_cli/en/idm.test.js +55 -84
  119. package/test/client_cli/en/info.test.js +85 -74
  120. package/test/client_cli/en/journey-describe.test.js +194 -0
  121. package/test/client_cli/en/journey-export.test.js +231 -0
  122. package/test/client_cli/en/journey-import.test.js +212 -0
  123. package/test/client_cli/en/journey-list.test.js +173 -0
  124. package/test/client_cli/en/{journey_prune.test.js → journey-prune.test.js} +102 -91
  125. package/test/client_cli/en/journey.test.js +76 -92
  126. package/test/client_cli/en/logs-list.test.js +81 -0
  127. package/test/client_cli/en/logs-tail.test.js +130 -0
  128. package/test/client_cli/en/logs.test.js +44 -58
  129. package/test/client_cli/en/root.test.js +61 -59
  130. package/test/client_cli/en/script-export.test.js +230 -0
  131. package/test/client_cli/en/script-import.test.js +176 -0
  132. package/test/client_cli/en/script-list.test.js +159 -0
  133. package/test/client_cli/en/script.test.js +52 -50
  134. package/test/client_cli/utils/utils.js +48 -17
  135. package/src/api/AuthenticateApi.js +0 -33
  136. package/src/api/BaseApi.js +0 -242
  137. package/src/api/CirclesOfTrustApi.js +0 -87
  138. package/src/api/EmailTemplateApi.js +0 -37
  139. package/src/api/IdmConfigApi.js +0 -88
  140. package/src/api/LogApi.js +0 -45
  141. package/src/api/ManagedObjectApi.js +0 -62
  142. package/src/api/OAuth2ClientApi.js +0 -69
  143. package/src/api/OAuth2OIDCApi.js +0 -73
  144. package/src/api/OAuth2ProviderApi.js +0 -32
  145. package/src/api/RealmApi.js +0 -99
  146. package/src/api/Saml2Api.js +0 -176
  147. package/src/api/ScriptApi.js +0 -84
  148. package/src/api/SecretsApi.js +0 -151
  149. package/src/api/ServerInfoApi.js +0 -41
  150. package/src/api/SocialIdentityProvidersApi.js +0 -114
  151. package/src/api/StartupApi.js +0 -45
  152. package/src/api/ThemeApi.js +0 -181
  153. package/src/api/TreeApi.js +0 -207
  154. package/src/api/VariablesApi.js +0 -104
  155. package/src/api/utils/ApiUtils.js +0 -77
  156. package/src/api/utils/Base64.js +0 -62
  157. package/src/ops/AdminOps.js +0 -901
  158. package/src/ops/AuthenticateOps.js +0 -342
  159. package/src/ops/CirclesOfTrustOps.js +0 -350
  160. package/src/ops/ConnectionProfileOps.js +0 -254
  161. package/src/ops/EmailTemplateOps.js +0 -326
  162. package/src/ops/IdmOps.js +0 -227
  163. package/src/ops/IdpOps.js +0 -342
  164. package/src/ops/JourneyOps.js +0 -2026
  165. package/src/ops/LogOps.js +0 -357
  166. package/src/ops/ManagedObjectOps.js +0 -34
  167. package/src/ops/OAuth2ClientOps.js +0 -151
  168. package/src/ops/OrganizationOps.js +0 -85
  169. package/src/ops/RealmOps.js +0 -139
  170. package/src/ops/SamlOps.js +0 -541
  171. package/src/ops/ScriptOps.js +0 -211
  172. package/src/ops/SecretsOps.js +0 -288
  173. package/src/ops/StartupOps.js +0 -114
  174. package/src/ops/ThemeOps.js +0 -379
  175. package/src/ops/VariablesOps.js +0 -185
  176. package/src/ops/templates/OAuth2ClientTemplate.json +0 -270
  177. package/src/ops/templates/OrgModelUserAttributesTemplate.json +0 -149
  178. package/src/ops/templates/cloud/GenericExtensionAttributesTemplate.json +0 -392
  179. package/src/ops/templates/cloud/managed.json +0 -4119
  180. package/src/ops/utils/Console.js +0 -434
  181. package/src/ops/utils/DataProtection.js +0 -92
  182. package/src/ops/utils/ExportImportUtils.js +0 -146
  183. package/src/ops/utils/OpsUtils.js +0 -76
  184. package/src/ops/utils/Wordwrap.js +0 -11
  185. package/src/storage/SessionStorage.js +0 -45
  186. package/test/client_cli/en/connections.test.js +0 -62
  187. package/test/client_cli/en/connections_add.test.js +0 -34
  188. package/test/client_cli/en/connections_delete.test.js +0 -34
  189. package/test/client_cli/en/connections_list.test.js +0 -34
  190. package/test/client_cli/en/email_templates.test.js +0 -77
  191. package/test/client_cli/en/email_templates_export.test.js +0 -196
  192. package/test/client_cli/en/email_templates_import.test.js +0 -145
  193. package/test/client_cli/en/email_templates_list.test.js +0 -130
  194. package/test/client_cli/en/idm_count.test.js +0 -121
  195. package/test/client_cli/en/idm_export.test.js +0 -136
  196. package/test/client_cli/en/idm_exportAll.test.js +0 -156
  197. package/test/client_cli/en/idm_exportAllRaw.test.js +0 -120
  198. package/test/client_cli/en/idm_importAll.test_.js +0 -103
  199. package/test/client_cli/en/idm_list.test.js +0 -103
  200. package/test/client_cli/en/journey_describe.test.js +0 -196
  201. package/test/client_cli/en/journey_export.test.js +0 -213
  202. package/test/client_cli/en/journey_import.test.js +0 -195
  203. package/test/client_cli/en/journey_importAll.test.js +0 -180
  204. package/test/client_cli/en/journey_list.test.js +0 -162
  205. package/test/client_cli/en/logs_list.test.js +0 -83
  206. package/test/client_cli/en/logs_tail.test.js +0 -118
  207. package/test/client_cli/en/script_export.test.js +0 -213
  208. package/test/client_cli/en/script_import.test.js +0 -163
  209. package/test/client_cli/en/script_list.test.js +0 -148
  210. package/test/e2e/setup.js +0 -98
  211. package/test/global/setup.js +0 -65
  212. package/test/lib_api/unit_tests/ApiUtils.test.js +0 -186
  213. package/test/lib_api/unit_tests/Base64URL.test.js +0 -22
  214. package/test/lib_api/unit_tests/DataProtection.test.js +0 -25
  215. package/test/lib_api/unit_tests/ExportImportUtils.test.js +0 -121
package/.github/README.md CHANGED
@@ -1,132 +1,63 @@
1
1
  <!-- README.md for GitHub; the one for NPM is ../README.md. -->
2
- # Frodo - ForgeROck DO
3
2
 
4
- This is the ForgeROck DO - or short frodo - command line interface, a CLI to manage ForgeRock platform deployments. Frodo supports Identity Cloud tenants, ForgeOps deployments, and classic deployments.
3
+ # Frodo CLI - @rockcarver/frodo-cli
5
4
 
6
- Frodo is the successor to field tools like [amtree.sh](https://github.com/vscheuber/AM-treetool), [fidc-debug-tools](https://github.com/vscheuber/fidc-debug-tools), and ForgeRock-internal utilities.
7
-
8
- ## Quick start
9
-
10
- 1. Download the platform specific binary archive from the [release page](https://github.com/rockcarver/frodo/releases) and unzip it to a directory.
11
- 2. Open a terminal and change to the above directory.
12
- 3. Run `frodo conn add` (example below) to setup `frodo` for your ForgeRock environment. If all parameters are correct, `frodo` creates a new [connection profile](#connection-profiles). If you are offline and don't want to validate the data you enter, you can use the --no-validate paramter and frodo stores the [connection profile](#connection-profiles) without validating it.
13
- ```console
14
- $ frodo conn add https://openam-tenant-name.forgeblocks.com/am john.doe@company.com '5uP3r-53cr3t!'
15
- ForgeRock Identity Cloud detected.
16
- Connected to ForgeRock Access Management 7.2.0-2022-6-SNAPSHOT Build ee394dde039e790642653a516d498c16759876c1 (2022-July-07 19:49)
17
- Saving creds in /Users/john.doe/.frodo/.frodorc...
18
- ```
19
- **NOTE: MacOS and Windows may not let you run `frodo` right after you download (and unzip) and execute it for the very first time. Please refer to [this page](../docs/BINARIES.md) if this happens.**
20
-
21
- 4. Test your connection profile using a simple convenience feature in frodo:
22
- ```console
23
- $ frodo info tenant-name
24
- Printing versions and tokens...
25
- ForgeRock Identity Cloud detected.
26
- Connected to ForgeRock Access Management 7.2.0-2022-6-SNAPSHOT Build ee394dde039e790642653a516d498c16759876c1 (2022-July-07 19:49)
27
- Cookie name: 6ac6499e9da2071
28
- Session token: g9CMhj7k9Asq...
29
- Bearer token: eyJ0eXAiOiJKV...
30
- ```
31
- Note how the command does not specify the complete tenant URL nor username nor password. I only uses a unique substring that matches the tenant URL and frodo looks up and uses the right [connection profile](#connection-profiles).
32
-
33
- 5. Now you can use other frodo commands, like `journey`, `logs`, `applications` etc. as desired. **For detailed usage, refer to [this](#usage)**
5
+ ForgeROck DO Command Line Interface, frodo-cli, a CLI to manage ForgeRock platform deployments supporting Identity Cloud tenants, ForgeOps deployments, and classic deployments.
34
6
 
35
7
  ## Quick Nav
36
8
 
37
- - [Features](#features)
38
- - [Limitations](#limitations)
9
+ - [Quick start](#quick-start)
39
10
  - [Installing](#installing)
40
11
  - [Usage](#usage)
41
12
  - [Request features or report issues](#feature-requests)
42
13
  - [Contributing](#contributing)
43
14
  - [Maintaining](#maintaining)
44
15
 
45
- ## Features
46
-
47
- Frodo allows an administrator to easily connect to and manage any number of Identity Cloud tenants, ForgeOps deployment instances, or classic deployment instances from the command line. The following tasks are currently supported:
48
-
49
- - User mode
50
-
51
- Install and run pre-compiled single binaries without any dependencies for MacOS, Windows, and Linux.
52
-
53
- - Manage journeys/trees.
54
-
55
- Export, import and pruning of journeys. Frodo handles referenced scripts and email templates.
56
-
57
- - Manage applications.
58
-
59
- List, export, and import applications (OAuth2 clients).
60
-
61
- - Manage connection profiles.
62
-
63
- Saving and reading credentials (for multiple ForgeRock deployments) from a configuration file.
64
-
65
- - Manage email templates.
66
-
67
- List, export, and import email templates.
68
-
69
- - Manage IDM configuration.
70
-
71
- Export of IDM configuration. Import is coming.
72
-
73
- - Print versions and tokens.
74
-
75
- Obtain ForgeRock session token and admin access_tokens for a ForgeRock Identity Cloud or platform (ForgeOps) deployment
76
-
77
- - View Identity Cloud logs.
78
-
79
- List available log sources and tail them.
80
-
81
- - Manage realms.
82
-
83
- List realms and show realm details. Allow adding and removing of custom DNS names.
84
-
85
- - Manage scripts.
86
-
87
- List, export, and import scripts.
88
-
89
- - Manage Identity Cloud environment specific variables and secrets.
90
-
91
- List and view details of secrets and variables in Identity Cloud.
16
+ ## Quick start
92
17
 
93
- - Platform admin tasks.
18
+ 1. Download the platform specific binary archive from the [release page](https://github.com/rockcarver/frodo-cli/releases) and unzip it to a directory.
19
+ 2. Open a terminal and change to the above directory.
20
+ 3. Run `frodo conn add` (example below) to setup `frodo` for your ForgeRock environment. If all parameters are correct, `frodo` creates a new [connection profile](#connection-profiles). If you are offline and don't want to validate the data you enter, you can use the --no-validate paramter and frodo stores the [connection profile](#connection-profiles) without validating it.
94
21
 
95
- Common tasks administrators need to perform daily that are tedious and repetitive. Advanced tasks, which used to be involved and potentially dangerous if performed manually, now made easy and safe.
22
+ ```console
23
+ $ frodo conn add https://openam-tenant-name.forgeblocks.com/am john.doe@company.com '5uP3r-53cr3t!'
24
+ ForgeRock Identity Cloud detected.
25
+ Connected to ForgeRock Access Management 7.2.0-2022-6-SNAPSHOT Build ee394dde039e790642653a516d498c16759876c1 (2022-July-07 19:49)
26
+ Saving creds in /Users/john.doe/.frodo/.frodorc...
27
+ ```
96
28
 
97
- - Create an oauth2 client with admin privileges.
98
- - Get an access token using client credentials grant type.
99
- - List oauth2 clients with admin privileges.
100
- - Grant an oauth2 client admin privileges.
101
- - Revoke admin privileges from an oauth2 client.
102
- - List oauth2 clients with custom privileges.
103
- - List all subjects of static user mappings that are not oauth2 clients.
104
- - Remove a subject's static user mapping.
105
- - Add AutoId static user mapping to enable dashboards and other AutoId-based functionality.
106
- - Hide generic extension attributes.
107
- - Show generic extension attributes.
108
- - Repair org model (beta).
29
+ **NOTE: MacOS and Windows may not let you run `frodo` right after you download (and unzip) and execute it for the very first time. Please refer to [this page](../docs/BINARIES.md) if this happens.**
109
30
 
110
- - Developer mode
31
+ 4. Test your connection profile using a simple convenience feature in frodo:
111
32
 
112
- Install and run in developer mode (npm i -g)
33
+ ```console
34
+ $ frodo info tenant-name
35
+ Printing versions and tokens...
36
+ ForgeRock Identity Cloud detected.
37
+ Connected to ForgeRock Access Management 7.2.0-2022-6-SNAPSHOT Build ee394dde039e790642653a516d498c16759876c1 (2022-July-07 19:49)
38
+ Cookie name: 6ac6499e9da2071
39
+ Session token: g9CMhj7k9Asq...
40
+ Bearer token: eyJ0eXAiOiJKV...
41
+ ```
113
42
 
114
- ## Limitations
43
+ Note how the command does not specify the complete tenant URL nor username nor password. I only uses a unique substring that matches the tenant URL and frodo looks up and uses the right [connection profile](#connection-profiles).
115
44
 
116
- `frodo` can't export passwords (including API secrets, etc), so these need to be manually added back to imported configuration or alternatively, edit the export file to add the missing fields before importing.
45
+ 5. Now you can use other frodo commands, like `journey`, `logs`, `applications` etc. as desired. **For detailed usage, refer to [this](#usage)**
117
46
 
118
47
  ## Installing
119
48
 
120
49
  ### User Mode
50
+
121
51
  Individuals who do not intend to develop or contribute to frodo should use this method. Please refer to [Quick Start](#quick-start)
122
52
 
123
53
  ### Developer Mode
54
+
124
55
  For those who want to contribute or are just curious about the build process.
125
56
 
126
- - Make sure you have Node.js v18 (the version used by developers) or newer and npm.
57
+ - Make sure you have Node.js v14 or newer installed.
127
58
  - Clone this repo
128
59
  ```console
129
- git clone https://github.com/rockcarver/frodo.git
60
+ git clone https://github.com/rockcarver/frodo-cli.git
130
61
  ```
131
62
  - Install via NPM
132
63
  ```console
@@ -136,6 +67,7 @@ For those who want to contribute or are just curious about the build process.
136
67
  ```
137
68
 
138
69
  ### NPM package
70
+
139
71
  If you are a node developer and want to use frodo as a cli tool or as a library for your own applications, you can install the npm package:
140
72
 
141
73
  - To install the latest version as a cli tool:
@@ -158,25 +90,30 @@ You can invoke `frodo` from the terminal as long as you're in the directory or s
158
90
  To get started, refer to [Quick Start](#quick-start).
159
91
 
160
92
  ### Connection Profiles
93
+
161
94
  A connection profile is a set of ForgeRock environment URL (Access Management base URL), admin username and admin password. It can optionally contain log API key and secret for a ForgeRock Identity Cloud environment. All connection profiless are stored in `~/.frodo/.frodorc`. Passwords are stored encrypted. `.frodorc` can house information for multiple connections.
162
95
 
163
96
  Use the `frodo conn` sub-commands to manage connections:
164
- - `frodo conn list` to list all the connections frodo currently knows about for the current machine and user.
165
- - `frodo conn add` to add a new connection profile.
166
- - `frodo conn describe` to see all the details of a connection profile.
167
- - `frodo conn delete` to remove a connection profile.
97
+
98
+ - `frodo conn list` to list all the connections frodo currently knows about for the current machine and user.
99
+ - `frodo conn add` to add a new connection profile.
100
+ - `frodo conn describe` to see all the details of a connection profile.
101
+ - `frodo conn delete` to remove a connection profile.
168
102
 
169
103
  Once `frodo` saves a connection, you don't have to provide the `host`, `username`, and `password` arguments. You can reference your connection using any unique substring from your host. This is the most common way users would run frodo. For example, if `https://openam-example-use1-dev.id.forgerock.io/am` and `https://openam-example-use1-staging.id.forgerock.io/am` are two saved ForgeRock connections from previous commands, one would simply use:
170
104
 
171
105
  ```console
172
106
  frodo info example-use1-dev
173
107
  ```
108
+
174
109
  OR
110
+
175
111
  ```console
176
112
  frodo info example-use1-staging
177
113
  ```
178
114
 
179
115
  ### cli options
116
+
180
117
  You interact with `frodo` using commands and options. You can see the list of options by using the `help` command
181
118
 
182
119
  ```console
@@ -264,10 +201,13 @@ Options:
264
201
  ```
265
202
 
266
203
  ## Feature requests
204
+
267
205
  Please use the repository's [issues](https://github.com/rockcarver/frodo/issues) to request new features/enhancements or report bugs/issues.
268
206
 
269
207
  ## Contributing
208
+
270
209
  If you would like to contribute to frodo, please refer to the [contributing instructions](../docs/CONTRIBUTE.md).
271
210
 
272
211
  ## Maintaining
273
- If you are a maintainer of this repository, please refer to the [pipeline and release process instructions](../docs/PIPELINE.md).
212
+
213
+ If you are a maintainer of this repository, please refer to the [pipeline and release process instructions](../docs/PIPELINE.md).
@@ -1,4 +1,4 @@
1
- name: 'Frodo Release Pipeline'
1
+ name: 'Frodo CLI Release Pipeline'
2
2
 
3
3
  on:
4
4
  push:
@@ -47,6 +47,14 @@ jobs:
47
47
  #
48
48
  # Run tests.
49
49
  #
50
+ - name: Lint & Fix
51
+ run: |
52
+ npm run lint -- --fix
53
+
54
+ - name: CLI Help Test
55
+ run: |
56
+ npm test
57
+
50
58
  - name: Version Test
51
59
  run: |
52
60
  frodo -v
package/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.11.1-0] - 2022-08-19
11
+
10
12
  ## [0.10.4] - 2022-08-13
11
13
 
12
14
  ### Added
@@ -402,7 +404,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
402
404
  - Fixed problem with adding connection profiles
403
405
  - Miscellaneous bug fixes
404
406
 
405
- [Unreleased]: https://github.com/rockcarver/frodo/compare/v0.10.4...HEAD
407
+ [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.11.1-0...HEAD
408
+
409
+ [0.11.1-0]: https://github.com/rockcarver/frodo-cli/compare/v0.10.4...v0.11.1-0
406
410
 
407
411
  [0.10.4]: https://github.com/rockcarver/frodo/compare/v0.10.3...v0.10.4
408
412
 
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  <!-- README.md for NPM; the one for GitHub is .github/README.md. -->
2
- # Frodo - ForgeROck DO
2
+ # Frodo Command Line Interface
3
3
 
4
- This is the ForgeROck DO - or short frodo - command line interface, a CLI to manage ForgeRock platform deployments. Frodo supports Identity Cloud tenants, ForgeOps deployments, and classic deployments.
4
+ ForgeROck DO Command Line Interface, frodo-cli, a CLI to manage ForgeRock platform deployments supporting Identity Cloud tenants, ForgeOps deployments, and classic deployments.
5
5
 
6
6
  Frodo is the successor to field tools like [amtree.sh](https://github.com/vscheuber/AM-treetool), [fidc-debug-tools](https://github.com/vscheuber/fidc-debug-tools), and ForgeRock-internal utilities.
7
7
 
8
- Please refer to the [GitHub README](https://github.com/rockcarver/frodo#readme) for full documentation.
8
+ Please refer to the [GitHub README](https://github.com/rockcarver/frodo-cli#readme) for full documentation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rockcarver/frodo-cli",
3
- "version": "0.10.4",
3
+ "version": "0.11.1-0",
4
4
  "type": "module",
5
5
  "description": "This is the ForgeROck DO (FRODO) command line interface, a CLI to manage the ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
6
6
  "keywords": [
@@ -20,20 +20,18 @@
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",
23
- "url": "https://github.com/rockcarver/frodo.git"
23
+ "url": "https://github.com/rockcarver/frodo-cli.git"
24
24
  },
25
25
  "bugs": {
26
- "url": "https://github.com/rockcarver/frodo/issues"
26
+ "url": "https://github.com/rockcarver/frodo-cli/issues"
27
27
  },
28
28
  "main": "src/app.js",
29
29
  "scripts": {
30
30
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
31
31
  "test:list": "node --experimental-vm-modules node_modules/jest/bin/jest.js --listTests",
32
32
  "test:e2e": "node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand e2e",
33
- "test:e2e:list": "node --experimental-vm-modules node_modules/jest/bin/jest.js --listTests e2e"
34
- },
35
- "jest": {
36
- "globalSetup": "<rootDir>/test/global/setup.js"
33
+ "test:e2e:list": "node --experimental-vm-modules node_modules/jest/bin/jest.js --listTests e2e",
34
+ "lint": "eslint --ext .js --ignore-path .gitignore ."
37
35
  },
38
36
  "contributors": [
39
37
  {
@@ -81,6 +79,7 @@
81
79
  },
82
80
  "dependencies": {
83
81
  "@colors/colors": "^1.5.0",
82
+ "@rockcarver/frodo-lib": "^0.11.1-3",
84
83
  "axios": "^0.27.2",
85
84
  "axios-retry": "^3.3.1",
86
85
  "cli-progress": "^3.11.2",
@@ -119,6 +118,7 @@
119
118
  "gulp-sourcemaps": "^3.0.0",
120
119
  "jest": "^28.1.3",
121
120
  "map-stream": "^0.0.7",
122
- "pkg": "^5.8.0"
121
+ "pkg": "^5.8.0",
122
+ "prettier": "^2.7.1"
123
123
  }
124
124
  }
package/src/app.js CHANGED
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env -S node --no-warnings --enable-source-maps
2
2
 
3
+ import { ConnectionProfile } from '@rockcarver/frodo-lib';
3
4
  import fs from 'fs';
4
5
  import { Command } from 'commander';
5
- import { initConnectionProfiles } from './ops/ConnectionProfileOps.js';
6
6
  // import pkg from '../package.json' assert { type: 'json' };
7
- import { printMessage } from './ops/utils/Console.js';
8
7
 
9
8
  // commands
10
9
  import admin from './cli/admin/admin.js';
@@ -26,7 +25,9 @@ const pkg = JSON.parse(
26
25
  fs.readFileSync(new URL('../package.json', import.meta.url))
27
26
  );
28
27
 
29
- const program = new Command(pkg.name).version(
28
+ const { initConnectionProfiles } = ConnectionProfile;
29
+
30
+ const program = new Command('frodo').version(
30
31
  `v${pkg.version} [${process.version}]`,
31
32
  '-v, --version'
32
33
  );
@@ -54,6 +55,6 @@ const program = new Command(pkg.name).version(
54
55
  program.enablePositionalOptions();
55
56
  program.parse();
56
57
  } catch (e) {
57
- printMessage(`ERROR: exception running frodo - ${e}`, 'error');
58
+ console.log(`ERROR: exception running frodo - ${e}`, 'error');
58
59
  }
59
60
  })();
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd delete');
7
8
 
@@ -39,12 +40,12 @@ program
39
40
  .action(
40
41
  // implement command logic inside action handler
41
42
  async (host, realm, user, password, options) => {
42
- storage.session.setTenant(host);
43
- storage.session.setRealm(realm);
44
- storage.session.setUsername(user);
45
- storage.session.setPassword(password);
46
- storage.session.setDeploymentType(options.type);
47
- storage.session.setAllowInsecureConnection(options.insecure);
43
+ state.default.session.setTenant(host);
44
+ state.default.session.setRealm(realm);
45
+ state.default.session.setUsername(user);
46
+ state.default.session.setPassword(password);
47
+ state.default.session.setDeploymentType(options.type);
48
+ state.default.session.setAllowInsecureConnection(options.insecure);
48
49
  if (await getTokens()) {
49
50
  // code goes here
50
51
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd describe');
7
8
 
@@ -19,12 +20,12 @@ program
19
20
  .action(
20
21
  // implement command logic inside action handler
21
22
  async (host, realm, user, password, options) => {
22
- storage.session.setTenant(host);
23
- storage.session.setRealm(realm);
24
- storage.session.setUsername(user);
25
- storage.session.setPassword(password);
26
- storage.session.setDeploymentType(options.type);
27
- storage.session.setAllowInsecureConnection(options.insecure);
23
+ state.default.session.setTenant(host);
24
+ state.default.session.setRealm(realm);
25
+ state.default.session.setUsername(user);
26
+ state.default.session.setPassword(password);
27
+ state.default.session.setDeploymentType(options.type);
28
+ state.default.session.setAllowInsecureConnection(options.insecure);
28
29
  if (await getTokens()) {
29
30
  // code goes here
30
31
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd export');
7
8
 
@@ -37,12 +38,12 @@ program
37
38
  .action(
38
39
  // implement command logic inside action handler
39
40
  async (host, realm, user, password, options) => {
40
- storage.session.setTenant(host);
41
- storage.session.setRealm(realm);
42
- storage.session.setUsername(user);
43
- storage.session.setPassword(password);
44
- storage.session.setDeploymentType(options.type);
45
- storage.session.setAllowInsecureConnection(options.insecure);
41
+ state.default.session.setTenant(host);
42
+ state.default.session.setRealm(realm);
43
+ state.default.session.setUsername(user);
44
+ state.default.session.setPassword(password);
45
+ state.default.session.setDeploymentType(options.type);
46
+ state.default.session.setAllowInsecureConnection(options.insecure);
46
47
  if (await getTokens()) {
47
48
  // code goes here
48
49
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd import');
7
8
 
@@ -37,12 +38,12 @@ program
37
38
  .action(
38
39
  // implement command logic inside action handler
39
40
  async (host, realm, user, password, options) => {
40
- storage.session.setTenant(host);
41
- storage.session.setRealm(realm);
42
- storage.session.setUsername(user);
43
- storage.session.setPassword(password);
44
- storage.session.setDeploymentType(options.type);
45
- storage.session.setAllowInsecureConnection(options.insecure);
41
+ state.default.session.setTenant(host);
42
+ state.default.session.setRealm(realm);
43
+ state.default.session.setUsername(user);
44
+ state.default.session.setPassword(password);
45
+ state.default.session.setDeploymentType(options.type);
46
+ state.default.session.setAllowInsecureConnection(options.insecure);
46
47
  if (await getTokens()) {
47
48
  // code goes here
48
49
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd list');
7
8
 
@@ -21,12 +22,12 @@ program
21
22
  .action(
22
23
  // implement command logic inside action handler
23
24
  async (host, realm, user, password, options) => {
24
- storage.session.setTenant(host);
25
- storage.session.setRealm(realm);
26
- storage.session.setUsername(user);
27
- storage.session.setPassword(password);
28
- storage.session.setDeploymentType(options.type);
29
- storage.session.setAllowInsecureConnection(options.insecure);
25
+ state.default.session.setTenant(host);
26
+ state.default.session.setRealm(realm);
27
+ state.default.session.setUsername(user);
28
+ state.default.session.setPassword(password);
29
+ state.default.session.setDeploymentType(options.type);
30
+ state.default.session.setAllowInsecureConnection(options.insecure);
30
31
  if (await getTokens()) {
31
32
  // code goes here
32
33
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub1 delete');
7
8
 
@@ -39,12 +40,12 @@ program
39
40
  .action(
40
41
  // implement command logic inside action handler
41
42
  async (host, realm, user, password, options) => {
42
- storage.session.setTenant(host);
43
- storage.session.setRealm(realm);
44
- storage.session.setUsername(user);
45
- storage.session.setPassword(password);
46
- storage.session.setDeploymentType(options.type);
47
- storage.session.setAllowInsecureConnection(options.insecure);
43
+ state.default.session.setTenant(host);
44
+ state.default.session.setRealm(realm);
45
+ state.default.session.setUsername(user);
46
+ state.default.session.setPassword(password);
47
+ state.default.session.setDeploymentType(options.type);
48
+ state.default.session.setAllowInsecureConnection(options.insecure);
48
49
  if (await getTokens()) {
49
50
  // code goes here
50
51
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub1 describe');
7
8
 
@@ -19,12 +20,12 @@ program
19
20
  .action(
20
21
  // implement command logic inside action handler
21
22
  async (host, realm, user, password, options) => {
22
- storage.session.setTenant(host);
23
- storage.session.setRealm(realm);
24
- storage.session.setUsername(user);
25
- storage.session.setPassword(password);
26
- storage.session.setDeploymentType(options.type);
27
- storage.session.setAllowInsecureConnection(options.insecure);
23
+ state.default.session.setTenant(host);
24
+ state.default.session.setRealm(realm);
25
+ state.default.session.setUsername(user);
26
+ state.default.session.setPassword(password);
27
+ state.default.session.setDeploymentType(options.type);
28
+ state.default.session.setAllowInsecureConnection(options.insecure);
28
29
  if (await getTokens()) {
29
30
  // code goes here
30
31
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub1 export');
7
8
 
@@ -37,12 +38,12 @@ program
37
38
  .action(
38
39
  // implement command logic inside action handler
39
40
  async (host, realm, user, password, options) => {
40
- storage.session.setTenant(host);
41
- storage.session.setRealm(realm);
42
- storage.session.setUsername(user);
43
- storage.session.setPassword(password);
44
- storage.session.setDeploymentType(options.type);
45
- storage.session.setAllowInsecureConnection(options.insecure);
41
+ state.default.session.setTenant(host);
42
+ state.default.session.setRealm(realm);
43
+ state.default.session.setUsername(user);
44
+ state.default.session.setPassword(password);
45
+ state.default.session.setDeploymentType(options.type);
46
+ state.default.session.setAllowInsecureConnection(options.insecure);
46
47
  if (await getTokens()) {
47
48
  // code goes here
48
49
  }
@@ -1,7 +1,8 @@
1
1
  import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
2
3
  import * as common from '../cmd_common.js';
3
- import { getTokens } from '../../ops/AuthenticateOps.js';
4
- import storage from '../../storage/SessionStorage.js';
4
+
5
+ const { getTokens } = Authenticate;
5
6
 
6
7
  const program = new Command('frodo cmd sub1 import');
7
8
 
@@ -37,12 +38,12 @@ program
37
38
  .action(
38
39
  // implement command logic inside action handler
39
40
  async (host, realm, user, password, options) => {
40
- storage.session.setTenant(host);
41
- storage.session.setRealm(realm);
42
- storage.session.setUsername(user);
43
- storage.session.setPassword(password);
44
- storage.session.setDeploymentType(options.type);
45
- storage.session.setAllowInsecureConnection(options.insecure);
41
+ state.default.session.setTenant(host);
42
+ state.default.session.setRealm(realm);
43
+ state.default.session.setUsername(user);
44
+ state.default.session.setPassword(password);
45
+ state.default.session.setDeploymentType(options.type);
46
+ state.default.session.setAllowInsecureConnection(options.insecure);
46
47
  if (await getTokens()) {
47
48
  // code goes here
48
49
  }