@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.
Files changed (138) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/package.json +2 -2
  3. package/babel.config.esm.json +0 -6
  4. package/src/app.ts +0 -63
  5. package/src/cli/_template/cmd-delete.ts +0 -56
  6. package/src/cli/_template/cmd-describe.ts +0 -36
  7. package/src/cli/_template/cmd-export.ts +0 -54
  8. package/src/cli/_template/cmd-import.ts +0 -54
  9. package/src/cli/_template/cmd-list.ts +0 -38
  10. package/src/cli/_template/cmd-sub1-delete.ts +0 -56
  11. package/src/cli/_template/cmd-sub1-describe.ts +0 -36
  12. package/src/cli/_template/cmd-sub1-export.ts +0 -54
  13. package/src/cli/_template/cmd-sub1-import.ts +0 -54
  14. package/src/cli/_template/cmd-sub1-list.ts +0 -38
  15. package/src/cli/_template/cmd-sub1.ts +0 -20
  16. package/src/cli/_template/cmd-sub2-delete.ts +0 -56
  17. package/src/cli/_template/cmd-sub2-describe.ts +0 -36
  18. package/src/cli/_template/cmd-sub2-export.ts +0 -54
  19. package/src/cli/_template/cmd-sub2-import.ts +0 -54
  20. package/src/cli/_template/cmd-sub2-list.ts +0 -38
  21. package/src/cli/_template/cmd-sub2.ts +0 -20
  22. package/src/cli/_template/cmd.ts +0 -29
  23. package/src/cli/admin/admin-add-autoid-static-user-mapping.ts +0 -40
  24. package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.ts +0 -121
  25. package/src/cli/admin/admin-get-access-token.ts +0 -59
  26. package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.ts +0 -45
  27. package/src/cli/admin/admin-hide-generic-extension-attributes.ts +0 -47
  28. package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.ts +0 -45
  29. package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.ts +0 -46
  30. package/src/cli/admin/admin-list-static-user-mappings.ts +0 -53
  31. package/src/cli/admin/admin-remove-static-user-mapping.ts +0 -38
  32. package/src/cli/admin/admin-repair-org-model.ts +0 -53
  33. package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.ts +0 -47
  34. package/src/cli/admin/admin-show-generic-extension-attributes.ts +0 -55
  35. package/src/cli/admin/admin.ts +0 -94
  36. package/src/cli/app/app-delete.ts +0 -56
  37. package/src/cli/app/app-describe.ts +0 -36
  38. package/src/cli/app/app-export.ts +0 -78
  39. package/src/cli/app/app-import.ts +0 -56
  40. package/src/cli/app/app-list.ts +0 -40
  41. package/src/cli/app/app.ts +0 -29
  42. package/src/cli/cmd_common.ts +0 -181
  43. package/src/cli/conn/conn-add.ts +0 -65
  44. package/src/cli/conn/conn-delete.ts +0 -22
  45. package/src/cli/conn/conn-describe.ts +0 -23
  46. package/src/cli/conn/conn-list.ts +0 -27
  47. package/src/cli/conn/conn.ts +0 -28
  48. package/src/cli/email/email-template-export.ts +0 -90
  49. package/src/cli/email/email-template-import.ts +0 -90
  50. package/src/cli/email/email-template-list.ts +0 -40
  51. package/src/cli/email/email-template.ts +0 -16
  52. package/src/cli/email/email.ts +0 -17
  53. package/src/cli/esv/esv-apply.ts +0 -120
  54. package/src/cli/esv/esv-secret-create.ts +0 -64
  55. package/src/cli/esv/esv-secret-delete.ts +0 -65
  56. package/src/cli/esv/esv-secret-describe.ts +0 -43
  57. package/src/cli/esv/esv-secret-export.ts +0 -54
  58. package/src/cli/esv/esv-secret-import.ts +0 -54
  59. package/src/cli/esv/esv-secret-list.ts +0 -40
  60. package/src/cli/esv/esv-secret-set.ts +0 -45
  61. package/src/cli/esv/esv-secret-version-activate.ts +0 -53
  62. package/src/cli/esv/esv-secret-version-create.ts +0 -45
  63. package/src/cli/esv/esv-secret-version-deactivate.ts +0 -53
  64. package/src/cli/esv/esv-secret-version-delete.ts +0 -66
  65. package/src/cli/esv/esv-secret-version-list.ts +0 -41
  66. package/src/cli/esv/esv-secret-version.ts +0 -20
  67. package/src/cli/esv/esv-secret.ts +0 -26
  68. package/src/cli/esv/esv-variable-create.ts +0 -46
  69. package/src/cli/esv/esv-variable-delete.ts +0 -71
  70. package/src/cli/esv/esv-variable-describe.ts +0 -43
  71. package/src/cli/esv/esv-variable-export.ts +0 -54
  72. package/src/cli/esv/esv-variable-import.ts +0 -54
  73. package/src/cli/esv/esv-variable-list.ts +0 -40
  74. package/src/cli/esv/esv-variable-set.ts +0 -62
  75. package/src/cli/esv/esv-variable.ts +0 -24
  76. package/src/cli/esv/esv.ts +0 -21
  77. package/src/cli/idm/idm-count.ts +0 -42
  78. package/src/cli/idm/idm-export.ts +0 -116
  79. package/src/cli/idm/idm-list.ts +0 -40
  80. package/src/cli/idm/idm.ts +0 -28
  81. package/src/cli/idp/idp-export.ts +0 -90
  82. package/src/cli/idp/idp-import.ts +0 -101
  83. package/src/cli/idp/idp-list.ts +0 -42
  84. package/src/cli/idp/idp.ts +0 -21
  85. package/src/cli/info/info.ts +0 -55
  86. package/src/cli/journey/journey-delete.e2e.test_.ts +0 -380
  87. package/src/cli/journey/journey-delete.ts +0 -78
  88. package/src/cli/journey/journey-describe.ts +0 -148
  89. package/src/cli/journey/journey-export.ts +0 -110
  90. package/src/cli/journey/journey-import.ts +0 -127
  91. package/src/cli/journey/journey-list.e2e.test_.ts +0 -142
  92. package/src/cli/journey/journey-list.ts +0 -43
  93. package/src/cli/journey/journey-prune.ts +0 -52
  94. package/src/cli/journey/journey.ts +0 -37
  95. package/src/cli/logging/logs-list.ts +0 -77
  96. package/src/cli/logging/logs-tail.ts +0 -85
  97. package/src/cli/logging/logs.ts +0 -21
  98. package/src/cli/realm/realm-add-custom-domain.ts +0 -47
  99. package/src/cli/realm/realm-describe.ts +0 -40
  100. package/src/cli/realm/realm-list.ts +0 -40
  101. package/src/cli/realm/realm-remove-custom-domain.ts +0 -50
  102. package/src/cli/realm/realm.ts +0 -33
  103. package/src/cli/saml/saml-cot-export.ts +0 -90
  104. package/src/cli/saml/saml-cot-import.ts +0 -101
  105. package/src/cli/saml/saml-cot-list.ts +0 -42
  106. package/src/cli/saml/saml-cot.ts +0 -16
  107. package/src/cli/saml/saml-describe.ts +0 -42
  108. package/src/cli/saml/saml-export.ts +0 -91
  109. package/src/cli/saml/saml-import.ts +0 -102
  110. package/src/cli/saml/saml-list.ts +0 -42
  111. package/src/cli/saml/saml-metadata-export.ts +0 -76
  112. package/src/cli/saml/saml-metadata.ts +0 -12
  113. package/src/cli/saml/saml.ts +0 -29
  114. package/src/cli/script/script-delete.ts +0 -56
  115. package/src/cli/script/script-describe.ts +0 -36
  116. package/src/cli/script/script-export.ts +0 -95
  117. package/src/cli/script/script-import.ts +0 -64
  118. package/src/cli/script/script-list.ts +0 -42
  119. package/src/cli/script/script.ts +0 -25
  120. package/src/cli/theme/theme-delete.e2e.test_.ts +0 -178
  121. package/src/cli/theme/theme-delete.ts +0 -83
  122. package/src/cli/theme/theme-export.ts +0 -107
  123. package/src/cli/theme/theme-import.ts +0 -118
  124. package/src/cli/theme/theme-list.e2e.test_.ts +0 -119
  125. package/src/cli/theme/theme-list.ts +0 -42
  126. package/src/cli/theme/theme.ts +0 -23
  127. package/src/ops/CirclesOfTrustOps.ts +0 -12
  128. package/src/ops/EmailTemplateOps.ts +0 -19
  129. package/src/ops/IdpOps.ts +0 -11
  130. package/src/ops/JourneyOps.ts +0 -278
  131. package/src/ops/NodeOps.ts +0 -47
  132. package/src/ops/Saml2Ops.ts +0 -24
  133. package/src/ops/ScriptOps.ts +0 -11
  134. package/src/ops/ThemeOps.ts +0 -17
  135. package/src/ops/utils/Wordwrap.ts +0 -11
  136. package/src/storage/StaticStorage.ts +0 -15
  137. package/src/utils/Console.ts +0 -483
  138. package/tsconfig.json +0 -106
