diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-all-static.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-all-static.ts index e97d16099..0d5014903 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-all-static.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-all-static.ts @@ -18,7 +18,6 @@ export default function setup() { [], deploymentTypes ); - // TO DO: adding a realm option to export all-static for specific realm program .description('Export all static config.') .action(async (host, realm, user, password, options, command) => { @@ -36,7 +35,7 @@ export default function setup() { return; } - const outcome = await configManagerExportAllStatic(); + const outcome = await configManagerExportAllStatic(realm); if (!outcome) process.exitCode = 1; }); diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-all.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-all.ts index ab591170c..3c58add49 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-all.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-all.ts @@ -20,7 +20,6 @@ export default function setup() { [], deploymentTypes ); - // TO DO: Adding a realm option to export all config for a specific realm program .description('Export all config.') .addOption( @@ -60,6 +59,7 @@ export default function setup() { ); const outcome = await configManagerExportAllWithConfigFolder({ configFolder: options.configFolder, + realm, }); if (!outcome) process.exitCode = 1; } diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-authentication.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-authentication.ts index ad0987b3e..72ae7c4a2 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-authentication.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-authentication.ts @@ -23,12 +23,6 @@ export default function setup() { program .description('Export authentication objects.') - .addOption( - new Option( - '-r, --realm ', - 'Specifies the realm to export from. Only the entity object from this realm will be exported.' - ) - ) .action(async (host, realm, user, password, options, command) => { command.handleDefaultArgsAndOpts( host, @@ -38,9 +32,6 @@ export default function setup() { options, command ); - if (options.realm) { - realm = options.realm; - } if (await getTokens(false, true, deploymentTypes)) { verboseMessage('Exporting config entity authentication'); const outcome = await configManagerExportAuthentication(realm); diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-authz-policies.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-authz-policies.ts index 639c70cf8..5738e7039 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-authz-policies.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-authz-policies.ts @@ -29,12 +29,6 @@ export default function setup() { program .description('Export authorization policies from realm.') - .addOption( - new Option( - '-r, --realm ', - 'Specifies the realm to export from. Only policy sets from this realm will be exported. Ignored with -f' - ) - ) .addOption( new Option( '-n, --policy-name ', @@ -79,11 +73,6 @@ export default function setup() { command ); - // -r/--realm flag has precedence over [realm] arguement - if (options.realm) { - realm = options.realm; - } - if (await getTokens(false, true, deploymentTypes)) { let outcome: boolean; @@ -141,7 +130,7 @@ export default function setup() { outcome = await configManagerExportAuthzPolicySets(options.file); } - // -r/--realm + // realm argument else if (realm !== constants.DEFAULT_REALM_KEY) { printMessage( `Exporting all the policy sets in the ${state.getRealm()} realm.` diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-journeys.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-journeys.ts index bc947bec2..744103f75 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-journeys.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-journeys.ts @@ -29,12 +29,6 @@ export default function setup() { 'Journey name, It only export the journey with the name.' ) ) - .addOption( - new Option( - '-r, --realm ', - 'Specific realm to get journeys from (overrides environment)' - ) - ) .addOption(new Option('-d, --pull-dependencies', 'Pull dependencies.')) // TO DO: implementing for 'clean' // .addOption( @@ -49,9 +43,6 @@ export default function setup() { options, command ); - if (options.realm) { - realm = options.realm; - } if (await getTokens(false, true, deploymentTypes)) { verboseMessage('Exporting config entity journeys'); diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-oauth2-agents.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-oauth2-agents.ts index b31c79663..6a47267ff 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-oauth2-agents.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-oauth2-agents.ts @@ -29,12 +29,6 @@ export default function setup() { program .description('Export OAuth2 Agents') - .addOption( - new Option( - '-r, --realm ', - 'Specifies the realm to export from. Only the agents from this realm will be exported.' - ) - ) .addOption( new Option( '-n, --agent-name ', @@ -94,11 +88,6 @@ export default function setup() { command ); - // -r/--realm flag has precedence over [realm] arguement - if (options.realm) { - realm = options.realm; - } - if (await getTokens(false, true, deploymentTypes)) { let outcome: boolean; @@ -152,7 +141,7 @@ export default function setup() { outcome = await configManagerExportConfigAgents(options.file); } - // -r/--realm + // realm arugment else if (realm !== constants.DEFAULT_REALM_KEY) { printMessage( `Exporting all the agents from the ${state.getRealm()} realm.` diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-org-privileges.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-org-privileges.ts index 9f9910c3f..9b1d8585f 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-org-privileges.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-org-privileges.ts @@ -1,11 +1,6 @@ import { frodo } from '@rockcarver/frodo-lib'; -import { Option } from 'commander'; -import { - configManagerExportOrgPrivileges, - configManagerExportOrgPrivilegesAllRealms, - configManagerExportOrgPrivilegesRealm, -} from '../../../configManagerOps/FrConfigOrgPrivilegesOps'; +import { configManagerExportOrgPrivileges } from '../../../configManagerOps/FrConfigOrgPrivilegesOps'; import { getTokens } from '../../../ops/AuthenticateOps'; import { printMessage } from '../../../utils/Console'; import { FrodoCommand } from '../../FrodoCommand'; @@ -17,7 +12,6 @@ const deploymentTypes = [ CLOUD_DEPLOYMENT_TYPE_KEY, FORGEOPS_DEPLOYMENT_TYPE_KEY, ]; -const { constants } = frodo.utils; export default function setup() { const program = new FrodoCommand( @@ -28,12 +22,6 @@ export default function setup() { program .description('Export organization privileges config.') - .addOption( - new Option( - '-r, --realm ', - 'Specifies the realm to export from. Only the entity object from this realm will be exported.' - ) - ) .action(async (host, realm, user, password, options, command) => { command.handleDefaultArgsAndOpts( host, @@ -44,26 +32,11 @@ export default function setup() { command ); - // -r flag has precedence - if (options.realm) { - realm = options.realm; - } - if (await getTokens(false, true, deploymentTypes)) { - let outcome: boolean; - if (realm !== constants.DEFAULT_REALM_KEY) { - printMessage( - `Exporting organization privileges config from the realm: "${realm}"` - ); - outcome = - (await configManagerExportOrgPrivileges()) && - (await configManagerExportOrgPrivilegesRealm(realm)); - } else { - printMessage( - 'Exporting oranization privileges config from all realms' - ); - outcome = await configManagerExportOrgPrivilegesAllRealms(); - } + printMessage( + `Exporting organization privileges config from the realm: "${realm}"` + ); + const outcome = await configManagerExportOrgPrivileges(); if (!outcome) process.exitCode = 1; } diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-password-policy.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-password-policy.ts index 97a3c629e..80cd2870c 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-password-policy.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-password-policy.ts @@ -23,12 +23,6 @@ export default function setup() { program .description('Export password-policy objects.') - .addOption( - new Option( - '-r, --realm ', - 'Specifies the realm to export from. Only the entity object from this realm will be exported.' - ) - ) .action(async (host, realm, user, password, options, command) => { command.handleDefaultArgsAndOpts( host, @@ -38,9 +32,6 @@ export default function setup() { options, command ); - if (options.realm) { - realm = options.realm; - } if (await getTokens(false, true, deploymentTypes)) { verboseMessage('Exporting config entity password-policy'); const outcome = await configManagerExportPasswordPolicy(realm); diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-saml.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-saml.ts index 6c25c05cb..0cac82ef4 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-saml.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-saml.ts @@ -64,9 +64,6 @@ export default function setup() { options, command ); - if (options.realm) { - realm = options.realm; - } if (await getTokens(false, true, deploymentTypes)) { verboseMessage('Exporting config entity saml'); diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-scripts.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-scripts.ts index 3beb7f298..a86b79cbf 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-scripts.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-scripts.ts @@ -1,11 +1,7 @@ -import { frodo, state } from '@rockcarver/frodo-lib'; +import { frodo } from '@rockcarver/frodo-lib'; import { Option } from 'commander'; -import { - configManagerExportScript, - configManagerExportScriptsAll, - configManagerExportScriptsRealms, -} from '../../../configManagerOps/FrConfigScriptOps'; +import { configManagerExportScripts } from '../../../configManagerOps/FrConfigScriptOps'; import { getTokens } from '../../../ops/AuthenticateOps'; import { printMessage } from '../../../utils/Console'; import { FrodoCommand } from '../../FrodoCommand'; @@ -17,8 +13,6 @@ const deploymentTypes = [ CLOUD_DEPLOYMENT_TYPE_KEY, FORGEOPS_DEPLOYMENT_TYPE_KEY, ]; -const { constants } = frodo.utils; -const { readRealms } = frodo.realm; export default function setup() { const program = new FrodoCommand( @@ -28,12 +22,6 @@ export default function setup() { program .description('Export authorization scripts.') - .addOption( - new Option( - '-r, --realm ', - 'Specifies the realm to export from. Only the scripts from this realm will be exported.' - ) - ) .addOption( new Option( '-n, --script-name