@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,46 +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 { listOAuth2CustomClients } = Admin;
|
|
6
|
-
|
|
7
|
-
const { getTokens } = Authenticate;
|
|
8
|
-
|
|
9
|
-
const program = new Command(
|
|
10
|
-
'frodo admin list-oauth2-clients-with-custom-privileges'
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
program
|
|
14
|
-
.description('List oauth2 clients with custom privileges.')
|
|
15
|
-
.helpOption('-h, --help', 'Help')
|
|
16
|
-
.showHelpAfterError()
|
|
17
|
-
.addArgument(common.hostArgumentM)
|
|
18
|
-
.addArgument(common.realmArgument)
|
|
19
|
-
.addArgument(common.userArgument)
|
|
20
|
-
.addArgument(common.passwordArgument)
|
|
21
|
-
.addOption(common.deploymentOption)
|
|
22
|
-
.addOption(common.insecureOption)
|
|
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
|
-
`Listing oauth2 clients with custom privileges in realm "${state.default.session.getRealm()}"...`
|
|
35
|
-
);
|
|
36
|
-
const adminClients = await listOAuth2CustomClients();
|
|
37
|
-
adminClients.sort((a, b) => a.localeCompare(b));
|
|
38
|
-
adminClients.forEach((item) => {
|
|
39
|
-
console.log(`${item}`);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
// end command logic inside action handler
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
program.parse();
|
|
@@ -1,53 +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 { listNonOAuth2AdminStaticUserMappings } = Admin;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo admin list-static-user-mappings');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description(
|
|
12
|
-
'List all subjects of static user mappings that are not oauth2 clients.'
|
|
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
|
-
.addOption(
|
|
23
|
-
new Option('--show-protected', 'Show protected (system) subjects.').default(
|
|
24
|
-
false,
|
|
25
|
-
'false'
|
|
26
|
-
)
|
|
27
|
-
)
|
|
28
|
-
.action(
|
|
29
|
-
// implement command logic inside action handler
|
|
30
|
-
async (host, realm, user, password, options) => {
|
|
31
|
-
state.default.session.setTenant(host);
|
|
32
|
-
state.default.session.setRealm(realm);
|
|
33
|
-
state.default.session.setUsername(user);
|
|
34
|
-
state.default.session.setPassword(password);
|
|
35
|
-
state.default.session.setDeploymentType(options.type);
|
|
36
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
37
|
-
if (await getTokens()) {
|
|
38
|
-
console.log(
|
|
39
|
-
'Listing all non-oauth2 client subjects of static user mappings...'
|
|
40
|
-
);
|
|
41
|
-
const subjects = await listNonOAuth2AdminStaticUserMappings(
|
|
42
|
-
options.showProtected
|
|
43
|
-
);
|
|
44
|
-
subjects.sort((a, b) => a.localeCompare(b));
|
|
45
|
-
subjects.forEach((item) => {
|
|
46
|
-
console.log(`${item}`);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// end command logic inside action handler
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
program.parse();
|
|
@@ -1,38 +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 { removeStaticUserMapping } = Admin;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo admin remove-static-user-mapping');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description("Remove a subject's static user mapping.")
|
|
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
|
-
.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
|
-
console.log("Removing a subject's static user mapping...");
|
|
31
|
-
await removeStaticUserMapping(options.subject);
|
|
32
|
-
console.log('Done.');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// end command logic inside action handler
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
program.parse();
|
|
@@ -1,53 +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 { repairOrgModel } = Admin;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo admin repair-org-model');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description('Repair org model.')
|
|
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(
|
|
22
|
-
'--exclude-customized',
|
|
23
|
-
'Exclude customized properties from repair.'
|
|
24
|
-
)
|
|
25
|
-
)
|
|
26
|
-
.addOption(
|
|
27
|
-
new Option(
|
|
28
|
-
'--extend-permissions',
|
|
29
|
-
'Extend permissions to include custom attributes.'
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
.addOption(new Option('--dry-run', 'Dry-run only, do not perform changes.'))
|
|
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
|
-
`Repairing org model in realm "${state.default.session.getRealm()}"...`
|
|
45
|
-
);
|
|
46
|
-
await repairOrgModel(options.excludeCustomized, options.extendPermissions, options.dryRun);
|
|
47
|
-
console.log('Done.');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// end command logic inside action handler
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
program.parse();
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Admin, Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
const { revokeOAuth2ClientAdminPrivileges } = Admin;
|
|
7
|
-
|
|
8
|
-
const program = new Command(
|
|
9
|
-
'frodo admin revoke-oauth2-client-admin-privileges'
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
program
|
|
13
|
-
.description('Revoke admin privileges from an oauth2 client.')
|
|
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
|
-
.addOption(
|
|
23
|
-
new Option('-t, --target <target name or id>', 'Name of the oauth2 client.')
|
|
24
|
-
)
|
|
25
|
-
.action(
|
|
26
|
-
// implement command logic inside action handler
|
|
27
|
-
async (host, realm, user, password, options) => {
|
|
28
|
-
state.default.session.setTenant(host);
|
|
29
|
-
state.default.session.setRealm(realm);
|
|
30
|
-
state.default.session.setUsername(user);
|
|
31
|
-
state.default.session.setPassword(password);
|
|
32
|
-
state.default.session.setDeploymentType(options.type);
|
|
33
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
34
|
-
if (await getTokens()) {
|
|
35
|
-
console.log(
|
|
36
|
-
`Revoking admin privileges from oauth2 client "${
|
|
37
|
-
options.target
|
|
38
|
-
}" in realm "${state.default.session.getRealm()}"...`
|
|
39
|
-
);
|
|
40
|
-
await revokeOAuth2ClientAdminPrivileges(options.target);
|
|
41
|
-
console.log('Done.');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// end command logic inside action handler
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
program.parse();
|
|
@@ -1,55 +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 { showGenericExtensionAttributes } = Admin;
|
|
6
|
-
const { getTokens } = Authenticate;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo admin show-generic-extension-attributes');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description('Show 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(
|
|
22
|
-
'--include-customized',
|
|
23
|
-
'Include customized attributes.'
|
|
24
|
-
).default(false, 'false')
|
|
25
|
-
)
|
|
26
|
-
.addOption(
|
|
27
|
-
new Option('--dry-run', 'Dry-run only, do not perform changes.').default(
|
|
28
|
-
false,
|
|
29
|
-
'false'
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
.action(
|
|
33
|
-
// implement command logic inside action handler
|
|
34
|
-
async (host, realm, user, password, options) => {
|
|
35
|
-
state.default.session.setTenant(host);
|
|
36
|
-
state.default.session.setRealm(realm);
|
|
37
|
-
state.default.session.setUsername(user);
|
|
38
|
-
state.default.session.setPassword(password);
|
|
39
|
-
state.default.session.setDeploymentType(options.type);
|
|
40
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
41
|
-
if (await getTokens()) {
|
|
42
|
-
console.log(
|
|
43
|
-
`Showing generic extension attributes in realm "${state.default.session.getRealm()}"...`
|
|
44
|
-
);
|
|
45
|
-
await showGenericExtensionAttributes(
|
|
46
|
-
options.includeCustomized,
|
|
47
|
-
options.dryRun
|
|
48
|
-
);
|
|
49
|
-
console.log('Done.');
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// end command logic inside action handler
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
program.parse();
|
package/src/cli/admin/admin.ts
DELETED
|
@@ -1,94 +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('admin')
|
|
9
|
-
.helpOption('-h, --help', 'Help')
|
|
10
|
-
.description('Platform admin tasks.')
|
|
11
|
-
.executableDir(__dirname);
|
|
12
|
-
|
|
13
|
-
program
|
|
14
|
-
.command(
|
|
15
|
-
'create-oauth2-client-with-admin-privileges',
|
|
16
|
-
'Create an oauth2 client with admin privileges.'
|
|
17
|
-
)
|
|
18
|
-
.showHelpAfterError();
|
|
19
|
-
|
|
20
|
-
program
|
|
21
|
-
.command(
|
|
22
|
-
'get-access-token',
|
|
23
|
-
'Get an access token using client credentials grant type.'
|
|
24
|
-
)
|
|
25
|
-
.showHelpAfterError();
|
|
26
|
-
|
|
27
|
-
program
|
|
28
|
-
.command(
|
|
29
|
-
'list-oauth2-clients-with-admin-privileges',
|
|
30
|
-
'List oauth2 clients with admin privileges.'
|
|
31
|
-
)
|
|
32
|
-
.showHelpAfterError();
|
|
33
|
-
|
|
34
|
-
program
|
|
35
|
-
.command(
|
|
36
|
-
'grant-oauth2-client-admin-privileges',
|
|
37
|
-
'Grant an oauth2 client admin privileges.'
|
|
38
|
-
)
|
|
39
|
-
.showHelpAfterError();
|
|
40
|
-
|
|
41
|
-
program
|
|
42
|
-
.command(
|
|
43
|
-
'revoke-oauth2-client-admin-privileges',
|
|
44
|
-
'Revoke admin privileges from an oauth2 client.'
|
|
45
|
-
)
|
|
46
|
-
.showHelpAfterError();
|
|
47
|
-
|
|
48
|
-
program
|
|
49
|
-
.command(
|
|
50
|
-
'list-oauth2-clients-with-custom-privileges',
|
|
51
|
-
'List oauth2 clients with custom privileges.'
|
|
52
|
-
)
|
|
53
|
-
.showHelpAfterError();
|
|
54
|
-
|
|
55
|
-
program
|
|
56
|
-
.command(
|
|
57
|
-
'list-static-user-mappings',
|
|
58
|
-
'List all subjects of static user mappings that are not oauth2 clients.'
|
|
59
|
-
)
|
|
60
|
-
.showHelpAfterError();
|
|
61
|
-
|
|
62
|
-
program
|
|
63
|
-
.command(
|
|
64
|
-
'remove-static-user-mapping',
|
|
65
|
-
"Remove a subject's static user mapping."
|
|
66
|
-
)
|
|
67
|
-
.showHelpAfterError();
|
|
68
|
-
|
|
69
|
-
program
|
|
70
|
-
.command(
|
|
71
|
-
'add-autoid-static-user-mapping',
|
|
72
|
-
'Add AutoId static user mapping to enable dashboards and other AutoId-based functionality.'
|
|
73
|
-
)
|
|
74
|
-
.showHelpAfterError();
|
|
75
|
-
|
|
76
|
-
program
|
|
77
|
-
.command(
|
|
78
|
-
'hide-generic-extension-attributes',
|
|
79
|
-
'Hide generic extension attributes.'
|
|
80
|
-
)
|
|
81
|
-
.showHelpAfterError();
|
|
82
|
-
|
|
83
|
-
program
|
|
84
|
-
.command(
|
|
85
|
-
'show-generic-extension-attributes',
|
|
86
|
-
'Show generic extension attributes.'
|
|
87
|
-
)
|
|
88
|
-
.showHelpAfterError();
|
|
89
|
-
|
|
90
|
-
program.command('repair-org-model', 'Repair org model.').showHelpAfterError();
|
|
91
|
-
|
|
92
|
-
program.showHelpAfterError();
|
|
93
|
-
return program;
|
|
94
|
-
}
|
|
@@ -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 delete');
|
|
8
|
-
|
|
9
|
-
program
|
|
10
|
-
.description('Cmd 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, --app-id <id>',
|
|
22
|
-
'OAuth2 application id/name. If specified, -a and -A are ignored.'
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
.addOption(
|
|
26
|
-
new Option('-a, --all', 'Delete all cmds 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 app describe');
|
|
8
|
-
|
|
9
|
-
program
|
|
10
|
-
.description('Describe OAuth2 application.')
|
|
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, --app-id <id>', 'OAuth2 application id/name.'))
|
|
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,78 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
const {
|
|
7
|
-
exportOAuth2ClientsToFile,
|
|
8
|
-
exportOAuth2ClientsToFiles,
|
|
9
|
-
exportOAuth2ClientToFile,
|
|
10
|
-
} = OAuth2Client;
|
|
11
|
-
|
|
12
|
-
const program = new Command('frodo app export');
|
|
13
|
-
|
|
14
|
-
program
|
|
15
|
-
.description('Export OAuth2 applications.')
|
|
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(
|
|
25
|
-
new Option(
|
|
26
|
-
'-i, --app-id <app-id>',
|
|
27
|
-
'App id. If specified, -a and -A are ignored.'
|
|
28
|
-
)
|
|
29
|
-
)
|
|
30
|
-
.addOption(new Option('-f, --file <file>', 'Name of the export file.'))
|
|
31
|
-
.addOption(
|
|
32
|
-
new Option(
|
|
33
|
-
'-a, --all',
|
|
34
|
-
'Export all OAuth2 apps to a single file. Ignored with -i.'
|
|
35
|
-
)
|
|
36
|
-
)
|
|
37
|
-
.addOption(
|
|
38
|
-
new Option(
|
|
39
|
-
'-A, --all-separate',
|
|
40
|
-
'Export all OAuth2 apps to separate files (*.oauth2.app.json) in the current directory. Ignored with -i or -a.'
|
|
41
|
-
)
|
|
42
|
-
)
|
|
43
|
-
.action(
|
|
44
|
-
// implement command logic inside action handler
|
|
45
|
-
async (host, realm, user, password, options) => {
|
|
46
|
-
state.default.session.setTenant(host);
|
|
47
|
-
state.default.session.setRealm(realm);
|
|
48
|
-
state.default.session.setUsername(user);
|
|
49
|
-
state.default.session.setPassword(password);
|
|
50
|
-
state.default.session.setDeploymentType(options.type);
|
|
51
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
52
|
-
if (await getTokens()) {
|
|
53
|
-
// export
|
|
54
|
-
if (options.appId) {
|
|
55
|
-
console.log('Exporting OAuth2 application...');
|
|
56
|
-
exportOAuth2ClientToFile(options.appId, options.file);
|
|
57
|
-
}
|
|
58
|
-
// -a/--all
|
|
59
|
-
else if (options.all) {
|
|
60
|
-
console.log('Exporting all OAuth2 applications to file...');
|
|
61
|
-
exportOAuth2ClientsToFile(options.file);
|
|
62
|
-
}
|
|
63
|
-
// -A/--all-separate
|
|
64
|
-
else if (options.allSeparate) {
|
|
65
|
-
console.log('Exporting all applications to separate files...');
|
|
66
|
-
exportOAuth2ClientsToFiles();
|
|
67
|
-
}
|
|
68
|
-
// unrecognized combination of options or no options
|
|
69
|
-
else {
|
|
70
|
-
console.log('Unrecognized combination of options or no options...');
|
|
71
|
-
program.help();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
// end command logic inside action handler
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
program.parse();
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
const { importOAuth2ClientsFromFile } = OAuth2Client;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo app import');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description('Import OAuth2 applications.')
|
|
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(
|
|
22
|
-
// '-i, --cmd-id <cmd-id>',
|
|
23
|
-
// 'Cmd id. If specified, only one cmd is imported and the options -a and -A are ignored.'
|
|
24
|
-
// )
|
|
25
|
-
// )
|
|
26
|
-
.addOption(new Option('-f, --file <file>', 'Name of the file to import.'))
|
|
27
|
-
// .addOption(
|
|
28
|
-
// new Option(
|
|
29
|
-
// '-a, --all',
|
|
30
|
-
// 'Import all cmds from single file. Ignored with -i.'
|
|
31
|
-
// )
|
|
32
|
-
// )
|
|
33
|
-
// .addOption(
|
|
34
|
-
// new Option(
|
|
35
|
-
// '-A, --all-separate',
|
|
36
|
-
// 'Import all cmds from separate files (*.cmd.json) in the current directory. Ignored with -i or -a.'
|
|
37
|
-
// )
|
|
38
|
-
// )
|
|
39
|
-
.action(
|
|
40
|
-
// implement command logic inside action handler
|
|
41
|
-
async (host, realm, user, password, options) => {
|
|
42
|
-
state.default.session.setTenant(host);
|
|
43
|
-
state.default.session.setRealm(realm);
|
|
44
|
-
state.default.session.setUsername(user);
|
|
45
|
-
state.default.session.setPassword(password);
|
|
46
|
-
state.default.session.setDeploymentType(options.type);
|
|
47
|
-
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
48
|
-
if (await getTokens()) {
|
|
49
|
-
console.log(`Importing OAuth2 application(s) ...`);
|
|
50
|
-
importOAuth2ClientsFromFile(options.file);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// end command logic inside action handler
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
program.parse();
|
package/src/cli/app/app-list.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common.js';
|
|
4
|
-
|
|
5
|
-
const { getTokens } = Authenticate;
|
|
6
|
-
const { listOAuth2Clients } = OAuth2Client;
|
|
7
|
-
|
|
8
|
-
const program = new Command('frodo app list');
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.description('List OAuth2 applications.')
|
|
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('-l, --long', 'Long with all fields.').default(false, 'false')
|
|
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(`Listing OAuth2 applications...`);
|
|
34
|
-
listOAuth2Clients(options.long);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// end command logic inside action handler
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
program.parse();
|
package/src/cli/app/app.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('app')
|
|
9
|
-
// for backwards compatibility
|
|
10
|
-
.alias('application')
|
|
11
|
-
.helpOption('-h, --help', 'Help')
|
|
12
|
-
.description('Manage OAuth2 applications.')
|
|
13
|
-
.executableDir(__dirname);
|
|
14
|
-
|
|
15
|
-
program.command('list', 'List OAuth2 applications.').showHelpAfterError();
|
|
16
|
-
|
|
17
|
-
// program
|
|
18
|
-
// .command('describe', 'Describe OAuth2 applications.')
|
|
19
|
-
// .showHelpAfterError();
|
|
20
|
-
|
|
21
|
-
program.command('export', 'Export OAuth2 applications.').showHelpAfterError();
|
|
22
|
-
|
|
23
|
-
program.command('import', 'Import OAuth2 applications.').showHelpAfterError();
|
|
24
|
-
|
|
25
|
-
// program.command('delete', 'Delete OAuth2 applications.').showHelpAfterError();
|
|
26
|
-
|
|
27
|
-
program.showHelpAfterError();
|
|
28
|
-
return program;
|
|
29
|
-
}
|