@@ -1,21 +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('logs')
9
- .summary('List/View Identity Cloud logs')
10
- .description(
11
- `View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.`
12
- )
13
- .helpOption('-h, --help', 'Help')
14
- .executableDir(__dirname);
15
-
16
- program
17
- .command('list', 'List available ID Cloud log sources.')
18
- .showHelpAfterError();
19
- program.command('tail', 'Tail Identity Cloud logs.').showHelpAfterError();
20
- return program;
21
- }
@@ -1,47 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Realm, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { addCustomDomain } = Realm;
7
-
8
- const program = new Command('frodo realm add-custom-domain');
9
-
10
- program
11
- .description('Add custom domain (realm DNS alias).')
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
- '-d, --domain <name>',
23
- 'Custom DNS domain name.'
24
- ).makeOptionMandatory()
25
- )
26
- .action(
27
- // implement command logic inside action handler
28
- async (host, realm, user, password, options) => {
29
- state.default.session.setTenant(host);
30
- state.default.session.setRealm(realm);
31
- state.default.session.setUsername(user);
32
- state.default.session.setPassword(password);
33
- state.default.session.setDeploymentType(options.type);
34
- state.default.session.setAllowInsecureConnection(options.insecure);
35
- if (await getTokens()) {
36
- console.log(
37
- `Adding custom DNS domain ${
38
- options.domain
39
- } to realm ${state.default.session.getRealm()}...`
40
- );
41
- await addCustomDomain(state.default.session.getRealm(), options.domain);
42
- }
43
- }
44
- // end command logic inside action handler
45
- );
46
-
47
- program.parse();
@@ -1,40 +0,0 @@
1
- import { Command } from 'commander';
2
- import { Authenticate, Realm, Utils, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getRealmName } = Utils;
6
- const { getTokens } = Authenticate;
7
- const { describe } = Realm;
8
-
9
- const program = new Command('frodo realm describe');
10
-
11
- program
12
- .description('Describe realms.')
13
- .helpOption('-h, --help', 'Help')
14
- .showHelpAfterError()
15
- .addArgument(common.hostArgumentM)
16
- .addArgument(common.realmArgument)
17
- .addArgument(common.userArgument)
18
- .addArgument(common.passwordArgument)
19
- .addOption(common.deploymentOption)
20
- .addOption(common.insecureOption)
21
- .action(
22
- // implement command logic inside action handler
23
- async (host, realm, user, password, options) => {
24
- state.default.session.setTenant(host);
25
- state.default.session.setRealm(realm);
26
- state.default.session.setUsername(user);
27
- state.default.session.setPassword(password);
28
- state.default.session.setDeploymentType(options.type);
29
- state.default.session.setAllowInsecureConnection(options.insecure);
30
- if (await getTokens()) {
31
- console.log(
32
- `Retrieving details of realm ${state.default.session.getRealm()}...`
33
- );
34
- describe(getRealmName(state.default.session.getRealm()));
35
- }
36
- }
37
- // end command logic inside action handler
38
- );
39
-
40
- program.parse();
@@ -1,40 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Realm, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { listRealms } = Realm;
6
- const { getTokens } = Authenticate;
7
-
8
- const program = new Command('frodo realm list');
9
-
10
- program
11
- .description('List realms.')
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 all realms...');
34
- await listRealms(options.long);
35
- }
36
- }
37
- // end command logic inside action handler
38
- );
39
-
40
- program.parse();
@@ -1,50 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Realm, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { removeCustomDomain } = Realm;
7
-
8
- const program = new Command('frodo realm remove-custom-domain');
9
-
10
- program
11
- .description('Remove custom domain (realm DNS alias).')
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
- '-d, --domain <name>',
23
- 'Custom DNS domain name.'
24
- ).makeOptionMandatory()
25
- )
26
- .action(
27
- // implement command logic inside action handler
28
- async (host, realm, user, password, options) => {
29
- state.default.session.setTenant(host);
30
- state.default.session.setRealm(realm);
31
- state.default.session.setUsername(user);
32
- state.default.session.setPassword(password);
33
- state.default.session.setDeploymentType(options.type);
34
- state.default.session.setAllowInsecureConnection(options.insecure);
35
- if (await getTokens()) {
36
- console.log(
37
- `Removing custom DNS domain ${
38
- options.domain
39
- } from realm ${state.default.session.getRealm()}...`
40
- );
41
- await removeCustomDomain(
42
- state.default.session.getRealm(),
43
- options.domain
44
- );
45
- }
46
- }
47
- // end command logic inside action handler
48
- );
49
-
50
- program.parse();
@@ -1,33 +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('realm')
9
- .helpOption('-h, --help', 'Help')
10
- .description('Manage realms.')
11
- .executableDir(__dirname);
12
-
13
- program.command('list', 'List realms.').showHelpAfterError();
14
-
15
- program
16
- .command('describe', 'Describe realms.')
17
- // for backwards compatibility
18
- .alias('details')
19
- .showHelpAfterError();
20
-
21
- program
22
- .command('add-custom-domain', 'Add custom domain (realm DNS alias).')
23
- .showHelpAfterError();
24
-
25
- program
26
- .command('remove-custom-domain', 'Remove custom domain (realm DNS alias).')
27
- .showHelpAfterError();
28
-
29
- // program.command('delete', 'Delete realms.').showHelpAfterError();
30
-
31
- program.showHelpAfterError();
32
- return program;
33
- }
@@ -1,90 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, CirclesOfTrust, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const {
7
- exportCircleOfTrust,
8
- exportCirclesOfTrustToFile,
9
- exportCirclesOfTrustToFiles,
10
- } = CirclesOfTrust;
11
-
12
- const program = new Command('frodo saml cot export');
13
-
14
- program
15
- .description('Export SAML circles of trust.')
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, --cot-id <cot-id>',
27
- 'Circle of trust id/name. If specified, -a and -A are ignored.'
28
- )
29
- )
30
- .addOption(
31
- new Option(
32
- '-f, --file [file]',
33
- 'Name of the export file. Ignored with -A. Defaults to <cot-id>.cot.saml.json.'
34
- )
35
- )
36
- .addOption(
37
- new Option(
38
- '-a, --all',
39
- 'Export all the circles of trust in a realm to a single file. Ignored with -i.'
40
- )
41
- )
42
- .addOption(
43
- new Option(
44
- '-A, --all-separate',
45
- 'Export all the circles of trust in a realm as separate files <cot-id>.cot.saml.json. Ignored with -i, and -a.'
46
- )
47
- )
48
- .action(
49
- // implement command logic inside action handler
50
- async (host, realm, user, password, options) => {
51
- state.default.session.setTenant(host);
52
- state.default.session.setRealm(realm);
53
- state.default.session.setUsername(user);
54
- state.default.session.setPassword(password);
55
- state.default.session.setDeploymentType(options.type);
56
- state.default.session.setAllowInsecureConnection(options.insecure);
57
- if (await getTokens()) {
58
- // export by id/name
59
- if (options.cotId) {
60
- console.log(
61
- `Exporting circle of trust "${
62
- options.cotId
63
- }" from realm "${state.default.session.getRealm()}"...`
64
- );
65
- exportCircleOfTrust(options.cotId, options.file);
66
- }
67
- // --all -a
68
- else if (options.all) {
69
- console.log('Exporting all circles of trust to a single file...');
70
- exportCirclesOfTrustToFile(options.file);
71
- }
72
- // --all-separate -A
73
- else if (options.allSeparate) {
74
- console.log('Exporting all circles of trust to separate files...');
75
- exportCirclesOfTrustToFiles();
76
- }
77
- // unrecognized combination of options or no options
78
- else {
79
- console.log(
80
- 'Unrecognized combination of options or no options...',
81
- 'error'
82
- );
83
- program.help();
84
- }
85
- }
86
- }
87
- // end command logic inside action handler
88
- );
89
-
90
- program.parse();
@@ -1,101 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, CirclesOfTrust, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const {
7
- importCircleOfTrust,
8
- importCirclesOfTrustFromFile,
9
- importCirclesOfTrustFromFiles,
10
- importFirstCircleOfTrust,
11
- } = CirclesOfTrust;
12
-
13
- const program = new Command('frodo saml cot import');
14
-
15
- program
16
- .description('Import SAML circles of trust.')
17
- .helpOption('-h, --help', 'Help')
18
- .showHelpAfterError()
19
- .addArgument(common.hostArgumentM)
20
- .addArgument(common.realmArgument)
21
- .addArgument(common.userArgument)
22
- .addArgument(common.passwordArgument)
23
- .addOption(common.deploymentOption)
24
- .addOption(common.insecureOption)
25
- .addOption(
26
- new Option(
27
- '-i, --cot-id <cot-id>',
28
- 'Circle of trust id. If specified, only one circle of trust is imported and the options -a and -A are ignored.'
29
- )
30
- )
31
- .addOption(
32
- new Option(
33
- '-f, --file <file>',
34
- 'Name of the file to import the circle(s) of trust from.'
35
- )
36
- )
37
- .addOption(
38
- new Option(
39
- '-a, --all',
40
- 'Import all circles of trust from single file. Ignored with -i.'
41
- )
42
- )
43
- .addOption(
44
- new Option(
45
- '-A, --all-separate',
46
- 'Import all circles of trust from separate files (*.cot.saml.json) in the current directory. Ignored with -i or -a.'
47
- )
48
- )
49
- .action(
50
- // implement program logic inside action handler
51
- async (host, realm, user, password, options) => {
52
- state.default.session.setTenant(host);
53
- state.default.session.setRealm(realm);
54
- state.default.session.setUsername(user);
55
- state.default.session.setPassword(password);
56
- state.default.session.setDeploymentType(options.type);
57
- state.default.session.setAllowInsecureConnection(options.insecure);
58
- if (await getTokens()) {
59
- // import by id
60
- if (options.file && options.cotId) {
61
- console.log(
62
- `Importing circle of trust "${
63
- options.cotId
64
- }" into realm "${state.default.session.getRealm()}"...`
65
- );
66
- importCircleOfTrust(options.cotId, options.file);
67
- }
68
- // --all -a
69
- else if (options.all && options.file) {
70
- console.log(
71
- `Importing all circles of trust from a single file (${options.file})...`
72
- );
73
- importCirclesOfTrustFromFile(options.file);
74
- }
75
- // --all-separate -A
76
- else if (options.allSeparate && !options.file) {
77
- console.log(
78
- 'Importing all circles of trust from separate files (*.saml.json) in current directory...'
79
- );
80
- importCirclesOfTrustFromFiles();
81
- }
82
- // import first provider from file
83
- else if (options.file) {
84
- console.log(
85
- `Importing first circle of trust from file "${
86
- options.file
87
- }" into realm "${state.default.session.getRealm()}"...`
88
- );
89
- importFirstCircleOfTrust(options.file);
90
- }
91
- // unrecognized combination of options or no options
92
- else {
93
- console.log('Unrecognized combination of options or no options...');
94
- program.help();
95
- }
96
- }
97
- }
98
- // end program logic inside action handler
99
- );
100
-
101
- program.parse();
@@ -1,42 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, CirclesOfTrust, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { listCirclesOfTrust } = CirclesOfTrust;
7
-
8
- const program = new Command('frodo saml cot list');
9
-
10
- program
11
- .description('List SAML circles of trust.')
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(
34
- `Listing SAML circles of trust in realm "${state.default.session.getRealm()}"...`
35
- );
36
- listCirclesOfTrust(options.long);
37
- }
38
- }
39
- // end command logic inside action handler
40
- );
41
-
42
- program.parse();
@@ -1,16 +0,0 @@
1
- import { Command } from 'commander';
2
-
3
- const program = new Command('frodo saml cot');
4
-
5
- program
6
- .description('Manage circles of trust.')
7
- .helpOption('-h, --help', 'Help')
8
- .showHelpAfterError();
9
-
10
- program.command('list', 'List circles of trust.').showHelpAfterError();
11
-
12
- program.command('export', 'Export circles of trust.').showHelpAfterError();
13
-
14
- program.command('import', 'Import circles of trust.').showHelpAfterError();
15
-
16
- program.parse();
@@ -1,42 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Saml2, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { describeSaml2Provider } = Saml2;
7
-
8
- const program = new Command('frodo saml describe');
9
-
10
- program
11
- .description('Describe the configuration of an entity provider.')
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('-i, --entity-id <entity-id>', 'Entity id.'))
21
- .action(
22
- // implement command logic inside action handler
23
- async (host, realm, user, password, options) => {
24
- state.default.session.setTenant(host);
25
- state.default.session.setRealm(realm);
26
- state.default.session.setUsername(user);
27
- state.default.session.setPassword(password);
28
- state.default.session.setDeploymentType(options.type);
29
- state.default.session.setAllowInsecureConnection(options.insecure);
30
- if (await getTokens()) {
31
- console.log(
32
- `Describing SAML entity provider ${
33
- options.entityId
34
- } in realm "${state.default.session.getRealm()}"...`
35
- );
36
- describeSaml2Provider(options.entityId);
37
- }
38
- }
39
- // end command logic inside action handler
40
- );
41
-
42
- program.parse();
@@ -1,91 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Saml2, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
-
7
- const {
8
- exportSaml2ProviderToFile,
9
- exportSaml2ProvidersToFile,
10
- exportSaml2ProvidersToFiles,
11
- } = Saml2;
12
-
13
- const program = new Command('frodo saml export');
14
-
15
- program
16
- .description('Export SAML entity providers.')
17
- .helpOption('-h, --help', 'Help')
18
- .showHelpAfterError()
19
- .addArgument(common.hostArgumentM)
20
- .addArgument(common.realmArgument)
21
- .addArgument(common.userArgument)
22
- .addArgument(common.passwordArgument)
23
- .addOption(common.deploymentOption)
24
- .addOption(common.insecureOption)
25
- .addOption(
26
- new Option(
27
- '-i, --entity-id <entity-id>',
28
- 'Entity id. If specified, -a and -A are ignored.'
29
- )
30
- )
31
- .addOption(
32
- new Option(
33
- '-f, --file [file]',
34
- 'Name of the file to write the exported provider(s) to. Ignored with -A. If not specified, the export file is named <id>.saml.json.'
35
- )
36
- )
37
- .addOption(
38
- new Option(
39
- '-a, --all',
40
- 'Export all the providers in a realm to a single file. Ignored with -t and -i.'
41
- )
42
- )
43
- .addOption(
44
- new Option(
45
- '-A, --all-separate',
46
- 'Export all the providers in a realm as separate files <provider name>.saml.json. Ignored with -t, -i, and -a.'
47
- )
48
- )
49
- .action(
50
- // implement command logic inside action handler
51
- async (host, realm, user, password, options) => {
52
- state.default.session.setTenant(host);
53
- state.default.session.setRealm(realm);
54
- state.default.session.setUsername(user);
55
- state.default.session.setPassword(password);
56
- state.default.session.setDeploymentType(options.type);
57
- state.default.session.setAllowInsecureConnection(options.insecure);
58
- if (await getTokens()) {
59
- // export by id/name
60
- if (options.entityId) {
61
- console.log(
62
- `Exporting provider "${
63
- options.entityId
64
- }" from realm "${state.default.session.getRealm()}"...`
65
- );
66
- exportSaml2ProviderToFile(options.entityId, options.file);
67
- }
68
- // --all -a
69
- else if (options.all) {
70
- console.log('Exporting all providers to a single file...');
71
- exportSaml2ProvidersToFile(options.file);
72
- }
73
- // --all-separate -A
74
- else if (options.allSeparate) {
75
- console.log('Exporting all providers to separate files...');
76
- exportSaml2ProvidersToFiles();
77
- }
78
- // unrecognized combination of options or no options
79
- else {
80
- console.log(
81
- 'Unrecognized combination of options or no options...',
82
- 'error'
83
- );
84
- program.help();
85
- }
86
- }
87
- }
88
- // end command logic inside action handler
89
- );
90
-
91
- program.parse();