@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,76 +0,0 @@
|
|
|
1
|
-
import storage from '../../storage/SessionStorage.js';
|
|
2
|
-
import * as global from '../../storage/StaticStorage.js';
|
|
3
|
-
|
|
4
|
-
// TODO: do we really need this? if yes: document
|
|
5
|
-
export function escapeRegExp(str) {
|
|
6
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// TODO: do we really need this? if yes: document
|
|
10
|
-
export function replaceAll(str, find, replace) {
|
|
11
|
-
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get new name when names collide
|
|
16
|
-
* @param {String} name to apply policy to
|
|
17
|
-
* @returns {String} new name according to policy
|
|
18
|
-
*/
|
|
19
|
-
export function applyNameCollisionPolicy(name) {
|
|
20
|
-
const capturingRegex = /(.* - imported) \(([0-9]+)\)/;
|
|
21
|
-
const found = name.match(capturingRegex);
|
|
22
|
-
if (found && found.length > 0 && found.length === 3) {
|
|
23
|
-
// already renamed one or more times
|
|
24
|
-
// return the next number
|
|
25
|
-
return `${found[1]} (${parseInt(found[2], 10) + 1})`;
|
|
26
|
-
}
|
|
27
|
-
// first time
|
|
28
|
-
return `${name} - imported (1)`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Get the name of the managed user object for the current realm
|
|
33
|
-
* @returns {String} the name of the managed user object for the current realm
|
|
34
|
-
*/
|
|
35
|
-
export function getRealmManagedUser() {
|
|
36
|
-
let realmManagedUser = 'user';
|
|
37
|
-
if (
|
|
38
|
-
storage.session.getDeploymentType() === global.CLOUD_DEPLOYMENT_TYPE_KEY
|
|
39
|
-
) {
|
|
40
|
-
realmManagedUser = `${storage.session.getRealm()}_user`;
|
|
41
|
-
}
|
|
42
|
-
return realmManagedUser;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Compare two json objects
|
|
47
|
-
* @param {Object} obj1 object 1
|
|
48
|
-
* @param {Object} obj2 object 2
|
|
49
|
-
* @param {[String]} ignoreKeys array of keys to ignore in comparison
|
|
50
|
-
* @returns {boolean} true if the two json objects have the same length and all the properties have the same value
|
|
51
|
-
*/
|
|
52
|
-
export function isEqualJson(obj1, obj2, ignoreKeys = []) {
|
|
53
|
-
const obj1Keys = Object.keys(obj1).filter((key) => !ignoreKeys.includes(key));
|
|
54
|
-
const obj2Keys = Object.keys(obj2).filter((key) => !ignoreKeys.includes(key));
|
|
55
|
-
|
|
56
|
-
if (obj1Keys.length !== obj2Keys.length) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
for (const objKey of obj1Keys) {
|
|
61
|
-
if (obj1[objKey] !== obj2[objKey]) {
|
|
62
|
-
if (
|
|
63
|
-
typeof obj1[objKey] === 'object' &&
|
|
64
|
-
typeof obj2[objKey] === 'object'
|
|
65
|
-
) {
|
|
66
|
-
if (!isEqualJson(obj1[objKey], obj2[objKey], ignoreKeys)) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default function wordwrap(str, len, indent = undefined) {
|
|
2
|
-
if (!str) return '';
|
|
3
|
-
return (
|
|
4
|
-
str.match(
|
|
5
|
-
new RegExp(
|
|
6
|
-
`(\\S.{0,${len - 1 - (indent ? indent.length : 0)}})(?=\\s+|$)`,
|
|
7
|
-
'g'
|
|
8
|
-
)
|
|
9
|
-
) || []
|
|
10
|
-
).join(indent ? `\n${indent}` : '\n');
|
|
11
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-return-assign */
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
// import pkg from '../../package.json' assert { type: 'json' };
|
|
4
|
-
|
|
5
|
-
const pkg = JSON.parse(
|
|
6
|
-
fs.readFileSync(new URL('../../package.json', import.meta.url))
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
const _sessionStorage = {};
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
session: {
|
|
13
|
-
setItem: (key, value) => (_sessionStorage[key] = value),
|
|
14
|
-
getItem: (key) => _sessionStorage[key],
|
|
15
|
-
removeItem: (key) => delete _sessionStorage[key],
|
|
16
|
-
raw: _sessionStorage,
|
|
17
|
-
setUsername: (value) => (_sessionStorage.username = value),
|
|
18
|
-
getUsername: () => _sessionStorage.username,
|
|
19
|
-
setPassword: (value) => (_sessionStorage.password = value),
|
|
20
|
-
getPassword: () => _sessionStorage.password,
|
|
21
|
-
setTenant: (value) => (_sessionStorage.tenant = value),
|
|
22
|
-
getTenant: () => _sessionStorage.tenant,
|
|
23
|
-
setDeploymentType: (value) => (_sessionStorage.deploymentType = value),
|
|
24
|
-
getDeploymentType: () => _sessionStorage.deploymentType,
|
|
25
|
-
setRealm: (value) => (_sessionStorage.realm = value),
|
|
26
|
-
getRealm: () => _sessionStorage.realm,
|
|
27
|
-
setCookieName: (value) => (_sessionStorage.cookieName = value),
|
|
28
|
-
getCookieName: () => _sessionStorage.cookieName,
|
|
29
|
-
setCookieValue: (value) => (_sessionStorage.cookieValue = value),
|
|
30
|
-
getCookieValue: () => _sessionStorage.cookieValue,
|
|
31
|
-
setBearerToken: (value) => (_sessionStorage.bearerToken = value),
|
|
32
|
-
getBearerToken: () => _sessionStorage.bearerToken,
|
|
33
|
-
setLogApiKey: (value) => (_sessionStorage.logApiKey = value),
|
|
34
|
-
getLogApiKey: () => _sessionStorage.logApiKey,
|
|
35
|
-
setLogApiSecret: (value) => (_sessionStorage.logApiSecret = value),
|
|
36
|
-
getLogApiSecret: () => _sessionStorage.logApiSecret,
|
|
37
|
-
setAmVersion: (value) => (_sessionStorage.amVersion = value),
|
|
38
|
-
getAmVersion: () => _sessionStorage.amVersion,
|
|
39
|
-
setFrodoVersion: (value) => (_sessionStorage.frodoVersion = value),
|
|
40
|
-
getFrodoVersion: () =>
|
|
41
|
-
_sessionStorage.frodoVersion || `v${pkg.version} [${process.version}]`,
|
|
42
|
-
setAllowInsecureConnection: (value) => (_sessionStorage.insecure = value),
|
|
43
|
-
getAllowInsecureConnection: () => _sessionStorage.insecure,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
|
|
4
|
-
const exec = promisify(cp.exec);
|
|
5
|
-
const CMD = 'frodo connections --help';
|
|
6
|
-
const { stdout } = await exec(CMD);
|
|
7
|
-
|
|
8
|
-
test("CLI help interface for 'connections' Usage should be expected english", async () => {
|
|
9
|
-
// Arrange
|
|
10
|
-
const expected = `
|
|
11
|
-
Usage: frodo connections [options] [command]
|
|
12
|
-
`.trim();
|
|
13
|
-
// Act
|
|
14
|
-
const testLine = stdout
|
|
15
|
-
.split(/\n/)
|
|
16
|
-
.find(line => line.trim().startsWith('Usage:'))
|
|
17
|
-
.trim();
|
|
18
|
-
// Assert
|
|
19
|
-
expect(testLine).toBe(expected);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test("CLI help interface connections description at line 2 should be expected english", async () => {
|
|
23
|
-
// Arrange
|
|
24
|
-
const expected = `
|
|
25
|
-
Manage connection profiles.
|
|
26
|
-
`.trim();
|
|
27
|
-
// Act
|
|
28
|
-
const testLine = stdout
|
|
29
|
-
.split(/\n/)
|
|
30
|
-
.map(line => line.trim())
|
|
31
|
-
.at(2)
|
|
32
|
-
// Assert
|
|
33
|
-
expect(testLine).toBe(expected);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
test("CLI help interface 'list' description should be expected english", async () => {
|
|
37
|
-
// Arrange
|
|
38
|
-
const expected = `
|
|
39
|
-
list List configured connections.
|
|
40
|
-
`.trim();
|
|
41
|
-
// Act
|
|
42
|
-
const testLine = stdout
|
|
43
|
-
.split(/\n/)
|
|
44
|
-
.find(line => line.trim().startsWith('list'))
|
|
45
|
-
.trim();
|
|
46
|
-
// Assert
|
|
47
|
-
expect(testLine).toBe(expected);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
test("CLI help interface 'delete' description should be expected english", async () => {
|
|
51
|
-
// Arrange
|
|
52
|
-
const expected = `
|
|
53
|
-
delete <host> Delete an existing connection profile (can also be done by editing '$HOME/.frodorc' in a text editor).
|
|
54
|
-
`.trim();
|
|
55
|
-
// Act
|
|
56
|
-
const testLine = stdout
|
|
57
|
-
.split(/\n/)
|
|
58
|
-
.find(line => line.trim().startsWith('delete'))
|
|
59
|
-
.trim();
|
|
60
|
-
// Assert
|
|
61
|
-
expect(testLine).toBe(expected);
|
|
62
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
|
|
4
|
-
const exec = promisify(cp.exec);
|
|
5
|
-
const CMD = 'frodo connections add --help';
|
|
6
|
-
const { stdout } = await exec(CMD);
|
|
7
|
-
|
|
8
|
-
test("CLI help interface for 'add' Usage should be expected english", async () => {
|
|
9
|
-
// Arrange
|
|
10
|
-
const expected = `
|
|
11
|
-
Usage: frodo connections add [options] <host> <user> <password> [key] [secret]
|
|
12
|
-
`.trim();
|
|
13
|
-
// Act
|
|
14
|
-
const testLine = stdout
|
|
15
|
-
.split(/\n/)
|
|
16
|
-
.find(line => line.trim().startsWith('Usage:'))
|
|
17
|
-
.trim();
|
|
18
|
-
// Assert
|
|
19
|
-
expect(testLine).toBe(expected);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test("CLI help interface 'connections add' description at line 2 should be expected english", async () => {
|
|
23
|
-
// Arrange
|
|
24
|
-
const expected = `
|
|
25
|
-
Add a new connection. You have to specify a URL, username and password at a minimum.
|
|
26
|
-
`.trim();
|
|
27
|
-
// Act
|
|
28
|
-
const testLine = stdout
|
|
29
|
-
.split(/\n/)
|
|
30
|
-
.map(line => line.trim())
|
|
31
|
-
.at(2)
|
|
32
|
-
// Assert
|
|
33
|
-
expect(testLine).toBe(expected);
|
|
34
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
|
|
4
|
-
const exec = promisify(cp.exec);
|
|
5
|
-
const CMD = 'frodo connections delete --help';
|
|
6
|
-
const { stdout } = await exec(CMD);
|
|
7
|
-
|
|
8
|
-
test("CLI help interface for 'delete' Usage should be expected english", async () => {
|
|
9
|
-
// Arrange
|
|
10
|
-
const expected = `
|
|
11
|
-
Usage: frodo connections delete [options] <host>
|
|
12
|
-
`.trim();
|
|
13
|
-
// Act
|
|
14
|
-
const testLine = stdout
|
|
15
|
-
.split(/\n/)
|
|
16
|
-
.find(line => line.trim().startsWith('Usage:'))
|
|
17
|
-
.trim();
|
|
18
|
-
// Assert
|
|
19
|
-
expect(testLine).toBe(expected);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test("CLI help interface 'connections delete' description at line 2 should be expected english", async () => {
|
|
23
|
-
// Arrange
|
|
24
|
-
const expected = `
|
|
25
|
-
Delete an existing connection profile (can also be done by editing '$HOME/.frodorc' in a text editor).
|
|
26
|
-
`.trim();
|
|
27
|
-
// Act
|
|
28
|
-
const testLine = stdout
|
|
29
|
-
.split(/\n/)
|
|
30
|
-
.map(line => line.trim())
|
|
31
|
-
.at(2)
|
|
32
|
-
// Assert
|
|
33
|
-
expect(testLine).toBe(expected);
|
|
34
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
|
|
4
|
-
const exec = promisify(cp.exec);
|
|
5
|
-
const CMD = 'frodo connections list --help';
|
|
6
|
-
const { stdout } = await exec(CMD);
|
|
7
|
-
|
|
8
|
-
test("CLI help interface for 'list' Usage should be expected english", async () => {
|
|
9
|
-
// Arrange
|
|
10
|
-
const expected = `
|
|
11
|
-
Usage: frodo connections list [options]
|
|
12
|
-
`.trim();
|
|
13
|
-
// Act
|
|
14
|
-
const testLine = stdout
|
|
15
|
-
.split(/\n/)
|
|
16
|
-
.find(line => line.trim().startsWith('Usage:'))
|
|
17
|
-
.trim();
|
|
18
|
-
// Assert
|
|
19
|
-
expect(testLine).toBe(expected);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test("CLI help interface 'connections List' description at line 2 should be expected english", async () => {
|
|
23
|
-
// Arrange
|
|
24
|
-
const expected = `
|
|
25
|
-
List configured connections.
|
|
26
|
-
`.trim();
|
|
27
|
-
// Act
|
|
28
|
-
const testLine = stdout
|
|
29
|
-
.split(/\n/)
|
|
30
|
-
.map(line => line.trim())
|
|
31
|
-
.at(2)
|
|
32
|
-
// Assert
|
|
33
|
-
expect(testLine).toBe(expected);
|
|
34
|
-
});
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
|
|
4
|
-
const exec = promisify(cp.exec);
|
|
5
|
-
const CMD = 'frodo email_templates --help';
|
|
6
|
-
const { stdout } = await exec(CMD);
|
|
7
|
-
|
|
8
|
-
test("CLI help interface for 'email_templates' Usage should be expected english", async () => {
|
|
9
|
-
// Arrange
|
|
10
|
-
const expected = `
|
|
11
|
-
Usage: frodo email_templates [options] [command]
|
|
12
|
-
`.trim();
|
|
13
|
-
// Act
|
|
14
|
-
const testLine = stdout
|
|
15
|
-
.split(/\n/)
|
|
16
|
-
.find(line => line.trim().startsWith('Usage:'))
|
|
17
|
-
.trim();
|
|
18
|
-
// Assert
|
|
19
|
-
expect(testLine).toBe(expected);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
test("CLI help interface 'email_templates' description at line 2 should be expected english", async () => {
|
|
24
|
-
// Arrange
|
|
25
|
-
const expected = `
|
|
26
|
-
Manage email templates.
|
|
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
|
-
test("CLI help interface 'email_templates commands list' description should be expected english", async () => {
|
|
38
|
-
// Arrange
|
|
39
|
-
const expected = `
|
|
40
|
-
list [options] <host> [user] [password] List all the email templates in the system.
|
|
41
|
-
`.trim();
|
|
42
|
-
// Act
|
|
43
|
-
const testLine = stdout
|
|
44
|
-
.split(/\n/)
|
|
45
|
-
.find(line => line.trim().startsWith('list'))
|
|
46
|
-
.trim();
|
|
47
|
-
// Assert
|
|
48
|
-
expect(testLine).toBe(expected);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("CLI help interface 'email_templates commands export' description should be expected english", async () => {
|
|
52
|
-
// Arrange
|
|
53
|
-
const expected = `
|
|
54
|
-
export [options] <host> [user] [password] Export email templates.
|
|
55
|
-
`.trim();
|
|
56
|
-
// Act
|
|
57
|
-
const testLine = stdout
|
|
58
|
-
.split(/\n/)
|
|
59
|
-
.find(line => line.trim().startsWith('export'))
|
|
60
|
-
.trim();
|
|
61
|
-
// Assert
|
|
62
|
-
expect(testLine).toBe(expected);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test("CLI help interface 'email_templates commands import' description should be expected english", async () => {
|
|
66
|
-
// Arrange
|
|
67
|
-
const expected = `
|
|
68
|
-
import [options] <host> [user] [password] Import email template.
|
|
69
|
-
`.trim();
|
|
70
|
-
// Act
|
|
71
|
-
const testLine = stdout
|
|
72
|
-
.split(/\n/)
|
|
73
|
-
.find(line => line.trim().startsWith('import'))
|
|
74
|
-
.trim();
|
|
75
|
-
// Assert
|
|
76
|
-
expect(testLine).toBe(expected);
|
|
77
|
-
});
|
|
@@ -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 email_templates export --help';
|
|
7
|
-
const { stdout } = await exec(CMD);
|
|
8
|
-
|
|
9
|
-
test("CLI help interface for 'email_templates export' Usage should be expected english", async () => {
|
|
10
|
-
// Arrange
|
|
11
|
-
const expected = `
|
|
12
|
-
Usage: frodo email_templates export [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
|
-
test("CLI help interface 'email_templates export' description at line 2 should be expected english", async () => {
|
|
24
|
-
// Arrange
|
|
25
|
-
const expected = `
|
|
26
|
-
Export email templates.
|
|
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
|
-
' user '
|
|
50
|
-
));
|
|
51
|
-
|
|
52
|
-
// Assert
|
|
53
|
-
expect(testLine).toBe(expected);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
test("CLI help interface 'export 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
|
-
|
|
70
|
-
// Assert
|
|
71
|
-
expect(testLine).toBe(expected);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
test("CLI help interface 'export argument password' description should be expected english", async () => {
|
|
75
|
-
// Arrange
|
|
76
|
-
const expectedDescription = `
|
|
77
|
-
password Password.
|
|
78
|
-
`.trim();
|
|
79
|
-
// Act
|
|
80
|
-
const testLine = stdout
|
|
81
|
-
.split(/\n/)
|
|
82
|
-
.find(line => line.trim().startsWith('password'))
|
|
83
|
-
.trim();
|
|
84
|
-
// Assert
|
|
85
|
-
expect(testLine).toBe(expectedDescription);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
test("CLI help interface 'export option -m, --type <type>' description should be expected english multiline", async () => {
|
|
89
|
-
// Arrange
|
|
90
|
-
const expected = collapseWhitespace(`
|
|
91
|
-
-m, --type <type> Override auto-detected deployment type. Valid values for
|
|
92
|
-
type:
|
|
93
|
-
classic: A classic Access Management-only deployment
|
|
94
|
-
with custom layout and configuration.
|
|
95
|
-
cloud: A ForgeRock Identity Cloud environment.
|
|
96
|
-
forgeops: A ForgeOps CDK or CDM deployment.
|
|
97
|
-
The detected or provided deployment type controls certain
|
|
98
|
-
behavior like obtaining an Identity Management admin
|
|
99
|
-
token or not and whether to export/import referenced
|
|
100
|
-
email templates or how to walk through the tenant admin
|
|
101
|
-
login flow of Identity Cloud and handle MFA (choices:
|
|
102
|
-
"classic", "cloud", "forgeops")
|
|
103
|
-
`);
|
|
104
|
-
// Act
|
|
105
|
-
const testLine = collapseWhitespace(crudeMultilineTakeUntil(
|
|
106
|
-
stdout,
|
|
107
|
-
' -m, --type <type> ',
|
|
108
|
-
' -k, --insecure '
|
|
109
|
-
));
|
|
110
|
-
|
|
111
|
-
// Assert
|
|
112
|
-
expect(testLine).toBe(expected);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
test("CLI help interface 'export option -k, --insecure' description should be expected english multiline", async () => {
|
|
117
|
-
// Arrange
|
|
118
|
-
const expected = collapseWhitespace(`
|
|
119
|
-
-k, --insecure Allow insecure connections when using SSL/TLS (default: Don't
|
|
120
|
-
allow insecure connections)
|
|
121
|
-
`);
|
|
122
|
-
// Act
|
|
123
|
-
const testLine = collapseWhitespace(crudeMultilineTakeUntil(
|
|
124
|
-
stdout,
|
|
125
|
-
' -k, --insecure ',
|
|
126
|
-
' -t, --template <template> ',
|
|
127
|
-
));
|
|
128
|
-
|
|
129
|
-
// Assert
|
|
130
|
-
expect(testLine).toBe(expected);
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
test("CLI help interface 'export option -t, --template <template>' description should be expected english multiline", async () => {
|
|
134
|
-
// Arrange
|
|
135
|
-
const expected = collapseWhitespace(`
|
|
136
|
-
-t, --template <template> Name of email template. If specified, -a and -A
|
|
137
|
-
are ignored.
|
|
138
|
-
`);
|
|
139
|
-
// Act
|
|
140
|
-
const testLine = collapseWhitespace(crudeMultilineTakeUntil(
|
|
141
|
-
stdout,
|
|
142
|
-
' -t, --template <template> ',
|
|
143
|
-
' -f, --file <file> '
|
|
144
|
-
));
|
|
145
|
-
|
|
146
|
-
// Assert
|
|
147
|
-
expect(testLine).toBe(expected);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
test("CLI help interface 'export option -f, --file <file>' description should be expected english", async () => {
|
|
151
|
-
// Arrange
|
|
152
|
-
const expected = collapseWhitespace(`
|
|
153
|
-
-f, --file <file> Name of the file to write the exported email template(s) to.
|
|
154
|
-
Ignored with -A.
|
|
155
|
-
`);
|
|
156
|
-
// Act
|
|
157
|
-
const testLine = collapseWhitespace(crudeMultilineTakeUntil(
|
|
158
|
-
stdout,
|
|
159
|
-
' -f, --file <file> ',
|
|
160
|
-
' -a, --all '
|
|
161
|
-
));
|
|
162
|
-
// Assert
|
|
163
|
-
expect(testLine).toBe(expected);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
test("CLI help interface 'export option -a, --all' description should be expected english", async () => {
|
|
167
|
-
// Arrange
|
|
168
|
-
const expected = collapseWhitespace(`
|
|
169
|
-
-a, --all Export all the email templates in the system. Ignored with
|
|
170
|
-
-t.
|
|
171
|
-
`);
|
|
172
|
-
// Act
|
|
173
|
-
const testLine = collapseWhitespace(crudeMultilineTakeUntil(
|
|
174
|
-
stdout,
|
|
175
|
-
' -a, --all ',
|
|
176
|
-
' -A, --allSeparate ',
|
|
177
|
-
));
|
|
178
|
-
// Assert
|
|
179
|
-
expect(testLine).toBe(expected);
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
test("CLI help interface 'export option -A, --allSeparate' description should be expected english", async () => {
|
|
183
|
-
// Arrange
|
|
184
|
-
const expected = collapseWhitespace(`
|
|
185
|
-
-A, --allSeparate Export all the email templates as separate
|
|
186
|
-
files <template>.json. Ignored with -s or -a.
|
|
187
|
-
`);
|
|
188
|
-
// Act
|
|
189
|
-
const testLine = collapseWhitespace(crudeMultilineTakeUntil(
|
|
190
|
-
stdout,
|
|
191
|
-
' -A, --allSeparate ',
|
|
192
|
-
' -h, --help ',
|
|
193
|
-
));
|
|
194
|
-
// Assert
|
|
195
|
-
expect(testLine).toBe(expected);
|
|
196
|
-
});
|