@rockcarver/frodo-cli 0.10.4 → 0.11.1-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 (247) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/README.md +3 -3
  3. package/package.json +17 -15
  4. package/src/app.js +7 -6
  5. package/src/cli/_template/cmd-delete.js +9 -8
  6. package/src/cli/_template/cmd-describe.js +9 -8
  7. package/src/cli/_template/cmd-export.js +9 -8
  8. package/src/cli/_template/cmd-import.js +9 -8
  9. package/src/cli/_template/cmd-list.js +9 -8
  10. package/src/cli/_template/cmd-sub1-delete.js +9 -8
  11. package/src/cli/_template/cmd-sub1-describe.js +9 -8
  12. package/src/cli/_template/cmd-sub1-export.js +9 -8
  13. package/src/cli/_template/cmd-sub1-import.js +9 -8
  14. package/src/cli/_template/cmd-sub1-list.js +9 -8
  15. package/src/cli/_template/cmd-sub2-delete.js +9 -8
  16. package/src/cli/_template/cmd-sub2-describe.js +9 -8
  17. package/src/cli/_template/cmd-sub2-export.js +9 -8
  18. package/src/cli/_template/cmd-sub2-import.js +9 -8
  19. package/src/cli/_template/cmd-sub2-list.js +9 -8
  20. package/src/cli/admin/admin-add-autoid-static-user-mapping.js +12 -12
  21. package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +15 -18
  22. package/src/cli/admin/admin-get-access-token.js +12 -12
  23. package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.js +13 -13
  24. package/src/cli/admin/admin-hide-generic-extension-attributes.js +13 -13
  25. package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +13 -13
  26. package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +14 -13
  27. package/src/cli/admin/admin-list-static-user-mappings.js +12 -12
  28. package/src/cli/admin/admin-remove-static-user-mapping.js +12 -12
  29. package/src/cli/admin/admin-repair-org-model.js +13 -13
  30. package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +13 -13
  31. package/src/cli/admin/admin-show-generic-extension-attributes.js +13 -13
  32. package/src/cli/app/app-delete.js +9 -8
  33. package/src/cli/app/app-describe.js +9 -8
  34. package/src/cli/app/app-export.js +15 -15
  35. package/src/cli/app/app-import.js +11 -11
  36. package/src/cli/app/app-list.js +11 -12
  37. package/src/cli/conn/conn-add.js +11 -11
  38. package/src/cli/conn/conn-delete.js +3 -1
  39. package/src/cli/conn/conn-describe.js +3 -1
  40. package/src/cli/conn/conn-list.js +3 -4
  41. package/src/cli/email/email-template-export.js +16 -16
  42. package/src/cli/email/email-template-import.js +16 -16
  43. package/src/cli/email/email-template-list.js +11 -11
  44. package/src/cli/esv/esv-apply.js +12 -12
  45. package/src/cli/esv/esv-secret-create.js +11 -11
  46. package/src/cli/esv/esv-secret-delete.js +13 -13
  47. package/src/cli/esv/esv-secret-describe.js +11 -11
  48. package/src/cli/esv/esv-secret-export.js +9 -8
  49. package/src/cli/esv/esv-secret-import.js +9 -8
  50. package/src/cli/esv/esv-secret-list.js +11 -11
  51. package/src/cli/esv/esv-secret-set.js +11 -11
  52. package/src/cli/esv/esv-secret-version-activate.js +12 -12
  53. package/src/cli/esv/esv-secret-version-create.js +11 -11
  54. package/src/cli/esv/esv-secret-version-deactivate.js +12 -12
  55. package/src/cli/esv/esv-secret-version-delete.js +13 -13
  56. package/src/cli/esv/esv-secret-version-list.js +11 -11
  57. package/src/cli/esv/esv-variable-create.js +11 -11
  58. package/src/cli/esv/esv-variable-delete.js +13 -16
  59. package/src/cli/esv/esv-variable-describe.js +11 -11
  60. package/src/cli/esv/esv-variable-export.js +9 -8
  61. package/src/cli/esv/esv-variable-import.js +9 -8
  62. package/src/cli/esv/esv-variable-list.js +11 -11
  63. package/src/cli/esv/esv-variable-set.js +13 -16
  64. package/src/cli/idm/idm-count.js +11 -11
  65. package/src/cli/idm/idm-export.js +16 -16
  66. package/src/cli/idm/idm-list.js +11 -11
  67. package/src/cli/idp/idp-export.js +15 -19
  68. package/src/cli/idp/idp-import.js +18 -18
  69. package/src/cli/idp/idp-list.js +12 -12
  70. package/src/cli/info/info.js +23 -19
  71. package/src/cli/journey/journey-delete.js +14 -14
  72. package/src/cli/journey/journey-describe.js +26 -35
  73. package/src/cli/journey/journey-export.js +18 -21
  74. package/src/cli/journey/journey-import.js +17 -17
  75. package/src/cli/journey/journey-list.js +12 -12
  76. package/src/cli/journey/journey-prune.js +12 -12
  77. package/src/cli/logging/logs-list.js +33 -28
  78. package/src/cli/logging/logs-tail.js +26 -22
  79. package/src/cli/realm/realm-add-custom-domain.js +13 -13
  80. package/src/cli/realm/realm-describe.js +14 -14
  81. package/src/cli/realm/realm-list.js +11 -11
  82. package/src/cli/realm/realm-remove-custom-domain.js +16 -13
  83. package/src/cli/saml/saml-cot-export.js +16 -16
  84. package/src/cli/saml/saml-cot-import.js +18 -18
  85. package/src/cli/saml/saml-cot-list.js +12 -12
  86. package/src/cli/saml/saml-describe.js +12 -12
  87. package/src/cli/saml/saml-export.js +16 -19
  88. package/src/cli/saml/saml-import.js +19 -18
  89. package/src/cli/saml/saml-list.js +12 -12
  90. package/src/cli/saml/saml-metadata-export.js +15 -19
  91. package/src/cli/script/script-delete.js +9 -8
  92. package/src/cli/script/script-describe.js +9 -8
  93. package/src/cli/script/script-export.js +18 -20
  94. package/src/cli/script/script-import.js +13 -12
  95. package/src/cli/script/script-list.js +12 -12
  96. package/src/cli/theme/theme-delete.js +17 -21
  97. package/src/cli/theme/theme-export.js +19 -18
  98. package/src/cli/theme/theme-import.js +21 -20
  99. package/src/cli/theme/theme-list.js +12 -12
  100. package/.eslintrc +0 -29
  101. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
  102. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  103. package/.github/README.md +0 -273
  104. package/.github/workflows/pipeline.yml +0 -487
  105. package/.prettierrc +0 -6
  106. package/CODE_OF_CONDUCT.md +0 -128
  107. package/docs/BINARIES.md +0 -22
  108. package/docs/CONTRIBUTE.md +0 -96
  109. package/docs/PIPELINE.md +0 -169
  110. package/docs/images/macos_warn1.png +0 -0
  111. package/docs/images/macos_warn2.png +0 -0
  112. package/docs/images/macos_warn3.png +0 -0
  113. package/docs/images/npm_versioning_guidelines.png +0 -0
  114. package/docs/images/release_pipeline.png +0 -0
  115. package/gulpfile.js +0 -49
  116. package/jsconfig.json +0 -6
  117. package/resources/sampleEntitiesFile.json +0 -8
  118. package/resources/sampleEnvFile.env +0 -2
  119. package/src/api/AuthenticateApi.js +0 -33
  120. package/src/api/BaseApi.js +0 -242
  121. package/src/api/CirclesOfTrustApi.js +0 -87
  122. package/src/api/EmailTemplateApi.js +0 -37
  123. package/src/api/IdmConfigApi.js +0 -88
  124. package/src/api/LogApi.js +0 -45
  125. package/src/api/ManagedObjectApi.js +0 -62
  126. package/src/api/OAuth2ClientApi.js +0 -69
  127. package/src/api/OAuth2OIDCApi.js +0 -73
  128. package/src/api/OAuth2ProviderApi.js +0 -32
  129. package/src/api/RealmApi.js +0 -99
  130. package/src/api/Saml2Api.js +0 -176
  131. package/src/api/ScriptApi.js +0 -84
  132. package/src/api/SecretsApi.js +0 -151
  133. package/src/api/ServerInfoApi.js +0 -41
  134. package/src/api/SocialIdentityProvidersApi.js +0 -114
  135. package/src/api/StartupApi.js +0 -45
  136. package/src/api/ThemeApi.js +0 -181
  137. package/src/api/TreeApi.js +0 -207
  138. package/src/api/VariablesApi.js +0 -104
  139. package/src/api/utils/ApiUtils.js +0 -77
  140. package/src/api/utils/Base64.js +0 -62
  141. package/src/cli/journey/journey-delete.e2e.test.js +0 -380
  142. package/src/cli/journey/journey-list.e2e.test.js +0 -141
  143. package/src/cli/theme/theme-delete.e2e.test.js +0 -178
  144. package/src/cli/theme/theme-list.e2e.test.js +0 -119
  145. package/src/ops/AdminOps.js +0 -901
  146. package/src/ops/AuthenticateOps.js +0 -342
  147. package/src/ops/CirclesOfTrustOps.js +0 -350
  148. package/src/ops/ConnectionProfileOps.js +0 -254
  149. package/src/ops/EmailTemplateOps.js +0 -326
  150. package/src/ops/IdmOps.js +0 -227
  151. package/src/ops/IdpOps.js +0 -342
  152. package/src/ops/JourneyOps.js +0 -2026
  153. package/src/ops/LogOps.js +0 -357
  154. package/src/ops/ManagedObjectOps.js +0 -34
  155. package/src/ops/OAuth2ClientOps.js +0 -151
  156. package/src/ops/OrganizationOps.js +0 -85
  157. package/src/ops/RealmOps.js +0 -139
  158. package/src/ops/SamlOps.js +0 -541
  159. package/src/ops/ScriptOps.js +0 -211
  160. package/src/ops/SecretsOps.js +0 -288
  161. package/src/ops/StartupOps.js +0 -114
  162. package/src/ops/ThemeOps.js +0 -379
  163. package/src/ops/VariablesOps.js +0 -185
  164. package/src/ops/templates/OAuth2ClientTemplate.json +0 -270
  165. package/src/ops/templates/OrgModelUserAttributesTemplate.json +0 -149
  166. package/src/ops/templates/cloud/GenericExtensionAttributesTemplate.json +0 -392
  167. package/src/ops/templates/cloud/managed.json +0 -4119
  168. package/src/ops/utils/Console.js +0 -434
  169. package/src/ops/utils/DataProtection.js +0 -92
  170. package/src/ops/utils/ExportImportUtils.js +0 -146
  171. package/src/ops/utils/OpsUtils.js +0 -76
  172. package/src/ops/utils/Wordwrap.js +0 -11
  173. package/src/storage/SessionStorage.js +0 -45
  174. package/test/client_cli/en/connections.test.js +0 -62
  175. package/test/client_cli/en/connections_add.test.js +0 -34
  176. package/test/client_cli/en/connections_delete.test.js +0 -34
  177. package/test/client_cli/en/connections_list.test.js +0 -34
  178. package/test/client_cli/en/email_templates.test.js +0 -77
  179. package/test/client_cli/en/email_templates_export.test.js +0 -196
  180. package/test/client_cli/en/email_templates_import.test.js +0 -145
  181. package/test/client_cli/en/email_templates_list.test.js +0 -130
  182. package/test/client_cli/en/idm.test.js +0 -111
  183. package/test/client_cli/en/idm_count.test.js +0 -121
  184. package/test/client_cli/en/idm_export.test.js +0 -136
  185. package/test/client_cli/en/idm_exportAll.test.js +0 -156
  186. package/test/client_cli/en/idm_exportAllRaw.test.js +0 -120
  187. package/test/client_cli/en/idm_import.test_.js +0 -103
  188. package/test/client_cli/en/idm_importAll.test_.js +0 -103
  189. package/test/client_cli/en/idm_list.test.js +0 -103
  190. package/test/client_cli/en/info.test.js +0 -125
  191. package/test/client_cli/en/journey.test.js +0 -127
  192. package/test/client_cli/en/journey_describe.test.js +0 -196
  193. package/test/client_cli/en/journey_export.test.js +0 -213
  194. package/test/client_cli/en/journey_import.test.js +0 -195
  195. package/test/client_cli/en/journey_importAll.test.js +0 -180
  196. package/test/client_cli/en/journey_list.test.js +0 -162
  197. package/test/client_cli/en/journey_prune.test.js +0 -148
  198. package/test/client_cli/en/logs.test.js +0 -79
  199. package/test/client_cli/en/logs_list.test.js +0 -83
  200. package/test/client_cli/en/logs_tail.test.js +0 -118
  201. package/test/client_cli/en/root.test.js +0 -91
  202. package/test/client_cli/en/script.test.js +0 -77
  203. package/test/client_cli/en/script_export.test.js +0 -213
  204. package/test/client_cli/en/script_import.test.js +0 -163
  205. package/test/client_cli/en/script_list.test.js +0 -148
  206. package/test/client_cli/utils/utils.js +0 -32
  207. package/test/e2e/journey/baseline/ForgottenUsername.journey.json +0 -216
  208. package/test/e2e/journey/baseline/Login.journey.json +0 -205
  209. package/test/e2e/journey/baseline/PasswordGrant.journey.json +0 -139
  210. package/test/e2e/journey/baseline/ProgressiveProfile.journey.json +0 -198
  211. package/test/e2e/journey/baseline/Registration.journey.json +0 -249
  212. package/test/e2e/journey/baseline/ResetPassword.journey.json +0 -268
  213. package/test/e2e/journey/baseline/UpdatePassword.journey.json +0 -323
  214. package/test/e2e/journey/baseline/allAlphaJourneys.journeys.json +0 -1520
  215. package/test/e2e/journey/delete/ForgottenUsername.journey.json +0 -216
  216. package/test/e2e/journey/delete/Login.journey.json +0 -205
  217. package/test/e2e/journey/delete/PasswordGrant.journey.json +0 -139
  218. package/test/e2e/journey/delete/ProgressiveProfile.journey.json +0 -198
  219. package/test/e2e/journey/delete/Registration.journey.json +0 -249
  220. package/test/e2e/journey/delete/ResetPassword.journey.json +0 -268
  221. package/test/e2e/journey/delete/UpdatePassword.journey.json +0 -323
  222. package/test/e2e/journey/delete/deleteMe.journey.json +0 -230
  223. package/test/e2e/journey/list/Disabled.journey.json +0 -43
  224. package/test/e2e/journey/list/ForgottenUsername.journey.json +0 -216
  225. package/test/e2e/journey/list/Login.journey.json +0 -205
  226. package/test/e2e/journey/list/PasswordGrant.journey.json +0 -139
  227. package/test/e2e/journey/list/ProgressiveProfile.journey.json +0 -198
  228. package/test/e2e/journey/list/Registration.journey.json +0 -249
  229. package/test/e2e/journey/list/ResetPassword.journey.json +0 -268
  230. package/test/e2e/journey/list/UpdatePassword.journey.json +0 -323
  231. package/test/e2e/setup.js +0 -98
  232. package/test/e2e/theme/baseline/Contrast.theme.json +0 -95
  233. package/test/e2e/theme/baseline/Highlander.theme.json +0 -95
  234. package/test/e2e/theme/baseline/Robroy.theme.json +0 -95
  235. package/test/e2e/theme/baseline/Starter-Theme.theme.json +0 -94
  236. package/test/e2e/theme/baseline/Zardoz.theme.json +0 -95
  237. package/test/e2e/theme/import/Contrast.theme.json +0 -95
  238. package/test/e2e/theme/import/Highlander.theme.json +0 -95
  239. package/test/e2e/theme/import/Robroy.theme.json +0 -95
  240. package/test/e2e/theme/import/Starter-Theme.theme.json +0 -94
  241. package/test/e2e/theme/import/Zardoz.default.theme.json +0 -95
  242. package/test/fs_tmp/.gitkeep +0 -2
  243. package/test/global/setup.js +0 -65
  244. package/test/lib_api/unit_tests/ApiUtils.test.js +0 -186
  245. package/test/lib_api/unit_tests/Base64URL.test.js +0 -22
  246. package/test/lib_api/unit_tests/DataProtection.test.js +0 -25
  247. package/test/lib_api/unit_tests/ExportImportUtils.test.js +0 -121
