Skip to content

feat: Add config-manager push saml command#93

Open
dallinjsevy wants to merge 2 commits into
mainfrom
feature/config-manager-push-saml
Open

feat: Add config-manager push saml command#93
dallinjsevy wants to merge 2 commits into
mainfrom
feature/config-manager-push-saml

Conversation

@dallinjsevy

Copy link
Copy Markdown

No description provided.

@dallinjsevy dallinjsevy requested a review from phalestrivir April 8, 2026 14:57
@dallinjsevy dallinjsevy force-pushed the feature/config-manager-push-saml branch 2 times, most recently from 17d9021 to 69afd91 Compare April 9, 2026 18:58
@dallinjsevy dallinjsevy force-pushed the feature/config-manager-push-saml branch from 69afd91 to 174bab7 Compare May 26, 2026 20:05
);

if (await getTokens(false, true, deploymentTypes)) {
verboseMessage('Exporting config entity saml');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd probably reword this to "Exporting SAML configuration..."

Config entity is a term that Frodo uses when referring to IDM configuration, which SAML is AM configuration

Comment on lines +36 to +49
if (await getTokens(false, true, deploymentTypes)) {
verboseMessage('Exporting config entity saml');
const outcome = await configManagerImportSaml();
if (!outcome) process.exitCode = 1;
}
// unrecognized combination of options or no options
else {
printMessage(
'Unrecognized combination of options or no options...',
'error'
);
program.help();
process.exitCode = 1;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Change this code to look something like this:

const getTokensIsSuccessful = await getTokens(
false,
true,
deploymentTypes
);
if (!getTokensIsSuccessful) process.exit(1);
verboseMessage('Importing email provider configuration.');
const outcome = await configManagerImportEmailProvider();
if (!outcome) process.exitCode = 1;

We are changing it so that way we don't display the help menu when the failure is caused by something other than options. Since it's possible the command can be run without options, we don't need to display the help menu here.


program
.description('Import saml configuration.')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove this blank line

Comment on lines +8 to +14
const { CLOUD_DEPLOYMENT_TYPE_KEY, FORGEOPS_DEPLOYMENT_TYPE_KEY } =
frodo.utils.constants;

const deploymentTypes = [
CLOUD_DEPLOYMENT_TYPE_KEY,
FORGEOPS_DEPLOYMENT_TYPE_KEY,
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove deployment types here, since SAML is supported by all deployments at the moment.

* Import all SAML entity providers from all *.saml.json files in the current directory
* @returns {Promise<boolean>} true if successful, false otherwise
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove this space between the comment and the function

Comment on lines +167 to +175
const samlImportData: Saml2ExportInterface = {
script: {},
saml: { hosted, remote, metadata },
};

const cotImportData: CirclesOfTrustExportInterface = {
script: {},
saml: { hosted: {}, remote: {}, metadata: {}, cot },
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would merge this into one object:

const samlImportData: Saml2ExportInterface = {
  script: {},
  saml: { hosted, remote, metadata, cot },
};

You then pass this object into both of the functions below. The saml imports will ignore the circles of trust passed in, and vice versa for the circle of trust imports.

saml: { hosted: {}, remote: {}, metadata: {}, cot },
};

await importSaml2Providers(samlImportData, { deps: true });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No need to pass in options here, just do:

await importSaml2Providers(samlImportData);

Dependencies are just scripts, which config manager doesn't support importing with this command

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Revert this file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Revert this file


/*
// ForgeOps
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://nightly.gcp.forgeops.com/am frodo config-manager push saml -D test/e2e/exports/fr-config-manager/forgeops -m forgeops

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remember to add tests for the -n, --name option, and also the realm argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants