@rockcarver/frodo-cli 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -2
- package/package.json +2 -2
- package/babel.config.esm.json +0 -6
- package/src/app.ts +0 -63
- package/src/cli/_template/cmd-delete.ts +0 -56
- package/src/cli/_template/cmd-describe.ts +0 -36
- package/src/cli/_template/cmd-export.ts +0 -54
- package/src/cli/_template/cmd-import.ts +0 -54
- package/src/cli/_template/cmd-list.ts +0 -38
- package/src/cli/_template/cmd-sub1-delete.ts +0 -56
- package/src/cli/_template/cmd-sub1-describe.ts +0 -36
- package/src/cli/_template/cmd-sub1-export.ts +0 -54
- package/src/cli/_template/cmd-sub1-import.ts +0 -54
- package/src/cli/_template/cmd-sub1-list.ts +0 -38
- package/src/cli/_template/cmd-sub1.ts +0 -20
- package/src/cli/_template/cmd-sub2-delete.ts +0 -56
- package/src/cli/_template/cmd-sub2-describe.ts +0 -36
- package/src/cli/_template/cmd-sub2-export.ts +0 -54
- package/src/cli/_template/cmd-sub2-import.ts +0 -54
- package/src/cli/_template/cmd-sub2-list.ts +0 -38
- package/src/cli/_template/cmd-sub2.ts +0 -20
- package/src/cli/_template/cmd.ts +0 -29
- package/src/cli/admin/admin-add-autoid-static-user-mapping.ts +0 -40
- package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.ts +0 -121
- package/src/cli/admin/admin-get-access-token.ts +0 -59
- package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.ts +0 -45
- package/src/cli/admin/admin-hide-generic-extension-attributes.ts +0 -47
- package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.ts +0 -45
- package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.ts +0 -46
- package/src/cli/admin/admin-list-static-user-mappings.ts +0 -53
- package/src/cli/admin/admin-remove-static-user-mapping.ts +0 -38
- package/src/cli/admin/admin-repair-org-model.ts +0 -53
- package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.ts +0 -47
- package/src/cli/admin/admin-show-generic-extension-attributes.ts +0 -55
- package/src/cli/admin/admin.ts +0 -94
- package/src/cli/app/app-delete.ts +0 -56
- package/src/cli/app/app-describe.ts +0 -36
- package/src/cli/app/app-export.ts +0 -78
- package/src/cli/app/app-import.ts +0 -56
- package/src/cli/app/app-list.ts +0 -40
- package/src/cli/app/app.ts +0 -29
- package/src/cli/cmd_common.ts +0 -181
- package/src/cli/conn/conn-add.ts +0 -65
- package/src/cli/conn/conn-delete.ts +0 -22
- package/src/cli/conn/conn-describe.ts +0 -23
- package/src/cli/conn/conn-list.ts +0 -27
- package/src/cli/conn/conn.ts +0 -28
- package/src/cli/email/email-template-export.ts +0 -90
- package/src/cli/email/email-template-import.ts +0 -90
- package/src/cli/email/email-template-list.ts +0 -40
- package/src/cli/email/email-template.ts +0 -16
- package/src/cli/email/email.ts +0 -17
- package/src/cli/esv/esv-apply.ts +0 -120
- package/src/cli/esv/esv-secret-create.ts +0 -64
- package/src/cli/esv/esv-secret-delete.ts +0 -65
- package/src/cli/esv/esv-secret-describe.ts +0 -43
- package/src/cli/esv/esv-secret-export.ts +0 -54
- package/src/cli/esv/esv-secret-import.ts +0 -54
- package/src/cli/esv/esv-secret-list.ts +0 -40
- package/src/cli/esv/esv-secret-set.ts +0 -45
- package/src/cli/esv/esv-secret-version-activate.ts +0 -53
- package/src/cli/esv/esv-secret-version-create.ts +0 -45
- package/src/cli/esv/esv-secret-version-deactivate.ts +0 -53
- package/src/cli/esv/esv-secret-version-delete.ts +0 -66
- package/src/cli/esv/esv-secret-version-list.ts +0 -41
- package/src/cli/esv/esv-secret-version.ts +0 -20
- package/src/cli/esv/esv-secret.ts +0 -26
- package/src/cli/esv/esv-variable-create.ts +0 -46
- package/src/cli/esv/esv-variable-delete.ts +0 -71
- package/src/cli/esv/esv-variable-describe.ts +0 -43
- package/src/cli/esv/esv-variable-export.ts +0 -54
- package/src/cli/esv/esv-variable-import.ts +0 -54
- package/src/cli/esv/esv-variable-list.ts +0 -40
- package/src/cli/esv/esv-variable-set.ts +0 -62
- package/src/cli/esv/esv-variable.ts +0 -24
- package/src/cli/esv/esv.ts +0 -21
- package/src/cli/idm/idm-count.ts +0 -42
- package/src/cli/idm/idm-export.ts +0 -116
- package/src/cli/idm/idm-list.ts +0 -40
- package/src/cli/idm/idm.ts +0 -28
- package/src/cli/idp/idp-export.ts +0 -90
- package/src/cli/idp/idp-import.ts +0 -101
- package/src/cli/idp/idp-list.ts +0 -42
- package/src/cli/idp/idp.ts +0 -21
- package/src/cli/info/info.ts +0 -55
- package/src/cli/journey/journey-delete.e2e.test_.ts +0 -380
- package/src/cli/journey/journey-delete.ts +0 -78
- package/src/cli/journey/journey-describe.ts +0 -148
- package/src/cli/journey/journey-export.ts +0 -110
- package/src/cli/journey/journey-import.ts +0 -127
- package/src/cli/journey/journey-list.e2e.test_.ts +0 -142
- package/src/cli/journey/journey-list.ts +0 -43
- package/src/cli/journey/journey-prune.ts +0 -52
- package/src/cli/journey/journey.ts +0 -37
- package/src/cli/logging/logs-list.ts +0 -77
- package/src/cli/logging/logs-tail.ts +0 -85
- package/src/cli/logging/logs.ts +0 -21
- package/src/cli/realm/realm-add-custom-domain.ts +0 -47
- package/src/cli/realm/realm-describe.ts +0 -40
- package/src/cli/realm/realm-list.ts +0 -40
- package/src/cli/realm/realm-remove-custom-domain.ts +0 -50
- package/src/cli/realm/realm.ts +0 -33
- package/src/cli/saml/saml-cot-export.ts +0 -90
- package/src/cli/saml/saml-cot-import.ts +0 -101
- package/src/cli/saml/saml-cot-list.ts +0 -42
- package/src/cli/saml/saml-cot.ts +0 -16
- package/src/cli/saml/saml-describe.ts +0 -42
- package/src/cli/saml/saml-export.ts +0 -91
- package/src/cli/saml/saml-import.ts +0 -102
- package/src/cli/saml/saml-list.ts +0 -42
- package/src/cli/saml/saml-metadata-export.ts +0 -76
- package/src/cli/saml/saml-metadata.ts +0 -12
- package/src/cli/saml/saml.ts +0 -29
- package/src/cli/script/script-delete.ts +0 -56
- package/src/cli/script/script-describe.ts +0 -36
- package/src/cli/script/script-export.ts +0 -95
- package/src/cli/script/script-import.ts +0 -64
- package/src/cli/script/script-list.ts +0 -42
- package/src/cli/script/script.ts +0 -25
- package/src/cli/theme/theme-delete.e2e.test_.ts +0 -178
- package/src/cli/theme/theme-delete.ts +0 -83
- package/src/cli/theme/theme-export.ts +0 -107
- package/src/cli/theme/theme-import.ts +0 -118
- package/src/cli/theme/theme-list.e2e.test_.ts +0 -119
- package/src/cli/theme/theme-list.ts +0 -42
- package/src/cli/theme/theme.ts +0 -23
- package/src/ops/CirclesOfTrustOps.ts +0 -12
- package/src/ops/EmailTemplateOps.ts +0 -19
- package/src/ops/IdpOps.ts +0 -11
- package/src/ops/JourneyOps.ts +0 -278
- package/src/ops/NodeOps.ts +0 -47
- package/src/ops/Saml2Ops.ts +0 -24
- package/src/ops/ScriptOps.ts +0 -11
- package/src/ops/ThemeOps.ts +0 -17
- package/src/ops/utils/Wordwrap.ts +0 -11
- package/src/storage/StaticStorage.ts +0 -15
- package/src/utils/Console.ts +0 -483
- package/tsconfig.json +0 -106
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
|
|
7
|
-
const program = new Command('frodo cmd sub2 delete');
|
|
8
|
-
|
|
9
|
-
program
|
|
10
|
-
.description('Sub2 delete.')
|
|
11
|
-
.helpOption('-h, --help', 'Help')
|
|
12
|
-
.showHelpAfterError()
|
|
13
|
-
.addArgument(common.hostArgumentM)
|
|
14
|
-
.addArgument(common.realmArgument)
|
|
15
|
-
.addArgument(common.userArgument)
|
|
16
|
-
.addArgument(common.passwordArgument)
|
|
17
|
-
.addOption(common.deploymentOption)
|
|
18
|
-
.addOption(common.insecureOption)
|
|
19
|
-
.addOption(
|
|
20
|
-
new Option(
|
|
21
|
-
'-i, --sub2-id <sub2-id>',
|
|
22
|
-
'Sub2 id. If specified, -a and -A are ignored.'
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
.addOption(
|
|
26
|
-
new Option('-a, --all', 'Delete all sub2s in a realm. Ignored with -i.')
|
|
27
|
-
)
|
|
28
|
-
.addOption(
|
|
29
|
-
new Option(
|
|
30
|
-
'--no-deep',
|
|
31
|
-
'No deep delete. This leaves orphaned configuration artifacts behind.'
|
|
32
|
-
)
|
|
33
|
-
)
|
|
34
|
-
.addOption(
|
|
35
|
-
new Option(
|
|
36
|
-
'--verbose',
|
|
37
|
-
'Verbose output during command execution. If specified, may or may not produce additional output.'
|
|
38
|
-
).default(false, 'off')
|
|
39
|
-
)
|
|
40
|
-
.action(
|
|
41
|
-
// implement command logic inside action handler
|
|
42
|
-
async (host, realm, user, password, options) => {
|
|
43
|
-
state.default.session.setTenant(host);
|
|
44
|
-
state.default.session.setRealm(realm);
|
|
45
|
-
state.default.session.setUsername(user);
|
|
46
|
-
state.default.session.setPassword(password);
|
|
47
|
-
state.default.session.setDeploymentType(options.type);
|
|
48
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
49
|
-
if (await getTokens()) {
|
|
50
|
-
// code goes here
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// end command logic inside action handler
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
program.parse();
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
|
|
7
|
-
const program = new Command('frodo cmd sub2 describe');
|
|
8
|
-
|
|
9
|
-
program
|
|
10
|
-
.description('Sub2 describe.')
|
|
11
|
-
.helpOption('-h, --help', 'Help')
|
|
12
|
-
.showHelpAfterError()
|
|
13
|
-
.addArgument(common.hostArgumentM)
|
|
14
|
-
.addArgument(common.realmArgument)
|
|
15
|
-
.addArgument(common.userArgument)
|
|
16
|
-
.addArgument(common.passwordArgument)
|
|
17
|
-
.addOption(common.deploymentOption)
|
|
18
|
-
.addOption(common.insecureOption)
|
|
19
|
-
.addOption(new Option('-i, --sub2-id <sub2-id>', 'Sub2 id.'))
|
|
20
|
-
.action(
|
|
21
|
-
// implement command logic inside action handler
|
|
22
|
-
async (host, realm, user, password, options) => {
|
|
23
|
-
state.default.session.setTenant(host);
|
|
24
|
-
state.default.session.setRealm(realm);
|
|
25
|
-
state.default.session.setUsername(user);
|
|
26
|
-
state.default.session.setPassword(password);
|
|
27
|
-
state.default.session.setDeploymentType(options.type);
|
|
28
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
29
|
-
if (await getTokens()) {
|
|
30
|
-
// code goes here
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// end command logic inside action handler
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
program.parse();
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
|
|
7
|
-
const program = new Command('frodo cmd sub2 export');
|
|
8
|
-
|
|
9
|
-
program
|
|
10
|
-
.description('Sub2 export.')
|
|
11
|
-
.helpOption('-h, --help', 'Help')
|
|
12
|
-
.showHelpAfterError()
|
|
13
|
-
.addArgument(common.hostArgumentM)
|
|
14
|
-
.addArgument(common.realmArgument)
|
|
15
|
-
.addArgument(common.userArgument)
|
|
16
|
-
.addArgument(common.passwordArgument)
|
|
17
|
-
.addOption(common.deploymentOption)
|
|
18
|
-
.addOption(common.insecureOption)
|
|
19
|
-
.addOption(
|
|
20
|
-
new Option(
|
|
21
|
-
'-i, --sub2-id <sub2-id>',
|
|
22
|
-
'Sub2 id. If specified, -a and -A are ignored.'
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
.addOption(new Option('-f, --file <file>', 'Name of the export file.'))
|
|
26
|
-
.addOption(
|
|
27
|
-
new Option(
|
|
28
|
-
'-a, --all',
|
|
29
|
-
'Export all sub2s to a single file. Ignored with -i.'
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
.addOption(
|
|
33
|
-
new Option(
|
|
34
|
-
'-A, --all-separate',
|
|
35
|
-
'Export all sub2s to separate files (*.sub2.json) in the current directory. Ignored with -i or -a.'
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
.action(
|
|
39
|
-
// implement command logic inside action handler
|
|
40
|
-
async (host, realm, user, password, options) => {
|
|
41
|
-
state.default.session.setTenant(host);
|
|
42
|
-
state.default.session.setRealm(realm);
|
|
43
|
-
state.default.session.setUsername(user);
|
|
44
|
-
state.default.session.setPassword(password);
|
|
45
|
-
state.default.session.setDeploymentType(options.type);
|
|
46
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
47
|
-
if (await getTokens()) {
|
|
48
|
-
// code goes here
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// end command logic inside action handler
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
program.parse();
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
|
|
7
|
-
const program = new Command('frodo cmd sub2 import');
|
|
8
|
-
|
|
9
|
-
program
|
|
10
|
-
.description('Sub2 import.')
|
|
11
|
-
.helpOption('-h, --help', 'Help')
|
|
12
|
-
.showHelpAfterError()
|
|
13
|
-
.addArgument(common.hostArgumentM)
|
|
14
|
-
.addArgument(common.realmArgument)
|
|
15
|
-
.addArgument(common.userArgument)
|
|
16
|
-
.addArgument(common.passwordArgument)
|
|
17
|
-
.addOption(common.deploymentOption)
|
|
18
|
-
.addOption(common.insecureOption)
|
|
19
|
-
.addOption(
|
|
20
|
-
new Option(
|
|
21
|
-
'-i, --sub2-id <sub2-id>',
|
|
22
|
-
'Sub2 id. If specified, only one sub2 is imported and the options -a and -A are ignored.'
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
.addOption(new Option('-f, --file <file>', 'Name of the file to import.'))
|
|
26
|
-
.addOption(
|
|
27
|
-
new Option(
|
|
28
|
-
'-a, --all',
|
|
29
|
-
'Import all sub2s from single file. Ignored with -i.'
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
.addOption(
|
|
33
|
-
new Option(
|
|
34
|
-
'-A, --all-separate',
|
|
35
|
-
'Import all sub2s from separate files (*.sub2.json) in the current directory. Ignored with -i or -a.'
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
.action(
|
|
39
|
-
// implement command logic inside action handler
|
|
40
|
-
async (host, realm, user, password, options) => {
|
|
41
|
-
state.default.session.setTenant(host);
|
|
42
|
-
state.default.session.setRealm(realm);
|
|
43
|
-
state.default.session.setUsername(user);
|
|
44
|
-
state.default.session.setPassword(password);
|
|
45
|
-
state.default.session.setDeploymentType(options.type);
|
|
46
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
47
|
-
if (await getTokens()) {
|
|
48
|
-
// code goes here
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// end command logic inside action handler
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
program.parse();
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
|
|
7
|
-
const program = new Command('frodo cmd sub2 list');
|
|
8
|
-
|
|
9
|
-
program
|
|
10
|
-
.description('Sub2 list.')
|
|
11
|
-
.helpOption('-h, --help', 'Help')
|
|
12
|
-
.showHelpAfterError()
|
|
13
|
-
.addArgument(common.hostArgumentM)
|
|
14
|
-
.addArgument(common.realmArgument)
|
|
15
|
-
.addArgument(common.userArgument)
|
|
16
|
-
.addArgument(common.passwordArgument)
|
|
17
|
-
.addOption(common.deploymentOption)
|
|
18
|
-
.addOption(common.insecureOption)
|
|
19
|
-
.addOption(
|
|
20
|
-
new Option('-l, --long', 'Long with all fields.').default(false, 'false')
|
|
21
|
-
)
|
|
22
|
-
.action(
|
|
23
|
-
// implement command logic inside action handler
|
|
24
|
-
async (host, realm, user, password, options) => {
|
|
25
|
-
state.default.session.setTenant(host);
|
|
26
|
-
state.default.session.setRealm(realm);
|
|
27
|
-
state.default.session.setUsername(user);
|
|
28
|
-
state.default.session.setPassword(password);
|
|
29
|
-
state.default.session.setDeploymentType(options.type);
|
|
30
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
31
|
-
if (await getTokens()) {
|
|
32
|
-
// code goes here
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// end command logic inside action handler
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
program.parse();
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
|
|
3
|
-
const program = new Command('frodo cmd sub2');
|
|
4
|
-
|
|
5
|
-
program
|
|
6
|
-
.description('Sub2 command.')
|
|
7
|
-
.helpOption('-h, --help', 'Help')
|
|
8
|
-
.showHelpAfterError();
|
|
9
|
-
|
|
10
|
-
program.command('list', 'Sub2 list.').showHelpAfterError();
|
|
11
|
-
|
|
12
|
-
program.command('describe', 'Sub2 describe.').showHelpAfterError();
|
|
13
|
-
|
|
14
|
-
program.command('export', 'Sub2 export.').showHelpAfterError();
|
|
15
|
-
|
|
16
|
-
program.command('import', 'Sub2 import.').showHelpAfterError();
|
|
17
|
-
|
|
18
|
-
program.command('delete', 'Sub2 delete.').showHelpAfterError();
|
|
19
|
-
|
|
20
|
-
program.parse();
|
package/src/cli/_template/cmd.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
|
|
5
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
|
|
7
|
-
export default function setup() {
|
|
8
|
-
const program = new Command('cmd')
|
|
9
|
-
.helpOption('-h, --help', 'Help')
|
|
10
|
-
.description('Top-level command.')
|
|
11
|
-
.executableDir(__dirname);
|
|
12
|
-
|
|
13
|
-
program.command('sub1', 'Sub1 command.').showHelpAfterError();
|
|
14
|
-
|
|
15
|
-
program.command('sub2', 'Sub2 command.').showHelpAfterError();
|
|
16
|
-
|
|
17
|
-
program.command('list', 'Sub2 list.').showHelpAfterError();
|
|
18
|
-
|
|
19
|
-
program.command('describe', 'Sub2 describe.').showHelpAfterError();
|
|
20
|
-
|
|
21
|
-
program.command('export', 'Sub2 export.').showHelpAfterError();
|
|
22
|
-
|
|
23
|
-
program.command('import', 'Sub2 import.').showHelpAfterError();
|
|
24
|
-
|
|
25
|
-
program.command('delete', 'Sub2 delete.').showHelpAfterError();
|
|
26
|
-
|
|
27
|
-
program.showHelpAfterError();
|
|
28
|
-
return program;
|
|
29
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Authenticate, Admin, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
const { addAutoIdStaticUserMapping } = Admin;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo admin add-autoid-static-user-mapping');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description(
|
|
12
|
-
'Add AutoId static user mapping to enable dashboards and other AutoId-based functionality.'
|
|
13
|
-
)
|
|
14
|
-
.helpOption('-h, --help', 'Help')
|
|
15
|
-
.showHelpAfterError()
|
|
16
|
-
.addArgument(common.hostArgumentM)
|
|
17
|
-
.addArgument(common.realmArgument)
|
|
18
|
-
.addArgument(common.userArgument)
|
|
19
|
-
.addArgument(common.passwordArgument)
|
|
20
|
-
.addOption(common.deploymentOption)
|
|
21
|
-
.addOption(common.insecureOption)
|
|
22
|
-
.action(
|
|
23
|
-
// implement command logic inside action handler
|
|
24
|
-
async (host, realm, user, password, options) => {
|
|
25
|
-
state.default.session.setTenant(host);
|
|
26
|
-
state.default.session.setRealm(realm);
|
|
27
|
-
state.default.session.setUsername(user);
|
|
28
|
-
state.default.session.setPassword(password);
|
|
29
|
-
state.default.session.setDeploymentType(options.type);
|
|
30
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
31
|
-
if (await getTokens()) {
|
|
32
|
-
console.log(`Adding AutoId static user mapping...`);
|
|
33
|
-
await addAutoIdStaticUserMapping();
|
|
34
|
-
console.log('Done.');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// end command logic inside action handler
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
program.parse();
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
-
import Table from 'cli-table3';
|
|
4
|
-
import { Authenticate, Admin, state } from '@rockcarver/frodo-lib';
|
|
5
|
-
import * as common from '../cmd_common.js';
|
|
6
|
-
|
|
7
|
-
const { getTokens } = Authenticate;
|
|
8
|
-
const { createLongLivedToken, createOAuth2ClientWithAdminPrivileges } = Admin;
|
|
9
|
-
|
|
10
|
-
const program = new Command(
|
|
11
|
-
'frodo admin create-oauth2-client-with-admin-privileges'
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
program
|
|
15
|
-
.description('Create an oauth2 client with admin privileges.')
|
|
16
|
-
.helpOption('-h, --help', 'Help')
|
|
17
|
-
.showHelpAfterError()
|
|
18
|
-
.addArgument(common.hostArgumentM)
|
|
19
|
-
.addArgument(common.realmArgument)
|
|
20
|
-
.addArgument(common.userArgument)
|
|
21
|
-
.addArgument(common.passwordArgument)
|
|
22
|
-
.addOption(common.deploymentOption)
|
|
23
|
-
.addOption(common.insecureOption)
|
|
24
|
-
.addOption(new Option('--client-id [id]', 'Client id.'))
|
|
25
|
-
.addOption(new Option('--client-secret [secret]', 'Client secret.'))
|
|
26
|
-
.addOption(
|
|
27
|
-
new Option(
|
|
28
|
-
'--llt',
|
|
29
|
-
'Create a long-lived token and store it in a secret. The default secret name is esv-admin-token and the default token lifetime is 315,360,000 seconds (10 years). Both can be overwritten with the --llt-esv and --llt-ttl options.'
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
.addOption(
|
|
33
|
-
new Option(
|
|
34
|
-
'--llt-scope [scope]',
|
|
35
|
-
'Request the following scope(s). This option only applies if used with the --llt option.'
|
|
36
|
-
).default('fr:idm:*', 'fr:idm:*')
|
|
37
|
-
)
|
|
38
|
-
.addOption(
|
|
39
|
-
new Option(
|
|
40
|
-
'--llt-esv [esv]',
|
|
41
|
-
'Name of the secret to store the token in. This option only applies if used with the --llt option.'
|
|
42
|
-
).default('esv-admin-token', 'esv-admin-token')
|
|
43
|
-
)
|
|
44
|
-
.addOption(
|
|
45
|
-
new Option(
|
|
46
|
-
'--llt-ttl [ttl]',
|
|
47
|
-
'Token lifetime (seconds). This option only applies if used with the --llt option.'
|
|
48
|
-
).default(315360000, '315,360,000 seconds (10 years)')
|
|
49
|
-
)
|
|
50
|
-
.action(
|
|
51
|
-
// implement command logic inside action handler
|
|
52
|
-
async (host, realm, user, password, options) => {
|
|
53
|
-
state.default.session.setTenant(host);
|
|
54
|
-
state.default.session.setRealm(realm);
|
|
55
|
-
state.default.session.setUsername(user);
|
|
56
|
-
state.default.session.setPassword(password);
|
|
57
|
-
state.default.session.setDeploymentType(options.type);
|
|
58
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
59
|
-
if (await getTokens()) {
|
|
60
|
-
console.log(
|
|
61
|
-
`Creating oauth2 client with admin privileges in realm "${state.default.session.getRealm()}"...`
|
|
62
|
-
);
|
|
63
|
-
let clientId = uuidv4();
|
|
64
|
-
let clientSecret = uuidv4();
|
|
65
|
-
if (options.clientId) {
|
|
66
|
-
clientId = options.clientId;
|
|
67
|
-
}
|
|
68
|
-
if (options.clientSecret) {
|
|
69
|
-
clientSecret = options.clientSecret;
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
await createOAuth2ClientWithAdminPrivileges(clientId, clientSecret);
|
|
73
|
-
} catch (error) {
|
|
74
|
-
console.log(error, 'error');
|
|
75
|
-
}
|
|
76
|
-
const table = new Table({
|
|
77
|
-
chars: {
|
|
78
|
-
top: '',
|
|
79
|
-
'top-mid': '',
|
|
80
|
-
'top-left': '',
|
|
81
|
-
'top-right': '',
|
|
82
|
-
bottom: '',
|
|
83
|
-
'bottom-mid': '',
|
|
84
|
-
'bottom-left': '',
|
|
85
|
-
'bottom-right': '',
|
|
86
|
-
left: '',
|
|
87
|
-
'left-mid': '',
|
|
88
|
-
mid: '',
|
|
89
|
-
'mid-mid': '',
|
|
90
|
-
right: '',
|
|
91
|
-
'right-mid': '',
|
|
92
|
-
},
|
|
93
|
-
style: { 'padding-left': 0, 'padding-right': 0 },
|
|
94
|
-
wordWrap: true,
|
|
95
|
-
});
|
|
96
|
-
if (options.llt) {
|
|
97
|
-
try {
|
|
98
|
-
const response = await createLongLivedToken(
|
|
99
|
-
clientId,
|
|
100
|
-
clientSecret,
|
|
101
|
-
options.scope,
|
|
102
|
-
options.lltEsv,
|
|
103
|
-
options.lltTtl
|
|
104
|
-
);
|
|
105
|
-
table.push(['Secret Name'['brightCyan'], response.secret]);
|
|
106
|
-
table.push(['Scope'['brightCyan'], response.scope]);
|
|
107
|
-
// table.push(['Token Lifetime'.brightCyan, response.expires_in]);
|
|
108
|
-
table.push(['Expires'['brightCyan'], response.expires_on]);
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.log(error, 'error');
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
table.push(['Client ID'['brightCyan'], clientId]);
|
|
114
|
-
table.push(['Client Secret'['brightCyan'], clientSecret]);
|
|
115
|
-
console.log(table.toString());
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
// end command logic inside action handler
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
program.parse();
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, OAuth2OIDCApi, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { clientCredentialsGrant } = OAuth2OIDCApi;
|
|
6
|
-
const { getTokens } = Authenticate;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo admin get-access-token');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description('Get an access token using client credentials grant type.')
|
|
12
|
-
.helpOption('-h, --help', 'Help')
|
|
13
|
-
.showHelpAfterError()
|
|
14
|
-
.addArgument(common.hostArgumentM)
|
|
15
|
-
.addArgument(common.realmArgument)
|
|
16
|
-
.addArgument(common.userArgument)
|
|
17
|
-
.addArgument(common.passwordArgument)
|
|
18
|
-
.addOption(common.deploymentOption)
|
|
19
|
-
.addOption(common.insecureOption)
|
|
20
|
-
.addOption(new Option('--client-id [id]', 'Client id.').makeOptionMandatory())
|
|
21
|
-
.addOption(
|
|
22
|
-
new Option(
|
|
23
|
-
'--client-secret [secret]',
|
|
24
|
-
'Client secret.'
|
|
25
|
-
).makeOptionMandatory()
|
|
26
|
-
)
|
|
27
|
-
.addOption(
|
|
28
|
-
new Option('--scope [scope]', 'Request the following scope(s).').default(
|
|
29
|
-
'fr:idm:*',
|
|
30
|
-
'fr:idm:*'
|
|
31
|
-
)
|
|
32
|
-
)
|
|
33
|
-
.action(
|
|
34
|
-
// implement command logic inside action handler
|
|
35
|
-
async (host, realm, user, password, options) => {
|
|
36
|
-
state.default.session.setTenant(host);
|
|
37
|
-
state.default.session.setRealm(realm);
|
|
38
|
-
state.default.session.setUsername(user);
|
|
39
|
-
state.default.session.setPassword(password);
|
|
40
|
-
state.default.session.setDeploymentType(options.type);
|
|
41
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
42
|
-
if (await getTokens()) {
|
|
43
|
-
console.log(
|
|
44
|
-
`Getting an access token using client "${options.clientId}"...`
|
|
45
|
-
);
|
|
46
|
-
const response = (
|
|
47
|
-
await clientCredentialsGrant(
|
|
48
|
-
options.clientId,
|
|
49
|
-
options.clientSecret,
|
|
50
|
-
options.scope
|
|
51
|
-
)
|
|
52
|
-
).data;
|
|
53
|
-
console.log(`Token: ${response.access_token}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
// end command logic inside action handler
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
program.parse();
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, Admin, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
const { grantOAuth2ClientAdminPrivileges } = Admin;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo admin grant-oauth2-client-admin-privileges');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description('Grant an oauth2 client admin privileges.')
|
|
12
|
-
.helpOption('-h, --help', 'Help')
|
|
13
|
-
.showHelpAfterError()
|
|
14
|
-
.addArgument(common.hostArgumentM)
|
|
15
|
-
.addArgument(common.realmArgument)
|
|
16
|
-
.addArgument(common.userArgument)
|
|
17
|
-
.addArgument(common.passwordArgument)
|
|
18
|
-
.addOption(common.deploymentOption)
|
|
19
|
-
.addOption(common.insecureOption)
|
|
20
|
-
.addOption(
|
|
21
|
-
new Option('-t, --target <target name or id>', 'Name of the oauth2 client.')
|
|
22
|
-
)
|
|
23
|
-
.action(
|
|
24
|
-
// implement command logic inside action handler
|
|
25
|
-
async (host, realm, user, password, options) => {
|
|
26
|
-
state.default.session.setTenant(host);
|
|
27
|
-
state.default.session.setRealm(realm);
|
|
28
|
-
state.default.session.setUsername(user);
|
|
29
|
-
state.default.session.setPassword(password);
|
|
30
|
-
state.default.session.setDeploymentType(options.type);
|
|
31
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
32
|
-
if (await getTokens()) {
|
|
33
|
-
console.log(
|
|
34
|
-
`Granting oauth2 client "${
|
|
35
|
-
options.target
|
|
36
|
-
}" in realm "${state.default.session.getRealm()}" admin privileges...`
|
|
37
|
-
);
|
|
38
|
-
await grantOAuth2ClientAdminPrivileges(options.target);
|
|
39
|
-
console.log('Done.');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
// end command logic inside action handler
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
program.parse();
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, Admin, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
const { hideGenericExtensionAttributes } = Admin;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo admin hide-generic-extension-attributes');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description('Hide generic extension attributes.')
|
|
12
|
-
.helpOption('-h, --help', 'Help')
|
|
13
|
-
.showHelpAfterError()
|
|
14
|
-
.addArgument(common.hostArgumentM)
|
|
15
|
-
.addArgument(common.realmArgument)
|
|
16
|
-
.addArgument(common.userArgument)
|
|
17
|
-
.addArgument(common.passwordArgument)
|
|
18
|
-
.addOption(common.deploymentOption)
|
|
19
|
-
.addOption(common.insecureOption)
|
|
20
|
-
.addOption(
|
|
21
|
-
new Option('--include-customized', 'Include customized attributes.')
|
|
22
|
-
)
|
|
23
|
-
.addOption(new Option('--dry-run', 'Dry-run only, do not perform changes.'))
|
|
24
|
-
.action(
|
|
25
|
-
// implement command logic inside action handler
|
|
26
|
-
async (host, realm, user, password, options) => {
|
|
27
|
-
state.default.session.setTenant(host);
|
|
28
|
-
state.default.session.setRealm(realm);
|
|
29
|
-
state.default.session.setUsername(user);
|
|
30
|
-
state.default.session.setPassword(password);
|
|
31
|
-
state.default.session.setDeploymentType(options.type);
|
|
32
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
33
|
-
if (await getTokens()) {
|
|
34
|
-
console.log(
|
|
35
|
-
`Hiding generic extension attributes in realm "${state.default.session.getRealm()}"...`
|
|
36
|
-
);
|
|
37
|
-
await hideGenericExtensionAttributes(
|
|
38
|
-
options.includeCustomized,
|
|
39
|
-
options.dryRun
|
|
40
|
-
);
|
|
41
|
-
console.log('Done.');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// end command logic inside action handler
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
program.parse();
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Authenticate, Admin, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { listOAuth2AdminClients } = Admin;
|
|
6
|
-
const { getTokens } = Authenticate;
|
|
7
|
-
|
|
8
|
-
const program = new Command(
|
|
9
|
-
'frodo admin list-oauth2-clients-with-admin-privileges'
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
program
|
|
13
|
-
.description('List oauth2 clients with admin privileges.')
|
|
14
|
-
.helpOption('-h, --help', 'Help')
|
|
15
|
-
.showHelpAfterError()
|
|
16
|
-
.addArgument(common.hostArgumentM)
|
|
17
|
-
.addArgument(common.realmArgument)
|
|
18
|
-
.addArgument(common.userArgument)
|
|
19
|
-
.addArgument(common.passwordArgument)
|
|
20
|
-
.addOption(common.deploymentOption)
|
|
21
|
-
.addOption(common.insecureOption)
|
|
22
|
-
.action(
|
|
23
|
-
// implement command logic inside action handler
|
|
24
|
-
async (host, realm, user, password, options) => {
|
|
25
|
-
state.default.session.setTenant(host);
|
|
26
|
-
state.default.session.setRealm(realm);
|
|
27
|
-
state.default.session.setUsername(user);
|
|
28
|
-
state.default.session.setPassword(password);
|
|
29
|
-
state.default.session.setDeploymentType(options.type);
|
|
30
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
31
|
-
if (await getTokens()) {
|
|
32
|
-
console.log(
|
|
33
|
-
`Listing oauth2 clients with admin privileges in realm "${state.default.session.getRealm()}"...`
|
|
34
|
-
);
|
|
35
|
-
const adminClients = await listOAuth2AdminClients();
|
|
36
|
-
adminClients.sort((a, b) => a.localeCompare(b));
|
|
37
|
-
adminClients.forEach((item) => {
|
|
38
|
-
console.log(`${item}`);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
// end command logic inside action handler
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
program.parse();
|