@rockcarver/frodo-cli 0.13.3 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/package.json +14 -7
  3. package/src/app.js +0 -63
  4. package/src/cli/_template/cmd-delete.js +0 -56
  5. package/src/cli/_template/cmd-describe.js +0 -36
  6. package/src/cli/_template/cmd-export.js +0 -54
  7. package/src/cli/_template/cmd-import.js +0 -54
  8. package/src/cli/_template/cmd-list.js +0 -38
  9. package/src/cli/_template/cmd-sub1-delete.js +0 -56
  10. package/src/cli/_template/cmd-sub1-describe.js +0 -36
  11. package/src/cli/_template/cmd-sub1-export.js +0 -54
  12. package/src/cli/_template/cmd-sub1-import.js +0 -54
  13. package/src/cli/_template/cmd-sub1-list.js +0 -38
  14. package/src/cli/_template/cmd-sub1.js +0 -20
  15. package/src/cli/_template/cmd-sub2-delete.js +0 -56
  16. package/src/cli/_template/cmd-sub2-describe.js +0 -36
  17. package/src/cli/_template/cmd-sub2-export.js +0 -54
  18. package/src/cli/_template/cmd-sub2-import.js +0 -54
  19. package/src/cli/_template/cmd-sub2-list.js +0 -38
  20. package/src/cli/_template/cmd-sub2.js +0 -20
  21. package/src/cli/_template/cmd.js +0 -29
  22. package/src/cli/admin/admin-add-autoid-static-user-mapping.js +0 -40
  23. package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +0 -121
  24. package/src/cli/admin/admin-get-access-token.js +0 -59
  25. package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.js +0 -45
  26. package/src/cli/admin/admin-hide-generic-extension-attributes.js +0 -47
  27. package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +0 -45
  28. package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +0 -46
  29. package/src/cli/admin/admin-list-static-user-mappings.js +0 -53
  30. package/src/cli/admin/admin-remove-static-user-mapping.js +0 -38
  31. package/src/cli/admin/admin-repair-org-model.js +0 -47
  32. package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +0 -47
  33. package/src/cli/admin/admin-show-generic-extension-attributes.js +0 -55
  34. package/src/cli/admin/admin.js +0 -94
  35. package/src/cli/app/app-delete.js +0 -56
  36. package/src/cli/app/app-describe.js +0 -36
  37. package/src/cli/app/app-export.js +0 -78
  38. package/src/cli/app/app-import.js +0 -56
  39. package/src/cli/app/app-list.js +0 -40
  40. package/src/cli/app/app.js +0 -29
  41. package/src/cli/cmd_common.js +0 -181
  42. package/src/cli/conn/conn-add.js +0 -65
  43. package/src/cli/conn/conn-delete.js +0 -22
  44. package/src/cli/conn/conn-describe.js +0 -23
  45. package/src/cli/conn/conn-list.js +0 -27
  46. package/src/cli/conn/conn.js +0 -28
  47. package/src/cli/email/email-template-export.js +0 -90
  48. package/src/cli/email/email-template-import.js +0 -90
  49. package/src/cli/email/email-template-list.js +0 -40
  50. package/src/cli/email/email-template.js +0 -16
  51. package/src/cli/email/email.js +0 -17
  52. package/src/cli/esv/esv-apply.js +0 -120
  53. package/src/cli/esv/esv-secret-create.js +0 -64
  54. package/src/cli/esv/esv-secret-delete.js +0 -65
  55. package/src/cli/esv/esv-secret-describe.js +0 -43
  56. package/src/cli/esv/esv-secret-export.js +0 -54
  57. package/src/cli/esv/esv-secret-import.js +0 -54
  58. package/src/cli/esv/esv-secret-list.js +0 -40
  59. package/src/cli/esv/esv-secret-set.js +0 -45
  60. package/src/cli/esv/esv-secret-version-activate.js +0 -53
  61. package/src/cli/esv/esv-secret-version-create.js +0 -45
  62. package/src/cli/esv/esv-secret-version-deactivate.js +0 -53
  63. package/src/cli/esv/esv-secret-version-delete.js +0 -66
  64. package/src/cli/esv/esv-secret-version-list.js +0 -41
  65. package/src/cli/esv/esv-secret-version.js +0 -20
  66. package/src/cli/esv/esv-secret.js +0 -26
  67. package/src/cli/esv/esv-variable-create.js +0 -46
  68. package/src/cli/esv/esv-variable-delete.js +0 -71
  69. package/src/cli/esv/esv-variable-describe.js +0 -43
  70. package/src/cli/esv/esv-variable-export.js +0 -54
  71. package/src/cli/esv/esv-variable-import.js +0 -54
  72. package/src/cli/esv/esv-variable-list.js +0 -40
  73. package/src/cli/esv/esv-variable-set.js +0 -62
  74. package/src/cli/esv/esv-variable.js +0 -24
  75. package/src/cli/esv/esv.js +0 -21
  76. package/src/cli/idm/idm-count.js +0 -42
  77. package/src/cli/idm/idm-export.js +0 -116
  78. package/src/cli/idm/idm-list.js +0 -40
  79. package/src/cli/idm/idm.js +0 -28
  80. package/src/cli/idp/idp-export.js +0 -90
  81. package/src/cli/idp/idp-import.js +0 -101
  82. package/src/cli/idp/idp-list.js +0 -42
  83. package/src/cli/idp/idp.js +0 -21
  84. package/src/cli/info/info.js +0 -55
  85. package/src/cli/journey/journey-delete.js +0 -78
  86. package/src/cli/journey/journey-describe.js +0 -143
  87. package/src/cli/journey/journey-export.js +0 -110
  88. package/src/cli/journey/journey-import.js +0 -127
  89. package/src/cli/journey/journey-list.js +0 -43
  90. package/src/cli/journey/journey-prune.js +0 -52
  91. package/src/cli/journey/journey.js +0 -37
  92. package/src/cli/logging/logs-list.js +0 -77
  93. package/src/cli/logging/logs-tail.js +0 -85
  94. package/src/cli/logging/logs.js +0 -21
  95. package/src/cli/realm/realm-add-custom-domain.js +0 -47
  96. package/src/cli/realm/realm-describe.js +0 -40
  97. package/src/cli/realm/realm-list.js +0 -40
  98. package/src/cli/realm/realm-remove-custom-domain.js +0 -50
  99. package/src/cli/realm/realm.js +0 -33
  100. package/src/cli/saml/saml-cot-export.js +0 -90
  101. package/src/cli/saml/saml-cot-import.js +0 -101
  102. package/src/cli/saml/saml-cot-list.js +0 -42
  103. package/src/cli/saml/saml-cot.js +0 -16
  104. package/src/cli/saml/saml-describe.js +0 -42
  105. package/src/cli/saml/saml-export.js +0 -91
  106. package/src/cli/saml/saml-import.js +0 -102
  107. package/src/cli/saml/saml-list.js +0 -42
  108. package/src/cli/saml/saml-metadata-export.js +0 -76
  109. package/src/cli/saml/saml-metadata.js +0 -12
  110. package/src/cli/saml/saml.js +0 -29
  111. package/src/cli/script/script-delete.js +0 -56
  112. package/src/cli/script/script-describe.js +0 -36
  113. package/src/cli/script/script-export.js +0 -95
  114. package/src/cli/script/script-import.js +0 -64
  115. package/src/cli/script/script-list.js +0 -42
  116. package/src/cli/script/script.js +0 -25
  117. package/src/cli/theme/theme-delete.js +0 -83
  118. package/src/cli/theme/theme-export.js +0 -107
  119. package/src/cli/theme/theme-import.js +0 -118
  120. package/src/cli/theme/theme-list.js +0 -42
  121. package/src/cli/theme/theme.js +0 -23
  122. package/src/storage/StaticStorage.js +0 -15
  123. package/src/utils/Console.js +0 -482
  124. package/tsconfig.json +0 -106
