@rockcarver/frodo-cli 0.11.1-0 → 0.11.1-1
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 +5 -1
- package/package.json +12 -10
- package/src/app.js +3 -3
- 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 -213
- package/.github/workflows/pipeline.yml +0 -495
- 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/cli/journey/journey-delete.e2e.test_.js +0 -380
- package/src/cli/journey/journey-list.e2e.test_.js +0 -142
- package/src/cli/theme/theme-delete.e2e.test_.js +0 -178
- package/src/cli/theme/theme-list.e2e.test_.js +0 -119
- package/test/client_cli/en/conn-add.test.js +0 -37
- package/test/client_cli/en/conn-delete.test.js +0 -37
- package/test/client_cli/en/conn-list.test.js +0 -37
- package/test/client_cli/en/conn.test.js +0 -65
- package/test/client_cli/en/email-template-import.test.js +0 -156
- package/test/client_cli/en/email-template.test.js +0 -79
- package/test/client_cli/en/email-templates-export.test.js +0 -208
- package/test/client_cli/en/email-templates-list.test.js +0 -139
- package/test/client_cli/en/idm-count.test.js +0 -131
- package/test/client_cli/en/idm-export.test.js +0 -149
- package/test/client_cli/en/idm-import.test_.js +0 -101
- package/test/client_cli/en/idm-list.test.js +0 -109
- package/test/client_cli/en/idm.test.js +0 -82
- package/test/client_cli/en/info.test.js +0 -136
- package/test/client_cli/en/journey-describe.test.js +0 -194
- package/test/client_cli/en/journey-export.test.js +0 -231
- package/test/client_cli/en/journey-import.test.js +0 -212
- package/test/client_cli/en/journey-list.test.js +0 -173
- package/test/client_cli/en/journey-prune.test.js +0 -159
- package/test/client_cli/en/journey.test.js +0 -111
- package/test/client_cli/en/logs-list.test.js +0 -81
- package/test/client_cli/en/logs-tail.test.js +0 -130
- package/test/client_cli/en/logs.test.js +0 -65
- package/test/client_cli/en/root.test.js +0 -93
- package/test/client_cli/en/script-export.test.js +0 -230
- package/test/client_cli/en/script-import.test.js +0 -176
- package/test/client_cli/en/script-list.test.js +0 -159
- package/test/client_cli/en/script.test.js +0 -79
- package/test/client_cli/utils/utils.js +0 -63
- 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/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
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import {
|
|
4
|
-
crudeMultilineTakeUntil,
|
|
5
|
-
collapseWhitespace,
|
|
6
|
-
node14Compatibility,
|
|
7
|
-
} from '../utils/utils.js';
|
|
8
|
-
|
|
9
|
-
node14Compatibility();
|
|
10
|
-
|
|
11
|
-
const exec = promisify(cp.exec);
|
|
12
|
-
const CMD = 'frodo journey prune --help';
|
|
13
|
-
const { stdout } = await exec(CMD);
|
|
14
|
-
|
|
15
|
-
test("CLI help interface for 'journey prune' Usage should be expected english", async () => {
|
|
16
|
-
// Arrange
|
|
17
|
-
const expected = `
|
|
18
|
-
Usage: frodo journey prune [options] <host> [realm] [user] [password]
|
|
19
|
-
`.trim();
|
|
20
|
-
// Act
|
|
21
|
-
const testLine = stdout
|
|
22
|
-
.split(/\n/)
|
|
23
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
24
|
-
.trim();
|
|
25
|
-
// Assert
|
|
26
|
-
expect(testLine).toBe(expected);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test("CLI help interface 'journey prune' description at line 2 should be expected english", async () => {
|
|
30
|
-
// Arrange
|
|
31
|
-
const expected = `
|
|
32
|
-
Prune orphaned configuration artifacts left behind after deleting authentication trees. You will be prompted before any destructive operations are performed.
|
|
33
|
-
`.trim();
|
|
34
|
-
// Act
|
|
35
|
-
const testLine = stdout
|
|
36
|
-
.split(/\n/)
|
|
37
|
-
.map((line) => line.trim())
|
|
38
|
-
.at(2);
|
|
39
|
-
// Assert
|
|
40
|
-
expect(testLine).toBe(expected);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test("CLI help interface 'prune argument host' description should be expected english multiline", async () => {
|
|
44
|
-
// Arrange
|
|
45
|
-
const expected = collapseWhitespace(`
|
|
46
|
-
host Access Management base URL, e.g.:
|
|
47
|
-
https://cdk.iam.example.com/am. To use a connection
|
|
48
|
-
profile, just specify a unique substring.
|
|
49
|
-
`);
|
|
50
|
-
// Act
|
|
51
|
-
const testLine = collapseWhitespace(
|
|
52
|
-
crudeMultilineTakeUntil(
|
|
53
|
-
stdout,
|
|
54
|
-
' host ',
|
|
55
|
-
' realm '
|
|
56
|
-
)
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
// Assert
|
|
60
|
-
expect(testLine).toBe(expected);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test("CLI help interface 'prune argument realm' description should be expected english multiline", async () => {
|
|
64
|
-
// Arrange
|
|
65
|
-
const expected = collapseWhitespace(`
|
|
66
|
-
realm Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise. (default: "alpha" for Identity Cloud tenants, "/" otherwise.)
|
|
67
|
-
`);
|
|
68
|
-
// Act
|
|
69
|
-
const testLine = collapseWhitespace(
|
|
70
|
-
crudeMultilineTakeUntil(
|
|
71
|
-
stdout,
|
|
72
|
-
' realm ',
|
|
73
|
-
' user '
|
|
74
|
-
)
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// Assert
|
|
78
|
-
expect(testLine).toBe(expected);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
test("CLI help interface 'prune argument user' description should be expected english multiline", async () => {
|
|
82
|
-
// Arrange
|
|
83
|
-
const expected = collapseWhitespace(`
|
|
84
|
-
user Username to login with. Must be an admin user with appropriate
|
|
85
|
-
rights to manage authentication journeys/trees.
|
|
86
|
-
`);
|
|
87
|
-
// Act
|
|
88
|
-
const testLine = collapseWhitespace(
|
|
89
|
-
crudeMultilineTakeUntil(
|
|
90
|
-
stdout,
|
|
91
|
-
' user ',
|
|
92
|
-
' password '
|
|
93
|
-
)
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
// Assert
|
|
97
|
-
expect(testLine).toBe(expected);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
test("CLI help interface 'prune argument password' description should be expected english", async () => {
|
|
101
|
-
// Arrange
|
|
102
|
-
const expectedDescription = `
|
|
103
|
-
password Password.
|
|
104
|
-
`.trim();
|
|
105
|
-
// Act
|
|
106
|
-
const testLine = stdout
|
|
107
|
-
.split(/\n/)
|
|
108
|
-
.find((line) => line.trim().startsWith('password'))
|
|
109
|
-
.trim();
|
|
110
|
-
// Assert
|
|
111
|
-
expect(testLine).toBe(expectedDescription);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
test("CLI help interface 'prune option -m, --type <type>' description should be expected english multiline", async () => {
|
|
115
|
-
// Arrange
|
|
116
|
-
const expected = collapseWhitespace(`
|
|
117
|
-
-m, --type <type> Override auto-detected deployment type. Valid values for
|
|
118
|
-
type:
|
|
119
|
-
classic: A classic Access Management-only deployment
|
|
120
|
-
with custom layout and configuration.
|
|
121
|
-
cloud: A ForgeRock Identity Cloud environment.
|
|
122
|
-
forgeops: A ForgeOps CDK or CDM deployment.
|
|
123
|
-
The detected or provided deployment type controls certain
|
|
124
|
-
behavior like obtaining an Identity Management admin
|
|
125
|
-
token or not and whether to export/import referenced
|
|
126
|
-
email templates or how to walk through the tenant admin
|
|
127
|
-
login flow of Identity Cloud and handle MFA (choices:
|
|
128
|
-
"classic", "cloud", "forgeops")
|
|
129
|
-
`);
|
|
130
|
-
// Act
|
|
131
|
-
const testLine = collapseWhitespace(
|
|
132
|
-
crudeMultilineTakeUntil(
|
|
133
|
-
stdout,
|
|
134
|
-
' -m, --type <type> ',
|
|
135
|
-
' -k, --insecure '
|
|
136
|
-
)
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
// Assert
|
|
140
|
-
expect(testLine).toBe(expected);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
test("CLI help interface 'prune option -k, --insecure' description should be expected english multiline", async () => {
|
|
144
|
-
// Arrange
|
|
145
|
-
const expected = collapseWhitespace(`
|
|
146
|
-
-k, --insecure Allow insecure connections when using SSL/TLS. Has no effect when using a network proxy for https (HTTPS_PROXY=http://<host>:<port>), in that case the proxy must provide this capability. (default: Don't allow insecure connections)
|
|
147
|
-
`);
|
|
148
|
-
// Act
|
|
149
|
-
const testLine = collapseWhitespace(
|
|
150
|
-
crudeMultilineTakeUntil(
|
|
151
|
-
stdout,
|
|
152
|
-
' -k, --insecure ',
|
|
153
|
-
' -h, --help '
|
|
154
|
-
)
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
// Assert
|
|
158
|
-
expect(testLine).toBe(expected);
|
|
159
|
-
});
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import {
|
|
4
|
-
crudeMultilineTakeUntil,
|
|
5
|
-
collapseWhitespace,
|
|
6
|
-
node14Compatibility,
|
|
7
|
-
} from '../utils/utils.js';
|
|
8
|
-
|
|
9
|
-
node14Compatibility();
|
|
10
|
-
|
|
11
|
-
const exec = promisify(cp.exec);
|
|
12
|
-
const CMD = 'frodo journey --help';
|
|
13
|
-
const { stdout } = await exec(CMD);
|
|
14
|
-
|
|
15
|
-
test("CLI help interface for 'journey' Usage should be expected english", async () => {
|
|
16
|
-
// Arrange
|
|
17
|
-
const expected = `
|
|
18
|
-
Usage: frodo journey [options] [command]
|
|
19
|
-
`.trim();
|
|
20
|
-
// Act
|
|
21
|
-
const testLine = stdout
|
|
22
|
-
.split(/\n/)
|
|
23
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
24
|
-
.trim();
|
|
25
|
-
// Assert
|
|
26
|
-
expect(testLine).toBe(expected);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test("CLI help interface 'journey' description at line 2 should be expected english", async () => {
|
|
30
|
-
// Arrange
|
|
31
|
-
const expected = `
|
|
32
|
-
Manage journeys/trees.
|
|
33
|
-
`.trim();
|
|
34
|
-
// Act
|
|
35
|
-
const testLine = stdout
|
|
36
|
-
.split(/\n/)
|
|
37
|
-
.map((line) => line.trim())
|
|
38
|
-
.at(2);
|
|
39
|
-
// Assert
|
|
40
|
-
expect(testLine).toBe(expected);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test("CLI help interface 'journey commands list' description should be expected english", async () => {
|
|
44
|
-
// Arrange
|
|
45
|
-
const expected = `
|
|
46
|
-
list List journeys/trees.
|
|
47
|
-
`.trim();
|
|
48
|
-
// Act
|
|
49
|
-
const testLine = stdout
|
|
50
|
-
.split(/\n/)
|
|
51
|
-
.find((line) => line.trim().startsWith('list'))
|
|
52
|
-
.trim();
|
|
53
|
-
// Assert
|
|
54
|
-
expect(testLine).toBe(expected);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
test("CLI help interface 'journey commands describe' description should be expected english", async () => {
|
|
58
|
-
// Arrange
|
|
59
|
-
const expected = collapseWhitespace(`
|
|
60
|
-
describe If host argument is supplied, describe the journey/tree indicated by -t, or all journeys/trees in the realm if no
|
|
61
|
-
-t is supplied, otherwise describe the journey/tree export file indicated by -f.
|
|
62
|
-
`);
|
|
63
|
-
// Act
|
|
64
|
-
const testLine = collapseWhitespace(
|
|
65
|
-
crudeMultilineTakeUntil(stdout, ' describe ', ' export ')
|
|
66
|
-
);
|
|
67
|
-
// Assert
|
|
68
|
-
expect(testLine).toBe(expected);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
test("CLI help interface 'journey commands export' description should be expected english", async () => {
|
|
72
|
-
// Arrange
|
|
73
|
-
const expected = `
|
|
74
|
-
export 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 Import journeys/trees.
|
|
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 prune' description should be expected english", async () => {
|
|
100
|
-
// Arrange
|
|
101
|
-
const expected = collapseWhitespace(`
|
|
102
|
-
prune Prune orphaned configuration artifacts left behind after deleting authentication trees. You will be prompted before
|
|
103
|
-
any destructive operations are performed.
|
|
104
|
-
`);
|
|
105
|
-
// Act
|
|
106
|
-
const testLine = collapseWhitespace(
|
|
107
|
-
crudeMultilineTakeUntil(stdout, ' prune ', ' help [command] ')
|
|
108
|
-
);
|
|
109
|
-
// Assert
|
|
110
|
-
expect(testLine).toBe(expected);
|
|
111
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import {
|
|
4
|
-
crudeMultilineTakeUntil,
|
|
5
|
-
collapseWhitespace,
|
|
6
|
-
node14Compatibility,
|
|
7
|
-
} from '../utils/utils.js';
|
|
8
|
-
|
|
9
|
-
node14Compatibility();
|
|
10
|
-
|
|
11
|
-
const exec = promisify(cp.exec);
|
|
12
|
-
const CMD = 'frodo logs list --help';
|
|
13
|
-
const { stdout } = await exec(CMD);
|
|
14
|
-
|
|
15
|
-
test("CLI help interface for 'logs list' Usage should be expected english", async () => {
|
|
16
|
-
// Arrange
|
|
17
|
-
const expected = `
|
|
18
|
-
Usage: frodo journey list [options] <host> [user] [password]
|
|
19
|
-
`.trim();
|
|
20
|
-
// Act
|
|
21
|
-
const testLine = stdout
|
|
22
|
-
.split(/\n/)
|
|
23
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
24
|
-
.trim();
|
|
25
|
-
// Assert
|
|
26
|
-
expect(testLine).toBe(expected);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test("CLI help interface 'logs list' description at line 2 should be expected english", async () => {
|
|
30
|
-
// Arrange
|
|
31
|
-
const expected = `
|
|
32
|
-
List available ID Cloud log sources.
|
|
33
|
-
`.trim();
|
|
34
|
-
// Act
|
|
35
|
-
const testLine = stdout
|
|
36
|
-
.split(/\n/)
|
|
37
|
-
.map((line) => line.trim())
|
|
38
|
-
.at(2);
|
|
39
|
-
// Assert
|
|
40
|
-
expect(testLine).toBe(expected);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test("CLI help interface 'list argument host' description should be expected english", async () => {
|
|
44
|
-
// Arrange
|
|
45
|
-
const expected = collapseWhitespace(`
|
|
46
|
-
host Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a
|
|
47
|
-
unique substring.
|
|
48
|
-
`).trim();
|
|
49
|
-
// Act
|
|
50
|
-
const testLine = collapseWhitespace(
|
|
51
|
-
crudeMultilineTakeUntil(stdout, ' host ', ' user ')
|
|
52
|
-
);
|
|
53
|
-
// Assert
|
|
54
|
-
expect(collapseWhitespace(testLine)).toBe(expected);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
test("CLI help interface 'list argument user' description should be expected english", async () => {
|
|
58
|
-
// Arrange
|
|
59
|
-
const expected = collapseWhitespace(`
|
|
60
|
-
user Username to login with. Must be an admin user with appropriate rights to manage authentication journeys/trees.
|
|
61
|
-
`).trim();
|
|
62
|
-
// Act
|
|
63
|
-
const testLine = collapseWhitespace(
|
|
64
|
-
crudeMultilineTakeUntil(stdout, ' user ', ' password ')
|
|
65
|
-
);
|
|
66
|
-
// Assert
|
|
67
|
-
expect(collapseWhitespace(testLine)).toBe(expected);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test("CLI help interface 'tail argument password' description should be expected english", async () => {
|
|
71
|
-
// Arrange
|
|
72
|
-
const expected = collapseWhitespace(`
|
|
73
|
-
password Password.
|
|
74
|
-
`).trim();
|
|
75
|
-
// Act
|
|
76
|
-
const testLine = collapseWhitespace(
|
|
77
|
-
crudeMultilineTakeUntil(stdout, ' password ', 'Options:')
|
|
78
|
-
);
|
|
79
|
-
// Assert
|
|
80
|
-
expect(collapseWhitespace(testLine)).toBe(expected);
|
|
81
|
-
});
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import {
|
|
4
|
-
crudeMultilineTakeUntil,
|
|
5
|
-
collapseWhitespace,
|
|
6
|
-
node14Compatibility,
|
|
7
|
-
} from '../utils/utils.js';
|
|
8
|
-
|
|
9
|
-
node14Compatibility();
|
|
10
|
-
|
|
11
|
-
const exec = promisify(cp.exec);
|
|
12
|
-
const CMD = 'frodo logs tail --help';
|
|
13
|
-
const { stdout } = await exec(CMD);
|
|
14
|
-
|
|
15
|
-
test("CLI help interface for 'logs tail' Usage should be expected english", async () => {
|
|
16
|
-
// Arrange
|
|
17
|
-
const expected = `
|
|
18
|
-
Usage: frodo journey tail [options] <host> [user] [password]
|
|
19
|
-
`.trim();
|
|
20
|
-
// Act
|
|
21
|
-
const testLine = stdout
|
|
22
|
-
.split(/\n/)
|
|
23
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
24
|
-
.trim();
|
|
25
|
-
// Assert
|
|
26
|
-
expect(testLine).toBe(expected);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test("CLI help interface 'logs tail' description at line 2 should be expected english", async () => {
|
|
30
|
-
// Arrange
|
|
31
|
-
const expected = `
|
|
32
|
-
Tail Identity Cloud logs.
|
|
33
|
-
`.trim();
|
|
34
|
-
// Act
|
|
35
|
-
const testLine = stdout
|
|
36
|
-
.split(/\n/)
|
|
37
|
-
.map((line) => line.trim())
|
|
38
|
-
.at(2);
|
|
39
|
-
// Assert
|
|
40
|
-
expect(testLine).toBe(expected);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test("CLI help interface 'tail argument host' description should be expected english", async () => {
|
|
44
|
-
// Arrange
|
|
45
|
-
const expected = collapseWhitespace(`
|
|
46
|
-
host Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just
|
|
47
|
-
specify a unique substring.
|
|
48
|
-
`).trim();
|
|
49
|
-
// Act
|
|
50
|
-
const testLine = collapseWhitespace(
|
|
51
|
-
crudeMultilineTakeUntil(
|
|
52
|
-
stdout,
|
|
53
|
-
' host ',
|
|
54
|
-
' user '
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
// Assert
|
|
58
|
-
expect(collapseWhitespace(testLine)).toBe(expected);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
test("CLI help interface 'tail argument key' description should be expected english", async () => {
|
|
62
|
-
// Arrange
|
|
63
|
-
const expected = collapseWhitespace(`
|
|
64
|
-
user Username to login with. Must be an admin user with appropriate rights to manage authentication
|
|
65
|
-
journeys/trees.
|
|
66
|
-
`).trim();
|
|
67
|
-
// Act
|
|
68
|
-
const testLine = collapseWhitespace(
|
|
69
|
-
crudeMultilineTakeUntil(
|
|
70
|
-
stdout,
|
|
71
|
-
' user ',
|
|
72
|
-
' password '
|
|
73
|
-
)
|
|
74
|
-
);
|
|
75
|
-
// Assert
|
|
76
|
-
expect(collapseWhitespace(testLine)).toBe(expected);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test("CLI help interface 'tail argument secret' description should be expected english", async () => {
|
|
80
|
-
// Arrange
|
|
81
|
-
const expected = collapseWhitespace(`
|
|
82
|
-
password Password.
|
|
83
|
-
`).trim();
|
|
84
|
-
// Act
|
|
85
|
-
const testLine = collapseWhitespace(
|
|
86
|
-
crudeMultilineTakeUntil(
|
|
87
|
-
stdout,
|
|
88
|
-
' password ',
|
|
89
|
-
'Options:'
|
|
90
|
-
)
|
|
91
|
-
);
|
|
92
|
-
// Assert
|
|
93
|
-
expect(collapseWhitespace(testLine)).toBe(expected);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
test("CLI help interface 'list option -k, --insecure' description should be expected english multiline", async () => {
|
|
97
|
-
// Arrange
|
|
98
|
-
const expected = collapseWhitespace(`
|
|
99
|
-
-k, --insecure Allow insecure connections when using SSL/TLS. Has no effect when using a network proxy for https (HTTPS_PROXY=http://<host>:<port>), in that case the proxy must provide this capability. (default: Don't allow insecure connections)
|
|
100
|
-
`);
|
|
101
|
-
// Act
|
|
102
|
-
const testLine = collapseWhitespace(
|
|
103
|
-
crudeMultilineTakeUntil(
|
|
104
|
-
stdout,
|
|
105
|
-
' -k, --insecure ',
|
|
106
|
-
' -c, --sources <sources> '
|
|
107
|
-
)
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
// Assert
|
|
111
|
-
expect(testLine).toBe(expected);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
test("CLI help interface 'list option -c, --sources <sources>' description should be expected english multiline", async () => {
|
|
115
|
-
// Arrange
|
|
116
|
-
const expected = collapseWhitespace(`
|
|
117
|
-
-c, --sources <sources> Comma separated list of log sources (default: Log everything) -l, --level <level> Set log level filter. You can specify the level as a number or a string. Following values are possible (values on the same line are equivalent): 0, SEVERE, FATAL, or ERROR 1, WARNING, WARN or CONFIG 2, INFO or INFORMATION 3, DEBUG, FINE, FINER or FINEST 4 or ALL (default: SEVERE,ERROR,FATAL) -t, --transaction-id <txid> Filter by transactionId
|
|
118
|
-
`);
|
|
119
|
-
// Act
|
|
120
|
-
const testLine = collapseWhitespace(
|
|
121
|
-
crudeMultilineTakeUntil(
|
|
122
|
-
stdout,
|
|
123
|
-
' -c, --sources <sources>',
|
|
124
|
-
' -h, --help '
|
|
125
|
-
)
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
// Assert
|
|
129
|
-
expect(testLine).toBe(expected);
|
|
130
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import { node14Compatibility } from '../utils/utils.js';
|
|
4
|
-
|
|
5
|
-
node14Compatibility();
|
|
6
|
-
|
|
7
|
-
const exec = promisify(cp.exec);
|
|
8
|
-
const CMD = 'frodo logs --help';
|
|
9
|
-
const { stdout } = await exec(CMD);
|
|
10
|
-
|
|
11
|
-
test("CLI help interface for 'logs' Usage should be expected english", async () => {
|
|
12
|
-
// Arrange
|
|
13
|
-
const expected = `
|
|
14
|
-
Usage: frodo logs [options] [command]
|
|
15
|
-
`.trim();
|
|
16
|
-
// Act
|
|
17
|
-
const testLine = stdout
|
|
18
|
-
.split(/\n/)
|
|
19
|
-
.find((line) => line.trim().startsWith('Usage:'))
|
|
20
|
-
.trim();
|
|
21
|
-
// Assert
|
|
22
|
-
expect(testLine).toBe(expected);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("CLI help interface 'logs' description at line 2 should be expected english", async () => {
|
|
26
|
-
// Arrange
|
|
27
|
-
const expected = `
|
|
28
|
-
View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.
|
|
29
|
-
`.trim();
|
|
30
|
-
// Act
|
|
31
|
-
const testLine = stdout
|
|
32
|
-
.split(/\n/)
|
|
33
|
-
.map((line) => line.trim())
|
|
34
|
-
.at(2);
|
|
35
|
-
// Assert
|
|
36
|
-
expect(testLine).toBe(expected);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test("CLI help interface 'logs commands list' description should be expected english", async () => {
|
|
40
|
-
// Arrange
|
|
41
|
-
const expected = `
|
|
42
|
-
list List available ID Cloud log sources.
|
|
43
|
-
`.trim();
|
|
44
|
-
// Act
|
|
45
|
-
const testLine = stdout
|
|
46
|
-
.split(/\n/)
|
|
47
|
-
.find((line) => line.trim().startsWith('list'))
|
|
48
|
-
.trim();
|
|
49
|
-
// Assert
|
|
50
|
-
expect(testLine).toBe(expected);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("CLI help interface 'logs commands tail' description should be expected english", async () => {
|
|
54
|
-
// Arrange
|
|
55
|
-
const expected = `
|
|
56
|
-
tail Tail Identity Cloud logs.
|
|
57
|
-
`.trim();
|
|
58
|
-
// Act
|
|
59
|
-
const testLine = stdout
|
|
60
|
-
.split(/\n/)
|
|
61
|
-
.find((line) => line.trim().startsWith('tail'))
|
|
62
|
-
.trim();
|
|
63
|
-
// Assert
|
|
64
|
-
expect(testLine).toBe(expected);
|
|
65
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import cp from 'child_process';
|
|
2
|
-
import { promisify } from 'util';
|
|
3
|
-
import { node14Compatibility } from '../utils/utils.js';
|
|
4
|
-
|
|
5
|
-
node14Compatibility();
|
|
6
|
-
|
|
7
|
-
const exec = promisify(cp.exec);
|
|
8
|
-
const CMD = 'frodo --help';
|
|
9
|
-
const { stdout } = await exec(CMD);
|
|
10
|
-
|
|
11
|
-
test("CLI help interface 'connection' description should be expected english", async () => {
|
|
12
|
-
// Arrange
|
|
13
|
-
const expectedDescription = `
|
|
14
|
-
conn|connection Manage connection profiles.
|
|
15
|
-
`.trim();
|
|
16
|
-
// Act
|
|
17
|
-
const testLine = stdout
|
|
18
|
-
.split(/\n/)
|
|
19
|
-
.find((line) => line.trim().startsWith('conn'))
|
|
20
|
-
.trim();
|
|
21
|
-
// Assert
|
|
22
|
-
expect(testLine).toBe(expectedDescription);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("CLI help interface 'info' description should be expected english", async () => {
|
|
26
|
-
// Arrange
|
|
27
|
-
const expectedDescription = `
|
|
28
|
-
info [options] <host> [user] [password] Print versions and tokens.
|
|
29
|
-
`.trim();
|
|
30
|
-
// Act
|
|
31
|
-
const testLine = stdout
|
|
32
|
-
.split(/\n/)
|
|
33
|
-
.find((line) => line.trim().startsWith('info'))
|
|
34
|
-
.trim();
|
|
35
|
-
// Assert
|
|
36
|
-
expect(testLine).toBe(expectedDescription);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test("CLI help interface 'journey' description should be expected english", async () => {
|
|
40
|
-
// Arrange
|
|
41
|
-
const expectedDescription = `
|
|
42
|
-
journey Manage journeys/trees.
|
|
43
|
-
`.trim();
|
|
44
|
-
// Act
|
|
45
|
-
const testLine = stdout
|
|
46
|
-
.split(/\n/)
|
|
47
|
-
.find((line) => line.trim().startsWith('journey'))
|
|
48
|
-
.trim();
|
|
49
|
-
// Assert
|
|
50
|
-
expect(testLine).toBe(expectedDescription);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("CLI help interface 'script' description should be expected english", async () => {
|
|
54
|
-
// Arrange
|
|
55
|
-
const expectedDescription = `
|
|
56
|
-
script Manage scripts.
|
|
57
|
-
`.trim();
|
|
58
|
-
// Act
|
|
59
|
-
const testLine = stdout
|
|
60
|
-
.split(/\n/)
|
|
61
|
-
.find((line) => line.trim().startsWith('script'))
|
|
62
|
-
.trim();
|
|
63
|
-
// Assert
|
|
64
|
-
expect(testLine).toBe(expectedDescription);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test("CLI help interface 'idm' description should be expected english", async () => {
|
|
68
|
-
// Arrange
|
|
69
|
-
const expectedDescription = `
|
|
70
|
-
idm Manage IDM configuration.
|
|
71
|
-
`.trim();
|
|
72
|
-
// Act
|
|
73
|
-
const testLine = stdout
|
|
74
|
-
.split(/\n/)
|
|
75
|
-
.find((line) => line.trim().startsWith('idm'))
|
|
76
|
-
.trim();
|
|
77
|
-
// Assert
|
|
78
|
-
expect(testLine).toBe(expectedDescription);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
test("CLI help interface 'logs' description should be expected english", async () => {
|
|
82
|
-
// Arrange
|
|
83
|
-
const expectedDescription = `
|
|
84
|
-
logs List/View Identity Cloud logs
|
|
85
|
-
`.trim();
|
|
86
|
-
// Act
|
|
87
|
-
const testLine = stdout
|
|
88
|
-
.split(/\n/)
|
|
89
|
-
.find((line) => line.trim().startsWith('logs'))
|
|
90
|
-
.trim();
|
|
91
|
-
// Assert
|
|
92
|
-
expect(testLine).toBe(expectedDescription);
|
|
93
|
-
});
|