Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default function setup() {
[],
deploymentTypes
);
// TO DO: adding a realm option to export all-static for specific realm

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs implementation for realm argument

program
.description('Export all static config.')
.action(async (host, realm, user, password, options, command) => {
Expand All @@ -36,7 +35,7 @@ export default function setup() {
return;
}

const outcome = await configManagerExportAllStatic();
const outcome = await configManagerExportAllStatic(realm);
if (!outcome) process.exitCode = 1;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default function setup() {
[],
deploymentTypes
);
// TO DO: Adding a realm option to export all config for a specific realm

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs implementation of realm argument

program
.description('Export all config.')
.addOption(
Expand Down Expand Up @@ -60,6 +59,7 @@ export default function setup() {
);
const outcome = await configManagerExportAllWithConfigFolder({
configFolder: options.configFolder,
realm,
});
if (!outcome) process.exitCode = 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ export default function setup() {

program
.description('Export authentication objects.')
.addOption(
new Option(
'-r, --realm <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,
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ export default function setup() {

program
.description('Export authorization policies from realm.')
.addOption(
new Option(
'-r, --realm <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 <policy-set-name>',
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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.`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ export default function setup() {
'Journey name, It only export the journey with the name.'
)
)
.addOption(
new Option(
'-r, --realm <realm>',
'Specific realm to get journeys from (overrides environment)'
)
)
.addOption(new Option('-d, --pull-dependencies', 'Pull dependencies.'))
// TO DO: implementing for 'clean'
// .addOption(
Expand All @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ export default function setup() {

program
.description('Export OAuth2 Agents')
.addOption(
new Option(
'-r, --realm <realm>',
'Specifies the realm to export from. Only the agents from this realm will be exported.'
)
)
.addOption(
new Option(
'-n, --agent-name <agent name>',
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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.`
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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(
Expand All @@ -28,12 +22,6 @@ export default function setup() {

program
.description('Export organization privileges config.')
.addOption(
new Option(
'-r, --realm <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,
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ export default function setup() {

program
.description('Export password-policy objects.')
.addOption(
new Option(
'-r, --realm <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,
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Loading