@@ -1,120 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import {
3
- Authenticate,
4
- Startup,
5
- ManagedObject,
6
- state,
7
- } from '@rockcarver/frodo-lib';
8
- import yesno from 'yesno';
9
- import * as common from '../cmd_common.js';
10
- import { createTable, printMessage } from '../../utils/Console.js';
11
-
12
- const { getTokens } = Authenticate;
13
- const { applyUpdates, checkForUpdates } = Startup;
14
- const { resolveUserName } = ManagedObject;
15
-
16
- const program = new Command('frodo esv apply');
17
-
18
- program
19
- .description(
20
- 'Apply pending changes to secrets and variables. Applying pending changes requires a restart of the AM and IDM pods and can take up to 10 minutes to complete.'
21
- )
22
- .helpOption('-h, --help', 'Help')
23
- .showHelpAfterError()
24
- .addArgument(common.hostArgumentM)
25
- .addArgument(common.realmArgument)
26
- .addArgument(common.userArgument)
27
- .addArgument(common.passwordArgument)
28
- .addOption(common.deploymentOption)
29
- .addOption(common.insecureOption)
30
- .addOption(
31
- new Option(
32
- '--check-only',
33
- "Check if updated need to be apply but don't apply them."
34
- ).default(false, 'false')
35
- )
36
- .addOption(
37
- new Option('--force', 'Force restart of services if no updates are found.')
38
- )
39
- .addOption(
40
- new Option('--no-wait', "Don't wait for the updates to finish applying.")
41
- )
42
- .addOption(
43
- new Option(
44
- '--verbose',
45
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
46
- ).default(false, 'off')
47
- )
48
- .addOption(
49
- new Option(
50
- '--timeout <seconds>',
51
- 'Specify a timeout in seconds how long the tool should wait for the apply command to finish. Only effective without --no-wait.'
52
- ).default(600, '600 secs (10 mins)')
53
- )
54
- .addOption(new Option('-y, --yes', 'Answer y/yes to all prompts.'))
55
- .action(
56
- // implement command logic inside action handler
57
- async (host, realm, user, password, options) => {
58
- state.default.session.setTenant(host);
59
- state.default.session.setRealm(realm);
60
- state.default.session.setUsername(user);
61
- state.default.session.setPassword(password);
62
- state.default.session.setDeploymentType(options.type);
63
- state.default.session.setAllowInsecureConnection(options.insecure);
64
- if (await getTokens()) {
65
- const updates = await checkForUpdates();
66
- const updatesTable = createTable([
67
- 'Type',
68
- 'Name',
69
- 'Modified',
70
- 'Modifier',
71
- ]);
72
- for (const secret of updates.secrets) {
73
- if (!secret['loaded']) {
74
- updatesTable.push([
75
- 'secret',
76
- secret['_id'],
77
- new Date(secret['lastChangeDate']).toLocaleString(),
78
- // eslint-disable-next-line no-await-in-loop
79
- await resolveUserName('teammember', secret['lastChangedBy']),
80
- ]);
81
- }
82
- }
83
- for (const variable of updates.variables) {
84
- if (!variable['loaded']) {
85
- updatesTable.push([
86
- 'variable',
87
- variable['_id'],
88
- new Date(variable['lastChangeDate']).toLocaleString(),
89
- // eslint-disable-next-line no-await-in-loop
90
- await resolveUserName('teammember', variable['lastChangedBy']),
91
- ]);
92
- }
93
- }
94
- if (updatesTable.length > 0) {
95
- printMessage(updatesTable.toString(), 'data');
96
- }
97
- if (!options.checkOnly) {
98
- if (
99
- updates.secrets?.length ||
100
- updates.variables?.length ||
101
- options.force
102
- ) {
103
- const ok =
104
- options.yes ||
105
- (await yesno({
106
- question: `\nChanges may take up to 10 minutes to propagate, during which time you will not be able to make further updates.\n\nApply updates? (y|n):`,
107
- }));
108
- if (ok) {
109
- if (!(await applyUpdates(options.wait, options.timeout * 1000))) {
110
- process.exitCode = 1;
111
- }
112
- }
113
- }
114
- }
115
- }
116
- }
117
- // end command logic inside action handler
118
- );
119
-
120
- program.parse();
@@ -1,64 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { createSecret } = Secrets;
7
-
8
- const program = new Command('frodo esv secret create');
9
-
10
- program
11
- .description('Create secrets.')
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
- .requiredOption('-i, --secret-id <secret-id>', 'Secret id.')
21
- .requiredOption('--value <value>', 'Secret value.')
22
- .option('--description [description]', 'Secret description.')
23
- .addOption(
24
- new Option(
25
- '--encoding [encoding]',
26
- 'Secret encoding. Must be one of "generic", "pem", "base64hmac"'
27
- ).default('generic', 'generic')
28
- )
29
- .addOption(
30
- new Option(
31
- '--no-use-in-placeholders',
32
- 'Secret cannot be used in placeholders.'
33
- )
34
- )
35
- .addOption(
36
- new Option(
37
- '--verbose',
38
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
39
- ).default(false, 'off')
40
- )
41
- .action(
42
- // implement command logic inside action handler
43
- async (host, realm, user, password, options) => {
44
- state.default.session.setTenant(host);
45
- state.default.session.setRealm(realm);
46
- state.default.session.setUsername(user);
47
- state.default.session.setPassword(password);
48
- state.default.session.setDeploymentType(options.type);
49
- state.default.session.setAllowInsecureConnection(options.insecure);
50
- if (await getTokens()) {
51
- console.log('Creating secret...');
52
- createSecret(
53
- options.secretId,
54
- options.value,
55
- options.description,
56
- options.encoding,
57
- options.useInPlaceholders
58
- );
59
- }
60
- }
61
- // end command logic inside action handler
62
- );
63
-
64
- program.parse();
@@ -1,65 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { deleteSecretCmd, deleteSecretsCmd } = Secrets;
7
-
8
- const program = new Command('frodo esv secret delete');
9
-
10
- program
11
- .description('Delete secrets.')
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, --secret-id <secret-id>',
23
- 'Secret id. If specified, -a is ignored.'
24
- )
25
- )
26
- .addOption(
27
- new Option('-a, --all', 'Delete all secrets in a realm. Ignored with -i.')
28
- )
29
- .addOption(
30
- new Option(
31
- '--verbose',
32
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
33
- ).default(false, 'off')
34
- )
35
- .action(
36
- // implement command logic inside action handler
37
- async (host, realm, user, password, options) => {
38
- state.default.session.setTenant(host);
39
- state.default.session.setRealm(realm);
40
- state.default.session.setUsername(user);
41
- state.default.session.setPassword(password);
42
- state.default.session.setDeploymentType(options.type);
43
- state.default.session.setAllowInsecureConnection(options.insecure);
44
- if (await getTokens()) {
45
- // delete by id
46
- if (options.secretId) {
47
- console.log('Deleting secret...');
48
- deleteSecretCmd(options.secretId);
49
- }
50
- // --all -a
51
- else if (options.all) {
52
- console.log('Deleting all secrets...');
53
- deleteSecretsCmd();
54
- }
55
- // unrecognized combination of options or no options
56
- else {
57
- console.log('Unrecognized combination of options or no options...');
58
- program.help();
59
- }
60
- }
61
- }
62
- // end command logic inside action handler
63
- );
64
-
65
- program.parse();
@@ -1,43 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { describeSecret } = Secrets;
7
-
8
- const program = new Command('frodo esv secret describe');
9
-
10
- program
11
- .description('Describe secrets.')
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, --secret-id <secret-id>',
23
- 'Secret id.'
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(`Describing secret ${options.secretId}...`);
37
- describeSecret(options.secretId);
38
- }
39
- }
40
- // end command logic inside action handler
41
- );
42
-
43
- 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 esv secret export');
8
-
9
- program
10
- .description('Export secrets.')
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, --secret-id <secret-id>',
22
- 'Secret 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 secrets to a single file. Ignored with -i.'
30
- )
31
- )
32
- .addOption(
33
- new Option(
34
- '-A, --all-separate',
35
- 'Export all sub1s to separate files (*.secret.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 esv secret import');
8
-
9
- program
10
- .description('Import secrets.')
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, --secret-id <secret-id>',
22
- 'Secret id. If specified, only one secret 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 secrets from single file. Ignored with -i.'
30
- )
31
- )
32
- .addOption(
33
- new Option(
34
- '-A, --all-separate',
35
- 'Import all secrets from separate files (*.secret.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,40 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { listSecrets } = Secrets;
7
-
8
- const program = new Command('frodo esv secret list');
9
-
10
- program
11
- .description('List secrets.')
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 secrets...');
34
- listSecrets(options.long);
35
- }
36
- }
37
- // end command logic inside action handler
38
- );
39
-
40
- program.parse();
@@ -1,45 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { setDescriptionOfSecret } = Secrets;
7
-
8
- const program = new Command('frodo esv secret set');
9
-
10
- program
11
- .description('Create secrets.')
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, --secret-id <secret-id>', 'Secret id.'))
21
- .addOption(new Option('--description <description>', 'Secret description.'))
22
- .addOption(
23
- new Option(
24
- '--verbose',
25
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
26
- ).default(false, 'off')
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('Setting secret description...');
39
- setDescriptionOfSecret(options.secretId, options.description);
40
- }
41
- }
42
- // end command logic inside action handler
43
- );
44
-
45
- program.parse();
@@ -1,53 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { activateVersionOfSecret } = Secrets;
7
-
8
- const program = new Command('frodo esv secret version activate');
9
-
10
- program
11
- .description('Activate versions of secrets.')
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, --secret-id <secret-id>', 'Secret id.'))
21
- .addOption(new Option('-v, --version <version>', 'Version of secret.'))
22
- .addOption(
23
- new Option(
24
- '--verbose',
25
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
26
- ).default(false, 'off')
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
- // activate by id
39
- if (options.secretId && options.version) {
40
- console.log(`Activating version of secret...`);
41
- activateVersionOfSecret(options.secretId, options.version);
42
- }
43
- // unrecognized combination of options or no options
44
- else {
45
- console.log('Unrecognized combination of options or no options...');
46
- program.help();
47
- }
48
- }
49
- }
50
- // end command logic inside action handler
51
- );
52
-
53
- program.parse();
@@ -1,45 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { createNewVersionOfSecretCmd } = Secrets;
7
-
8
- const program = new Command('frodo esv secret version create');
9
-
10
- program
11
- .description('Create new version of secret.')
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, --secret-id <secret-id>', 'Secret id.'))
21
- .addOption(new Option('--value <value>', 'Secret value.'))
22
- .addOption(
23
- new Option(
24
- '--verbose',
25
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
26
- ).default(false, 'off')
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('Creating new version of secret...');
39
- createNewVersionOfSecretCmd(options.secretId, options.value);
40
- }
41
- }
42
- // end command logic inside action handler
43
- );
44
-
45
- program.parse();
@@ -1,53 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
3
- import * as common from '../cmd_common.js';
4
-
5
- const { getTokens } = Authenticate;
6
- const { deactivateVersionOfSecret } = Secrets;
7
-
8
- const program = new Command('frodo esv secret version deactivate');
9
-
10
- program
11
- .description('Deactivate versions of secrets.')
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, --secret-id <secret-id>', 'Secret id.'))
21
- .addOption(new Option('-v, --version <version>', 'Version of secret.'))
22
- .addOption(
23
- new Option(
24
- '--verbose',
25
- 'Verbose output during command execution. If specified, may or may not produce additional output.'
26
- ).default(false, 'off')
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
- // activate by id
39
- if (options.secretId && options.version) {
40
- console.log(`Deactivating version of secret...`);
41
- deactivateVersionOfSecret(options.secretId, options.version);
42
- }
43
- // unrecognized combination of options or no options
44
- else {
45
- console.log('Unrecognized combination of options or no options...');
46
- program.help();
47
- }
48
- }
49
- }
50
- // end command logic inside action handler
51
- );
52
-
53
- program.parse();