@@ -1,125 +0,0 @@
1
- import cp from 'child_process';
2
- import { promisify } from 'util';
3
- import { crudeMultilineTakeUntil, collapseWhitespace } from '../utils/utils';
4
-
5
- const exec = promisify(cp.exec);
6
- const CMD = 'frodo info --help';
7
- const { stdout } = await exec(CMD);
8
-
9
- test("CLI help interface for 'info' Usage should be expected english", async () => {
10
- // Arrange
11
- const expected = `
12
- Usage: frodo info [options] <host> [user] [password]
13
- `.trim();
14
- // Act
15
- const testLine = stdout
16
- .split(/\n/)
17
- .find(line => line.trim().startsWith('Usage:'))
18
- .trim();
19
- // Assert
20
- expect(testLine).toBe(expected);
21
- });
22
-
23
-
24
- test("CLI help interface 'info' description at line 2 should be expected english", async () => {
25
- // Arrange
26
- const expected = `
27
- Print versions and tokens.
28
- `.trim();
29
- // Act
30
- const testLine = stdout
31
- .split(/\n/)
32
- .map(line => line.trim())
33
- .at(2)
34
- // Assert
35
- expect(testLine).toBe(expected);
36
- });
37
-
38
- test("CLI help interface 'info argument host' description should be expected english multiline", async () => {
39
- // Arrange
40
- const expected = collapseWhitespace(`
41
- host Access Management base URL, e.g.:
42
- https://cdk.iam.example.com/am. To use a connection profile,
43
- just specify a unique substring.
44
- `);
45
- // Act
46
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
47
- stdout,
48
- ' host ',
49
- ' user '
50
- ));
51
-
52
- // Assert
53
- expect(testLine).toBe(expected);
54
- });
55
-
56
-
57
- test("CLI help interface 'info argument user' description should be expected english multiline", async () => {
58
- // Arrange
59
- const expected = collapseWhitespace(`
60
- user Username to login with. Must be an admin user with appropriate
61
- rights to manage authentication journeys/trees.
62
- `);
63
- // Act
64
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
65
- stdout,
66
- ' user ',
67
- ' password '
68
- ));;
69
- // Assert
70
- expect(testLine).toBe(expected);
71
- });
72
-
73
- test("CLI help interface 'info argument password' description should be expected english", async () => {
74
- // Arrange
75
- const expected = `
76
- password Password.
77
- `.trim();
78
- // Act
79
- const testLine = stdout
80
- .split(/\n/)
81
- .find(line => line.trim().startsWith('password'))
82
- .trim();
83
- // Assert
84
- expect(testLine).toBe(expected);
85
- });
86
-
87
- test("CLI help interface 'info Options -m, --type' description should be expected english", async () => {
88
- // Arrange
89
- const expected = collapseWhitespace(`
90
- -m, --type <type> Override auto-detected deployment type. Valid values for type:
91
- classic: A classic Access Management-only deployment with
92
- custom layout and configuration.
93
- cloud: A ForgeRock Identity Cloud environment.
94
- forgeops: A ForgeOps CDK or CDM deployment.
95
- The detected or provided deployment type controls certain
96
- behavior like obtaining an Identity Management admin token or
97
- not and whether to export/import referenced email templates or
98
- how to walk through the tenant admin login flow of Identity
99
- Cloud and handle MFA (choices: "classic", "cloud", "forgeops")
100
- `);
101
- // Act
102
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
103
- stdout,
104
- ' -m, --type <type> ',
105
- ' -k, --insecure '
106
- ));;
107
- // Assert
108
- expect(testLine).toBe(expected);
109
- });
110
-
111
- test("CLI help interface 'info Options -k, --insecure' description should be expected english", async () => {
112
- // Arrange
113
- const expected = collapseWhitespace(`
114
- -k, --insecure Allow insecure connections when using SSL/TLS (default: Don't
115
- allow insecure connections)
116
- `);
117
- // Act
118
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
119
- stdout,
120
- ' -k, --insecure ',
121
- ' -h, --help '
122
- ));;
123
- // Assert
124
- expect(testLine).toBe(expected);
125
- });
@@ -1,127 +0,0 @@
1
- import cp from 'child_process';
2
- import { promisify } from 'util';
3
- import { crudeMultilineTakeUntil, collapseWhitespace } from '../utils/utils';
4
-
5
- const exec = promisify(cp.exec);
6
- const CMD = 'frodo journey --help';
7
- const { stdout } = await exec(CMD);
8
-
9
- test("CLI help interface for 'journey' Usage should be expected english", async () => {
10
- // Arrange
11
- const expected = `
12
- Usage: frodo journey [options] [command]
13
- `.trim();
14
- // Act
15
- const testLine = stdout
16
- .split(/\n/)
17
- .find(line => line.trim().startsWith('Usage:'))
18
- .trim();
19
- // Assert
20
- expect(testLine).toBe(expected);
21
- });
22
-
23
-
24
- test("CLI help interface 'journey' description at line 2 should be expected english", async () => {
25
- // Arrange
26
- const expected = `
27
- Manage journeys/trees.
28
- `.trim();
29
- // Act
30
- const testLine = stdout
31
- .split(/\n/)
32
- .map(line => line.trim())
33
- .at(2)
34
- // Assert
35
- expect(testLine).toBe(expected);
36
- });
37
-
38
- test("CLI help interface 'journey commands list' description should be expected english", async () => {
39
- // Arrange
40
- const expected = `
41
- list [options] <host> [realm] [user] [password] List all the journeys/trees in a realm.
42
- `.trim();
43
- // Act
44
- const testLine = stdout
45
- .split(/\n/)
46
- .find(line => line.trim().startsWith('list'))
47
- .trim();
48
- // Assert
49
- expect(testLine).toBe(expected);
50
- });
51
-
52
- test("CLI help interface 'journey commands describe' description should be expected english", async () => {
53
- // Arrange
54
- const expected = collapseWhitespace(`
55
- describe [options] [host] [realm] [user] [password] If -h is supplied, describe the journey/tree
56
- indicated by -t, or all journeys/trees in the
57
- realm if no -t is supplied, otherwise describe
58
- the journey/tree export file indicated by -f.
59
- `);
60
- // Act
61
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
62
- stdout,
63
- ' describe [options] [host] [realm] [user] [password] ',
64
- ' export [options] <host> [realm] [user] [password] '
65
- ));
66
- // Assert
67
- expect(testLine).toBe(expected);
68
- });
69
-
70
-
71
- test("CLI help interface 'journey commands export' description should be expected english", async () => {
72
- // Arrange
73
- const expected = `
74
- export [options] <host> [realm] [user] [password] Export journeys/trees.
75
- `.trim();
76
- // Act
77
- const testLine = stdout
78
- .split(/\n/)
79
- .find(line => line.trim().startsWith('export'))
80
- .trim();
81
- // Assert
82
- expect(testLine).toBe(expected);
83
- });
84
-
85
- test("CLI help interface 'journey commands import' description should be expected english", async () => {
86
- // Arrange
87
- const expected = `
88
- import [options] <host> [realm] [user] [password] Import journey/tree.
89
- `.trim();
90
- // Act
91
- const testLine = stdout
92
- .split(/\n/)
93
- .find(line => line.trim().startsWith('import'))
94
- .trim();
95
- // Assert
96
- expect(testLine).toBe(expected);
97
- });
98
-
99
- test("CLI help interface 'journey commands importAll' description should be expected english", async () => {
100
- // Arrange
101
- const expected = `
102
- importAll [options] <host> [realm] [user] [password] Import all the trees in a realm.
103
- `.trim();
104
- // Act
105
- const testLine = stdout
106
- .split(/\n/)
107
- .find(line => line.trim().startsWith('importAll'))
108
- .trim();
109
- // Assert
110
- expect(testLine).toBe(expected);
111
- });
112
-
113
- test("CLI help interface 'journey commands prune' description should be expected english", async () => {
114
- // Arrange
115
- const expected = collapseWhitespace(`
116
- prune [options] <host> [realm] [user] [password] Prune orphaned configuration artifacts left behind after deleting authentication trees.
117
- You will be prompted before any destructive operations are performed.
118
- `);
119
- // Act
120
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
121
- stdout,
122
- ' prune [options] <host> [realm] [user] [password] ',
123
- ' help [command] '
124
- ));
125
- // Assert
126
- expect(testLine).toBe(expected);
127
- });
@@ -1,196 +0,0 @@
1
- import cp from 'child_process';
2
- import { promisify } from 'util';
3
- import { crudeMultilineTakeUntil, collapseWhitespace } from '../utils/utils';
4
-
5
- const exec = promisify(cp.exec);
6
- const CMD = 'frodo journey describe --help';
7
- const { stdout } = await exec(CMD);
8
-
9
- test("CLI help interface for 'journey describe' Usage should be expected english", async () => {
10
- // Arrange
11
- const expected = `
12
- Usage: frodo journey describe [options] [host] [realm] [user] [password]
13
- `.trim();
14
- // Act
15
- const testLine = stdout
16
- .split(/\n/)
17
- .find(line => line.trim().startsWith('Usage:'))
18
- .trim();
19
- // Assert
20
- expect(testLine).toBe(expected);
21
- });
22
-
23
-
24
- test("CLI help interface 'journey describe' description at line 2 should be expected english", async () => {
25
- // Arrange
26
- const expected = `
27
- If -h is supplied, describe the journey/tree indicated by -t, or all journeys/trees in the realm if no -t is supplied, otherwise describe the journey/tree export file indicated by -f.
28
- `.trim();
29
- // Act
30
- const testLine = stdout
31
- .split(/\n/)
32
- .map(line => line.trim())
33
- .at(2)
34
- // Assert
35
- expect(testLine).toBe(expected);
36
- });
37
-
38
-
39
- test("CLI help interface 'describe argument host' description should be expected english multiline", async () => {
40
- // Arrange
41
- const expected = collapseWhitespace(`
42
- host Access Management base URL, e.g.: https://cdk.iam.example.com/am.
43
- To use a connection profile, just specify a unique substring.
44
- `);
45
- // Act
46
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
47
- stdout,
48
- ' host ',
49
- ' realm '
50
- ));
51
-
52
- // Assert
53
- expect(testLine).toBe(expected);
54
- });
55
-
56
-
57
- test("CLI help interface 'describe argument realm' description should be expected english multiline", async () => {
58
- // Arrange
59
- const expected = collapseWhitespace(`
60
- realm Realm. Specify realm as '/' for the root realm or 'realm' or
61
- '/parent/child' otherwise. (default: "__default__realm__")
62
- `);
63
- // Act
64
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
65
- stdout,
66
- ' realm ',
67
- ' user '
68
- ));
69
-
70
- // Assert
71
- expect(testLine).toBe(expected);
72
- });
73
-
74
- test("CLI help interface 'describe argument user' description should be expected english multiline", async () => {
75
- // Arrange
76
- const expected = collapseWhitespace(`
77
- user Username to login with. Must be an admin user with appropriate
78
- rights to manage authentication journeys/trees.
79
- `);
80
- // Act
81
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
82
- stdout,
83
- ' user ',
84
- ' password '
85
- ));
86
-
87
- // Assert
88
- expect(testLine).toBe(expected);
89
- });
90
-
91
- test("CLI help interface 'describe argument password' description should be expected english", async () => {
92
- // Arrange
93
- const expectedDescription = `
94
- password Password.
95
- `.trim();
96
- // Act
97
- const testLine = stdout
98
- .split(/\n/)
99
- .find(line => line.trim().startsWith('password'))
100
- .trim();
101
- // Assert
102
- expect(testLine).toBe(expectedDescription);
103
- });
104
-
105
- test("CLI help interface 'describe option -m, --type <type>' description should be expected english multiline", async () => {
106
- // Arrange
107
- const expected = collapseWhitespace(`
108
- -m, --type <type> Override auto-detected deployment type. Valid values for type:
109
- classic: A classic Access Management-only deployment with custom
110
- layout and configuration.
111
- cloud: A ForgeRock Identity Cloud environment.
112
- forgeops: A ForgeOps CDK or CDM deployment.
113
- The detected or provided deployment type controls certain
114
- behavior like obtaining an Identity Management admin token or not
115
- and whether to export/import referenced email templates or how to
116
- walk through the tenant admin login flow of Identity Cloud and
117
- handle MFA (choices: "classic", "cloud", "forgeops")
118
- `);
119
- // Act
120
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
121
- stdout,
122
- ' -m, --type <type> ',
123
- ' -t, --tree <tree> '
124
- ));
125
-
126
- // Assert
127
- expect(testLine).toBe(expected);
128
- });
129
-
130
- test("CLI help interface 'describe option -t, --tree <tree>' description should be expected english", async () => {
131
- // Arrange
132
- const expectedDescription = `
133
- -t, --tree <tree> Specify the name of an authentication journey/tree.
134
- `.trim();
135
- // Act
136
- const testLine = stdout
137
- .split(/\n/)
138
- .find(line => line.trim().startsWith('-t, --tree <tree>'))
139
- .trim();
140
- // Assert
141
- expect(testLine).toBe(expectedDescription);
142
- });
143
-
144
- test("CLI help interface 'describe option -f, --file <file>' description should be expected english", async () => {
145
- // Arrange
146
- const expectedDescription = `
147
- -f, --file <file> File name.
148
- `.trim();
149
- // Act
150
- const testLine = stdout
151
- .split(/\n/)
152
- .find(line => line.trim().startsWith('-f, --file <file>'))
153
- .trim();
154
- // Assert
155
- expect(testLine).toBe(expectedDescription);
156
- });
157
-
158
-
159
- test("CLI help interface 'describe option -o, --version <version>' description should be expected english multiline", async () => {
160
- // Arrange
161
- const expected = collapseWhitespace(`
162
- -o, --version <version> Override version. Notation: 'X.Y.Z' e.g. '7.1.0'. Override
163
- detected version with any version. This is helpful in order to
164
- check if journeys in one environment would be compatible running
165
- in another environment (e.g. in preparation of migrating from
166
- on-prem to ForgeRock Identity Cloud. Only impacts these actions:
167
- -d, -l.
168
- `);
169
- // Act
170
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
171
- stdout,
172
- ' -o, --version <version> ',
173
- ' -k, --insecure '
174
- ));
175
-
176
- // Assert
177
- expect(testLine).toBe(expected);
178
- });
179
-
180
-
181
- test("CLI help interface 'describe option -k, --insecure' description should be expected english multiline", async () => {
182
- // Arrange
183
- const expected = collapseWhitespace(`
184
- -k, --insecure Allow insecure connections when using SSL/TLS (default: Don't
185
- allow insecure connections)
186
- `);
187
- // Act
188
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
189
- stdout,
190
- ' -k, --insecure ',
191
- ' -h, --help ',
192
- ));
193
-
194
- // Assert
195
- expect(testLine).toBe(expected);
196
- });
@@ -1,213 +0,0 @@
1
- import cp from 'child_process';
2
- import { promisify } from 'util';
3
- import { crudeMultilineTakeUntil, collapseWhitespace } from '../utils/utils';
4
-
5
- const exec = promisify(cp.exec);
6
- const CMD = 'frodo journey export --help';
7
- const { stdout } = await exec(CMD);
8
-
9
- test("CLI help interface for 'journey export' Usage should be expected english", async () => {
10
- // Arrange
11
- const expected = `
12
- Usage: frodo journey export [options] <host> [realm] [user] [password]
13
- `.trim();
14
- // Act
15
- const testLine = stdout
16
- .split(/\n/)
17
- .find(line => line.trim().startsWith('Usage:'))
18
- .trim();
19
- // Assert
20
- expect(testLine).toBe(expected);
21
- });
22
-
23
- test("CLI help interface 'journey export' description at line 2 should be expected english", async () => {
24
- // Arrange
25
- const expected = `
26
- Export journeys/trees.
27
- `.trim();
28
- // Act
29
- const testLine = stdout
30
- .split(/\n/)
31
- .map(line => line.trim())
32
- .at(2)
33
- // Assert
34
- expect(testLine).toBe(expected);
35
- });
36
-
37
-
38
- test("CLI help interface 'export argument host' description should be expected english multiline", async () => {
39
- // Arrange
40
- const expected = collapseWhitespace(`
41
- host Access Management base URL, e.g.:
42
- https://cdk.iam.example.com/am. To use a connection
43
- profile, just specify a unique substring.
44
- `);
45
- // Act
46
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
47
- stdout,
48
- ' host ',
49
- ' realm '
50
- ));
51
-
52
- // Assert
53
- expect(testLine).toBe(expected);
54
- });
55
-
56
-
57
- test("CLI help interface 'export argument realm' description should be expected english multiline", async () => {
58
- // Arrange
59
- const expected = collapseWhitespace(`
60
- realm Realm. Specify realm as '/' for the root realm or 'realm'
61
- or '/parent/child' otherwise. (default: "__default__realm__")
62
- `);
63
- // Act
64
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
65
- stdout,
66
- ' realm ',
67
- ' user '
68
- ));
69
-
70
- // Assert
71
- expect(testLine).toBe(expected);
72
- });
73
-
74
- test("CLI help interface 'export argument user' description should be expected english multiline", async () => {
75
- // Arrange
76
- const expected = collapseWhitespace(`
77
- user Username to login with. Must be an admin user with appropriate
78
- rights to manage authentication journeys/trees.
79
- `);
80
- // Act
81
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
82
- stdout,
83
- ' user ',
84
- ' password '
85
- ));
86
-
87
- // Assert
88
- expect(testLine).toBe(expected);
89
- });
90
-
91
- test("CLI help interface 'export argument password' description should be expected english", async () => {
92
- // Arrange
93
- const expectedDescription = `
94
- password Password.
95
- `.trim();
96
- // Act
97
- const testLine = stdout
98
- .split(/\n/)
99
- .find(line => line.trim().startsWith('password'))
100
- .trim();
101
- // Assert
102
- expect(testLine).toBe(expectedDescription);
103
- });
104
-
105
- test("CLI help interface 'export option -m, --type <type>' description should be expected english multiline", async () => {
106
- // Arrange
107
- const expected = collapseWhitespace(`
108
- -m, --type <type> Override auto-detected deployment type. Valid values for
109
- type:
110
- classic: A classic Access Management-only deployment
111
- with custom layout and configuration.
112
- cloud: A ForgeRock Identity Cloud environment.
113
- forgeops: A ForgeOps CDK or CDM deployment.
114
- The detected or provided deployment type controls certain
115
- behavior like obtaining an Identity Management admin
116
- token or not and whether to export/import referenced
117
- email templates or how to walk through the tenant admin
118
- login flow of Identity Cloud and handle MFA (choices:
119
- "classic", "cloud", "forgeops")
120
- `);
121
- // Act
122
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
123
- stdout,
124
- ' -m, --type <type> ',
125
- ' -k, --insecure '
126
- ));
127
-
128
- // Assert
129
- expect(testLine).toBe(expected);
130
- });
131
-
132
-
133
- test("CLI help interface 'export option -k, --insecure' description should be expected english multiline", async () => {
134
- // Arrange
135
- const expected = collapseWhitespace(`
136
- -k, --insecure Allow insecure connections when using SSL/TLS (default: Don't
137
- allow insecure connections)
138
- `);
139
- // Act
140
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
141
- stdout,
142
- ' -k, --insecure ',
143
- ' -t, --tree <tree> ',
144
- ));
145
-
146
- // Assert
147
- expect(testLine).toBe(expected);
148
- });
149
-
150
- test("CLI help interface 'export option -t, --tree <tree>' description should be expected english multiline", async () => {
151
- // Arrange
152
- const expected = collapseWhitespace(`
153
- -t, --tree <tree> Name of a journey/tree. If specified, -a and -A are
154
- ignored.
155
- `);
156
- // Act
157
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
158
- stdout,
159
- ' -t, --tree <tree> ',
160
- ' -f, --file <file> '
161
- ));
162
-
163
- // Assert
164
- expect(testLine).toBe(expected);
165
- });
166
-
167
- test("CLI help interface 'export option -f, --file <file>' description should be expected english", async () => {
168
- // Arrange
169
- const expected = collapseWhitespace(`
170
- -f, --file <file> Name of the file to write the exported journey(s) to.
171
- Ignored with -A.
172
- `);
173
- // Act
174
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
175
- stdout,
176
- ' -f, --file <file> ',
177
- ' -a, --all '
178
- ));
179
- // Assert
180
- expect(testLine).toBe(expected);
181
- });
182
-
183
- test("CLI help interface 'export option -a, --all' description should be expected english", async () => {
184
- // Arrange
185
- const expected = collapseWhitespace(`
186
- -a, --all Export all the journeys/trees in a realm. Ignored with
187
- -t.
188
- `);
189
- // Act
190
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
191
- stdout,
192
- ' -a, --all ',
193
- ' -A, --allSeparate ',
194
- ));
195
- // Assert
196
- expect(testLine).toBe(expected);
197
- });
198
-
199
- test("CLI help interface 'export option -A, --allSeparate' description should be expected english", async () => {
200
- // Arrange
201
- const expected = collapseWhitespace(`
202
- -A, --allSeparate Export all the journeys/trees in a realm as separate
203
- files <journey/tree name>.json. Ignored with -t or -a.
204
- `);
205
- // Act
206
- const testLine = collapseWhitespace(crudeMultilineTakeUntil(
207
- stdout,
208
- ' -A, --allSeparate ',
209
- ' -h, --help ',
210
- ));
211
- // Assert
212
- expect(testLine).toBe(expected);
213
- });