@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.
- package/CHANGELOG.md +13 -1
- package/README.md +3 -3
- package/package.json +17 -15
- package/src/app.js +7 -6
- package/src/cli/_template/cmd-delete.js +9 -8
- package/src/cli/_template/cmd-describe.js +9 -8
- package/src/cli/_template/cmd-export.js +9 -8
- package/src/cli/_template/cmd-import.js +9 -8
- package/src/cli/_template/cmd-list.js +9 -8
- package/src/cli/_template/cmd-sub1-delete.js +9 -8
- package/src/cli/_template/cmd-sub1-describe.js +9 -8
- package/src/cli/_template/cmd-sub1-export.js +9 -8
- package/src/cli/_template/cmd-sub1-import.js +9 -8
- package/src/cli/_template/cmd-sub1-list.js +9 -8
- package/src/cli/_template/cmd-sub2-delete.js +9 -8
- package/src/cli/_template/cmd-sub2-describe.js +9 -8
- package/src/cli/_template/cmd-sub2-export.js +9 -8
- package/src/cli/_template/cmd-sub2-import.js +9 -8
- package/src/cli/_template/cmd-sub2-list.js +9 -8
- package/src/cli/admin/admin-add-autoid-static-user-mapping.js +12 -12
- package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +15 -18
- package/src/cli/admin/admin-get-access-token.js +12 -12
- package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.js +13 -13
- package/src/cli/admin/admin-hide-generic-extension-attributes.js +13 -13
- package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +13 -13
- package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +14 -13
- package/src/cli/admin/admin-list-static-user-mappings.js +12 -12
- package/src/cli/admin/admin-remove-static-user-mapping.js +12 -12
- package/src/cli/admin/admin-repair-org-model.js +13 -13
- package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +13 -13
- package/src/cli/admin/admin-show-generic-extension-attributes.js +13 -13
- package/src/cli/app/app-delete.js +9 -8
- package/src/cli/app/app-describe.js +9 -8
- package/src/cli/app/app-export.js +15 -15
- package/src/cli/app/app-import.js +11 -11
- package/src/cli/app/app-list.js +11 -12
- package/src/cli/conn/conn-add.js +11 -11
- package/src/cli/conn/conn-delete.js +3 -1
- package/src/cli/conn/conn-describe.js +3 -1
- package/src/cli/conn/conn-list.js +3 -4
- package/src/cli/email/email-template-export.js +16 -16
- package/src/cli/email/email-template-import.js +16 -16
- package/src/cli/email/email-template-list.js +11 -11
- package/src/cli/esv/esv-apply.js +12 -12
- package/src/cli/esv/esv-secret-create.js +11 -11
- package/src/cli/esv/esv-secret-delete.js +13 -13
- package/src/cli/esv/esv-secret-describe.js +11 -11
- package/src/cli/esv/esv-secret-export.js +9 -8
- package/src/cli/esv/esv-secret-import.js +9 -8
- package/src/cli/esv/esv-secret-list.js +11 -11
- package/src/cli/esv/esv-secret-set.js +11 -11
- package/src/cli/esv/esv-secret-version-activate.js +12 -12
- package/src/cli/esv/esv-secret-version-create.js +11 -11
- package/src/cli/esv/esv-secret-version-deactivate.js +12 -12
- package/src/cli/esv/esv-secret-version-delete.js +13 -13
- package/src/cli/esv/esv-secret-version-list.js +11 -11
- package/src/cli/esv/esv-variable-create.js +11 -11
- package/src/cli/esv/esv-variable-delete.js +13 -16
- package/src/cli/esv/esv-variable-describe.js +11 -11
- package/src/cli/esv/esv-variable-export.js +9 -8
- package/src/cli/esv/esv-variable-import.js +9 -8
- package/src/cli/esv/esv-variable-list.js +11 -11
- package/src/cli/esv/esv-variable-set.js +13 -16
- package/src/cli/idm/idm-count.js +11 -11
- package/src/cli/idm/idm-export.js +16 -16
- package/src/cli/idm/idm-list.js +11 -11
- package/src/cli/idp/idp-export.js +15 -19
- package/src/cli/idp/idp-import.js +18 -18
- package/src/cli/idp/idp-list.js +12 -12
- package/src/cli/info/info.js +23 -19
- package/src/cli/journey/journey-delete.js +14 -14
- package/src/cli/journey/journey-describe.js +26 -35
- package/src/cli/journey/journey-export.js +18 -21
- package/src/cli/journey/journey-import.js +17 -17
- package/src/cli/journey/journey-list.js +12 -12
- package/src/cli/journey/journey-prune.js +12 -12
- package/src/cli/logging/logs-list.js +33 -28
- package/src/cli/logging/logs-tail.js +26 -22
- package/src/cli/realm/realm-add-custom-domain.js +13 -13
- package/src/cli/realm/realm-describe.js +14 -14
- package/src/cli/realm/realm-list.js +11 -11
- package/src/cli/realm/realm-remove-custom-domain.js +16 -13
- package/src/cli/saml/saml-cot-export.js +16 -16
- package/src/cli/saml/saml-cot-import.js +18 -18
- package/src/cli/saml/saml-cot-list.js +12 -12
- package/src/cli/saml/saml-describe.js +12 -12
- package/src/cli/saml/saml-export.js +16 -19
- package/src/cli/saml/saml-import.js +19 -18
- package/src/cli/saml/saml-list.js +12 -12
- package/src/cli/saml/saml-metadata-export.js +15 -19
- package/src/cli/script/script-delete.js +9 -8
- package/src/cli/script/script-describe.js +9 -8
- package/src/cli/script/script-export.js +18 -20
- package/src/cli/script/script-import.js +13 -12
- package/src/cli/script/script-list.js +12 -12
- package/src/cli/theme/theme-delete.js +17 -21
- package/src/cli/theme/theme-export.js +19 -18
- package/src/cli/theme/theme-import.js +21 -20
- package/src/cli/theme/theme-list.js +12 -12
- package/.eslintrc +0 -29
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/README.md +0 -273
- package/.github/workflows/pipeline.yml +0 -487
- package/.prettierrc +0 -6
- package/CODE_OF_CONDUCT.md +0 -128
- package/docs/BINARIES.md +0 -22
- package/docs/CONTRIBUTE.md +0 -96
- package/docs/PIPELINE.md +0 -169
- package/docs/images/macos_warn1.png +0 -0
- package/docs/images/macos_warn2.png +0 -0
- package/docs/images/macos_warn3.png +0 -0
- package/docs/images/npm_versioning_guidelines.png +0 -0
- package/docs/images/release_pipeline.png +0 -0
- package/gulpfile.js +0 -49
- package/jsconfig.json +0 -6
- package/resources/sampleEntitiesFile.json +0 -8
- package/resources/sampleEnvFile.env +0 -2
- package/src/api/AuthenticateApi.js +0 -33
- package/src/api/BaseApi.js +0 -242
- package/src/api/CirclesOfTrustApi.js +0 -87
- package/src/api/EmailTemplateApi.js +0 -37
- package/src/api/IdmConfigApi.js +0 -88
- package/src/api/LogApi.js +0 -45
- package/src/api/ManagedObjectApi.js +0 -62
- package/src/api/OAuth2ClientApi.js +0 -69
- package/src/api/OAuth2OIDCApi.js +0 -73
- package/src/api/OAuth2ProviderApi.js +0 -32
- package/src/api/RealmApi.js +0 -99
- package/src/api/Saml2Api.js +0 -176
- package/src/api/ScriptApi.js +0 -84
- package/src/api/SecretsApi.js +0 -151
- package/src/api/ServerInfoApi.js +0 -41
- package/src/api/SocialIdentityProvidersApi.js +0 -114
- package/src/api/StartupApi.js +0 -45
- package/src/api/ThemeApi.js +0 -181
- package/src/api/TreeApi.js +0 -207
- package/src/api/VariablesApi.js +0 -104
- package/src/api/utils/ApiUtils.js +0 -77
- package/src/api/utils/Base64.js +0 -62
- package/src/cli/journey/journey-delete.e2e.test.js +0 -380
- package/src/cli/journey/journey-list.e2e.test.js +0 -141
- package/src/cli/theme/theme-delete.e2e.test.js +0 -178
- package/src/cli/theme/theme-list.e2e.test.js +0 -119
- package/src/ops/AdminOps.js +0 -901
- package/src/ops/AuthenticateOps.js +0 -342
- package/src/ops/CirclesOfTrustOps.js +0 -350
- package/src/ops/ConnectionProfileOps.js +0 -254
- package/src/ops/EmailTemplateOps.js +0 -326
- package/src/ops/IdmOps.js +0 -227
- package/src/ops/IdpOps.js +0 -342
- package/src/ops/JourneyOps.js +0 -2026
- package/src/ops/LogOps.js +0 -357
- package/src/ops/ManagedObjectOps.js +0 -34
- package/src/ops/OAuth2ClientOps.js +0 -151
- package/src/ops/OrganizationOps.js +0 -85
- package/src/ops/RealmOps.js +0 -139
- package/src/ops/SamlOps.js +0 -541
- package/src/ops/ScriptOps.js +0 -211
- package/src/ops/SecretsOps.js +0 -288
- package/src/ops/StartupOps.js +0 -114
- package/src/ops/ThemeOps.js +0 -379
- package/src/ops/VariablesOps.js +0 -185
- package/src/ops/templates/OAuth2ClientTemplate.json +0 -270
- package/src/ops/templates/OrgModelUserAttributesTemplate.json +0 -149
- package/src/ops/templates/cloud/GenericExtensionAttributesTemplate.json +0 -392
- package/src/ops/templates/cloud/managed.json +0 -4119
- package/src/ops/utils/Console.js +0 -434
- package/src/ops/utils/DataProtection.js +0 -92
- package/src/ops/utils/ExportImportUtils.js +0 -146
- package/src/ops/utils/OpsUtils.js +0 -76
- package/src/ops/utils/Wordwrap.js +0 -11
- package/src/storage/SessionStorage.js +0 -45
- package/test/client_cli/en/connections.test.js +0 -62
- package/test/client_cli/en/connections_add.test.js +0 -34
- package/test/client_cli/en/connections_delete.test.js +0 -34
- package/test/client_cli/en/connections_list.test.js +0 -34
- package/test/client_cli/en/email_templates.test.js +0 -77
- package/test/client_cli/en/email_templates_export.test.js +0 -196
- package/test/client_cli/en/email_templates_import.test.js +0 -145
- package/test/client_cli/en/email_templates_list.test.js +0 -130
- package/test/client_cli/en/idm.test.js +0 -111
- package/test/client_cli/en/idm_count.test.js +0 -121
- package/test/client_cli/en/idm_export.test.js +0 -136
- package/test/client_cli/en/idm_exportAll.test.js +0 -156
- package/test/client_cli/en/idm_exportAllRaw.test.js +0 -120
- package/test/client_cli/en/idm_import.test_.js +0 -103
- package/test/client_cli/en/idm_importAll.test_.js +0 -103
- package/test/client_cli/en/idm_list.test.js +0 -103
- package/test/client_cli/en/info.test.js +0 -125
- package/test/client_cli/en/journey.test.js +0 -127
- package/test/client_cli/en/journey_describe.test.js +0 -196
- package/test/client_cli/en/journey_export.test.js +0 -213
- package/test/client_cli/en/journey_import.test.js +0 -195
- package/test/client_cli/en/journey_importAll.test.js +0 -180
- package/test/client_cli/en/journey_list.test.js +0 -162
- package/test/client_cli/en/journey_prune.test.js +0 -148
- package/test/client_cli/en/logs.test.js +0 -79
- package/test/client_cli/en/logs_list.test.js +0 -83
- package/test/client_cli/en/logs_tail.test.js +0 -118
- package/test/client_cli/en/root.test.js +0 -91
- package/test/client_cli/en/script.test.js +0 -77
- package/test/client_cli/en/script_export.test.js +0 -213
- package/test/client_cli/en/script_import.test.js +0 -163
- package/test/client_cli/en/script_list.test.js +0 -148
- package/test/client_cli/utils/utils.js +0 -32
- package/test/e2e/journey/baseline/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/baseline/Login.journey.json +0 -205
- package/test/e2e/journey/baseline/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/baseline/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/baseline/Registration.journey.json +0 -249
- package/test/e2e/journey/baseline/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/baseline/UpdatePassword.journey.json +0 -323
- package/test/e2e/journey/baseline/allAlphaJourneys.journeys.json +0 -1520
- package/test/e2e/journey/delete/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/delete/Login.journey.json +0 -205
- package/test/e2e/journey/delete/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/delete/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/delete/Registration.journey.json +0 -249
- package/test/e2e/journey/delete/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/delete/UpdatePassword.journey.json +0 -323
- package/test/e2e/journey/delete/deleteMe.journey.json +0 -230
- package/test/e2e/journey/list/Disabled.journey.json +0 -43
- package/test/e2e/journey/list/ForgottenUsername.journey.json +0 -216
- package/test/e2e/journey/list/Login.journey.json +0 -205
- package/test/e2e/journey/list/PasswordGrant.journey.json +0 -139
- package/test/e2e/journey/list/ProgressiveProfile.journey.json +0 -198
- package/test/e2e/journey/list/Registration.journey.json +0 -249
- package/test/e2e/journey/list/ResetPassword.journey.json +0 -268
- package/test/e2e/journey/list/UpdatePassword.journey.json +0 -323
- package/test/e2e/setup.js +0 -98
- package/test/e2e/theme/baseline/Contrast.theme.json +0 -95
- package/test/e2e/theme/baseline/Highlander.theme.json +0 -95
- package/test/e2e/theme/baseline/Robroy.theme.json +0 -95
- package/test/e2e/theme/baseline/Starter-Theme.theme.json +0 -94
- package/test/e2e/theme/baseline/Zardoz.theme.json +0 -95
- package/test/e2e/theme/import/Contrast.theme.json +0 -95
- package/test/e2e/theme/import/Highlander.theme.json +0 -95
- package/test/e2e/theme/import/Robroy.theme.json +0 -95
- package/test/e2e/theme/import/Starter-Theme.theme.json +0 -94
- package/test/e2e/theme/import/Zardoz.default.theme.json +0 -95
- package/test/fs_tmp/.gitkeep +0 -2
- package/test/global/setup.js +0 -65
- package/test/lib_api/unit_tests/ApiUtils.test.js +0 -186
- package/test/lib_api/unit_tests/Base64URL.test.js +0 -22
- package/test/lib_api/unit_tests/DataProtection.test.js +0 -25
- package/test/lib_api/unit_tests/ExportImportUtils.test.js +0 -121
|
@@ -1,163 +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 script import --help';
|
|
7
|
-
const { stdout } = await exec(CMD);
|
|
8
|
-
|
|
9
|
-
test("CLI help interface for 'script import' Usage should be expected english", async () => {
|
|
10
|
-
// Arrange
|
|
11
|
-
const expected = `
|
|
12
|
-
Usage: frodo script import [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 'script import' description at line 2 should be expected english", async () => {
|
|
24
|
-
// Arrange
|
|
25
|
-
const expected = `
|
|
26
|
-
Import script.
|
|
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 'import 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 'import 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 'import 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 'import 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 'import 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 'import 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:
|
|
137
|
-
Don't allow insecure connections)
|
|
138
|
-
`);
|
|
139
|
-
// Act
|
|
140
|
-
const testLine = collapseWhitespace(crudeMultilineTakeUntil(
|
|
141
|
-
stdout,
|
|
142
|
-
' -k, --insecure ',
|
|
143
|
-
' -f, --file <file> ',
|
|
144
|
-
));
|
|
145
|
-
|
|
146
|
-
// Assert
|
|
147
|
-
expect(testLine).toBe(expected);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
test("CLI help interface 'import option -f, --file <file>' description should be expected english", async () => {
|
|
151
|
-
// Arrange
|
|
152
|
-
const expected = collapseWhitespace(`
|
|
153
|
-
-f, --file <file> File name.
|
|
154
|
-
`);
|
|
155
|
-
// Act
|
|
156
|
-
const testLine = collapseWhitespace(crudeMultilineTakeUntil(
|
|
157
|
-
stdout,
|
|
158
|
-
' -f, --file <file> ',
|
|
159
|
-
' -h, --help '
|
|
160
|
-
));
|
|
161
|
-
// Assert
|
|
162
|
-
expect(testLine).toBe(expected);
|
|
163
|
-
});
|
|
@@ -1,148 +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 script list --help';
|
|
7
|
-
const { stdout } = await exec(CMD);
|
|
8
|
-
|
|
9
|
-
test("CLI help interface for 'script list' Usage should be expected english", async () => {
|
|
10
|
-
// Arrange
|
|
11
|
-
const expected = `
|
|
12
|
-
Usage: frodo script list [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 'script list' description at line 2 should be expected english", async () => {
|
|
24
|
-
// Arrange
|
|
25
|
-
const expected = `
|
|
26
|
-
List all the scripts in a realm.
|
|
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 'list 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 'list 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 'list 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 'list 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 'list 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 'list 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
|
-
' -h, --help ',
|
|
144
|
-
));
|
|
145
|
-
|
|
146
|
-
// Assert
|
|
147
|
-
expect(testLine).toBe(expected);
|
|
148
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file A collection of slightly rushed functions to help test the interface
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export const range = (start = 0, stop = 1, step = 1) => {
|
|
6
|
-
var a = [start], b = start;
|
|
7
|
-
while (b < stop) {
|
|
8
|
-
a.push(b += step || 1);
|
|
9
|
-
}
|
|
10
|
-
return a;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* JavaScript Regex constructor does not automatically escape special regex chars, this function fixes that
|
|
15
|
-
*/
|
|
16
|
-
const escapeRegExp = (str) => {
|
|
17
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string as a token
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @param str {string} The string to parse
|
|
22
|
-
* @param startsWith {string} The first word to encounter and start taking
|
|
23
|
-
* @param endsAt {string} The last word to encounter and end at
|
|
24
|
-
* A crude multiline only parser which takes from A to B, its likely to be buggy but good enough for testing
|
|
25
|
-
*/
|
|
26
|
-
export const crudeMultilineTakeUntil = (str, startsWith, endsAt) => {
|
|
27
|
-
return str.match(new RegExp(`${escapeRegExp(startsWith)}(.*?)${escapeRegExp(endsAt)}`, 'gs'))
|
|
28
|
-
.join('')
|
|
29
|
-
.replace(new RegExp(escapeRegExp(endsAt), 'g'), '');
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const collapseWhitespace = (str) => str.replace(/\s+/g, ' ').trim()
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"origin": "https://openam-frodo-dev.forgeblocks.com/am",
|
|
4
|
-
"exportedBy": "volker.scheuber@forgerock.com",
|
|
5
|
-
"exportDate": "2022-06-20T17:54:10.100Z",
|
|
6
|
-
"exportTool": "frodo",
|
|
7
|
-
"exportToolVersion": "v0.6.1 [v18.2.0]"
|
|
8
|
-
},
|
|
9
|
-
"innerNodes": {
|
|
10
|
-
"9f1e8d94-4922-481b-9e14-212b66548900": {
|
|
11
|
-
"_id": "9f1e8d94-4922-481b-9e14-212b66548900",
|
|
12
|
-
"_rev": "-1331445210",
|
|
13
|
-
"attributesToCollect": [
|
|
14
|
-
"mail"
|
|
15
|
-
],
|
|
16
|
-
"identityAttribute": "mail",
|
|
17
|
-
"validateInputs": false,
|
|
18
|
-
"required": true,
|
|
19
|
-
"_type": {
|
|
20
|
-
"_id": "AttributeCollectorNode",
|
|
21
|
-
"name": "Attribute Collector",
|
|
22
|
-
"collection": true
|
|
23
|
-
},
|
|
24
|
-
"_outcomes": [
|
|
25
|
-
{
|
|
26
|
-
"id": "outcome",
|
|
27
|
-
"displayName": "Outcome"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"nodes": {
|
|
33
|
-
"5e2a7c95-94af-4b23-8724-deb13853726a": {
|
|
34
|
-
"_id": "5e2a7c95-94af-4b23-8724-deb13853726a",
|
|
35
|
-
"_rev": "-1421046051",
|
|
36
|
-
"nodes": [
|
|
37
|
-
{
|
|
38
|
-
"_id": "9f1e8d94-4922-481b-9e14-212b66548900",
|
|
39
|
-
"nodeType": "AttributeCollectorNode",
|
|
40
|
-
"displayName": "Attribute Collector"
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"pageDescription": {
|
|
44
|
-
"en": "Enter your email address or <a href=\"#/service/Login\">Sign in</a>"
|
|
45
|
-
},
|
|
46
|
-
"pageHeader": {
|
|
47
|
-
"en": "Forgotten Username"
|
|
48
|
-
},
|
|
49
|
-
"_type": {
|
|
50
|
-
"_id": "PageNode",
|
|
51
|
-
"name": "Page Node",
|
|
52
|
-
"collection": true
|
|
53
|
-
},
|
|
54
|
-
"_outcomes": [
|
|
55
|
-
{
|
|
56
|
-
"id": "outcome",
|
|
57
|
-
"displayName": "Outcome"
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
"b93ce36e-1976-4610-b24f-8d6760b5463b": {
|
|
62
|
-
"_id": "b93ce36e-1976-4610-b24f-8d6760b5463b",
|
|
63
|
-
"_rev": "1389809903",
|
|
64
|
-
"tree": "Login",
|
|
65
|
-
"_type": {
|
|
66
|
-
"_id": "InnerTreeEvaluatorNode",
|
|
67
|
-
"name": "Inner Tree Evaluator",
|
|
68
|
-
"collection": true
|
|
69
|
-
},
|
|
70
|
-
"_outcomes": [
|
|
71
|
-
{
|
|
72
|
-
"id": "true",
|
|
73
|
-
"displayName": "True"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"id": "false",
|
|
77
|
-
"displayName": "False"
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
},
|
|
81
|
-
"bf9ea8d5-9802-4f26-9664-a21840faac23": {
|
|
82
|
-
"_id": "bf9ea8d5-9802-4f26-9664-a21840faac23",
|
|
83
|
-
"_rev": "-626658673",
|
|
84
|
-
"identityAttribute": "mail",
|
|
85
|
-
"identifier": "userName",
|
|
86
|
-
"_type": {
|
|
87
|
-
"_id": "IdentifyExistingUserNode",
|
|
88
|
-
"name": "Identify Existing User",
|
|
89
|
-
"collection": true
|
|
90
|
-
},
|
|
91
|
-
"_outcomes": [
|
|
92
|
-
{
|
|
93
|
-
"id": "true",
|
|
94
|
-
"displayName": "True"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"id": "false",
|
|
98
|
-
"displayName": "False"
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
"d9a79f01-2ce3-4be2-a28a-975f35c3c8ca": {
|
|
103
|
-
"_id": "d9a79f01-2ce3-4be2-a28a-975f35c3c8ca",
|
|
104
|
-
"_rev": "2035832000",
|
|
105
|
-
"emailSuspendMessage": {
|
|
106
|
-
"en": "An email has been sent to the address you entered. Click the link in that email to proceed."
|
|
107
|
-
},
|
|
108
|
-
"emailTemplateName": "forgottenUsername",
|
|
109
|
-
"identityAttribute": "mail",
|
|
110
|
-
"emailAttribute": "mail",
|
|
111
|
-
"objectLookup": true,
|
|
112
|
-
"_type": {
|
|
113
|
-
"_id": "EmailSuspendNode",
|
|
114
|
-
"name": "Email Suspend Node",
|
|
115
|
-
"collection": true
|
|
116
|
-
},
|
|
117
|
-
"_outcomes": [
|
|
118
|
-
{
|
|
119
|
-
"id": "outcome",
|
|
120
|
-
"displayName": "Outcome"
|
|
121
|
-
}
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"scripts": {},
|
|
126
|
-
"emailTemplates": {
|
|
127
|
-
"forgottenUsername": {
|
|
128
|
-
"_id": "emailTemplate/forgottenUsername",
|
|
129
|
-
"enabled": true,
|
|
130
|
-
"from": "",
|
|
131
|
-
"subject": {
|
|
132
|
-
"en": "Account Information - username",
|
|
133
|
-
"fr": "Informations sur le compte - nom d'utilisateur"
|
|
134
|
-
},
|
|
135
|
-
"message": {
|
|
136
|
-
"en": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>{{#if object.userName}}Your username is '{{object.userName}}'.</p><p>{{else}}If you received this email in error, please disregard.{{/if}}</p><p><a href=\"{{object.resumeURI}}\" style=\"text-decoration: none; color: #109cf1;\">Click here to login</a></p></div></body></html>",
|
|
137
|
-
"fr": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\">{{#if object.userName}}<p>Votre nom d'utilisateur est '{{object.userName}}'.</p>{{else}}Si vous avez reçu cet e-mail par erreur, veuillez ne pas en tenir compte.{{/if}}<p><a href=\"{{object.resumeURI}}\" style=\"text-decoration: none; color: #109cf1;\">Cliquez ici pour vous connecter</a></p></div></body></html>"
|
|
138
|
-
},
|
|
139
|
-
"html": {
|
|
140
|
-
"en": "<html><body>{{#if object.userName}}<p>Your username is '{{object.userName}}'.</p>{{else}}If you received this email in error, please disregard.{{/if}}<p><a href=\"{{object.resumeURI}}\">Click here to login</a></p></body></html>",
|
|
141
|
-
"fr": "<html><body>{{#if object.userName}}<p>Votre nom d'utilisateur est '{{object.userName}}'.</p>{{else}}Si vous avez reçu cet e-mail par erreur, veuillez ne pas en tenir compte.{{/if}}<p><a href=\"{{object.resumeURI}}\">Cliquez ici pour vous connecter</a></p></body></html>"
|
|
142
|
-
},
|
|
143
|
-
"styles": "body{background-color:#324054;color:#5e6d82;padding:60px;text-align:center}a{text-decoration:none;color:#109cf1}.content{background-color:#fff;border-radius:4px;margin:0 auto;padding:48px;width:235px}",
|
|
144
|
-
"defaultLocale": "en",
|
|
145
|
-
"mimeType": "text/html"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"socialIdentityProviders": {},
|
|
149
|
-
"themes": [],
|
|
150
|
-
"saml2Entities": {},
|
|
151
|
-
"circlesOfTrust": {},
|
|
152
|
-
"tree": {
|
|
153
|
-
"_id": "ForgottenUsername",
|
|
154
|
-
"_rev": "-1762040244",
|
|
155
|
-
"identityResource": "managed/alpha_user",
|
|
156
|
-
"uiConfig": {
|
|
157
|
-
"categories": "[\"Username Reset\"]"
|
|
158
|
-
},
|
|
159
|
-
"entryNodeId": "5e2a7c95-94af-4b23-8724-deb13853726a",
|
|
160
|
-
"nodes": {
|
|
161
|
-
"5e2a7c95-94af-4b23-8724-deb13853726a": {
|
|
162
|
-
"connections": {
|
|
163
|
-
"outcome": "bf9ea8d5-9802-4f26-9664-a21840faac23"
|
|
164
|
-
},
|
|
165
|
-
"displayName": "Page Node",
|
|
166
|
-
"nodeType": "PageNode",
|
|
167
|
-
"x": 139,
|
|
168
|
-
"y": 146
|
|
169
|
-
},
|
|
170
|
-
"b93ce36e-1976-4610-b24f-8d6760b5463b": {
|
|
171
|
-
"connections": {
|
|
172
|
-
"false": "e301438c-0bd0-429c-ab0c-66126501069a",
|
|
173
|
-
"true": "70e691a5-1e33-4ac3-a356-e7b6d60d92e0"
|
|
174
|
-
},
|
|
175
|
-
"displayName": "Inner Tree Evaluator",
|
|
176
|
-
"nodeType": "InnerTreeEvaluatorNode",
|
|
177
|
-
"x": 767,
|
|
178
|
-
"y": 188
|
|
179
|
-
},
|
|
180
|
-
"bf9ea8d5-9802-4f26-9664-a21840faac23": {
|
|
181
|
-
"connections": {
|
|
182
|
-
"false": "d9a79f01-2ce3-4be2-a28a-975f35c3c8ca",
|
|
183
|
-
"true": "d9a79f01-2ce3-4be2-a28a-975f35c3c8ca"
|
|
184
|
-
},
|
|
185
|
-
"displayName": "Identify Existing User",
|
|
186
|
-
"nodeType": "IdentifyExistingUserNode",
|
|
187
|
-
"x": 324,
|
|
188
|
-
"y": 152
|
|
189
|
-
},
|
|
190
|
-
"d9a79f01-2ce3-4be2-a28a-975f35c3c8ca": {
|
|
191
|
-
"connections": {
|
|
192
|
-
"outcome": "b93ce36e-1976-4610-b24f-8d6760b5463b"
|
|
193
|
-
},
|
|
194
|
-
"displayName": "Email Suspend Node",
|
|
195
|
-
"nodeType": "EmailSuspendNode",
|
|
196
|
-
"x": 563,
|
|
197
|
-
"y": 193
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
"description": "Forgotten Username Tree",
|
|
201
|
-
"staticNodes": {
|
|
202
|
-
"70e691a5-1e33-4ac3-a356-e7b6d60d92e0": {
|
|
203
|
-
"x": 970,
|
|
204
|
-
"y": 149
|
|
205
|
-
},
|
|
206
|
-
"e301438c-0bd0-429c-ab0c-66126501069a": {
|
|
207
|
-
"x": 982,
|
|
208
|
-
"y": 252
|
|
209
|
-
},
|
|
210
|
-
"startNode": {
|
|
211
|
-
"x": 50,
|
|
212
|
-
"y": 25
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|