Skip to content

Conversation

@skootrivir
Copy link

Built with modified frodo-lib, the new code will detect 'idm' deployment type and support export/import/list commands for the following entities:

  1. idm
  2. Email templates
  3. Mappings
  4. Roles

It will also work with 'config export' and 'config import' commands for IDM as well. it will only export the 4 entities with IDM.
It might create an unhandled error when attempting 'config import' for other deployment types' exported config file.
So it will only support importing the exported config files/file from IDM deployment type.

I added tests for IDM deployment types and updated some of the snapshots and it passed every tests.

@skootrivir skootrivir changed the base branch from main to trivir May 12, 2025 19:55
Copy link
Collaborator

@phalestrivir phalestrivir left a comment

Choose a reason for hiding this comment

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

Add deployment types to the following files

I don’t think any of the admin commands apply to on-prem IDM, so don’t include ‘idm’ as a deployment type for any of them

Additionally, there are many files that are also missing deployment types. Go through all of them and add them in. These include all agent commands, all app commands, and anywhere that uses getTokens without providing deployment types.

Additionally, for the test.js files, make sure the commands at the top of the file are separated like they are in config-export.e2e.test.js so we know which are for cloud and which are for idm. The files that need to be updated to do this are:

Additionally, for the e2e export files, these should be in other directories instead of the idm directory you created. For example:

  • idm/A => all-separate/idm
    • Make sure you do a fresh export so you have all the configuration data. You will be using these for the following directories:
      • idm/A-email => all-separate/idm/global/emailTemplate
      • idm/A-idm => all-separate/idm/global/idm
      • idm/A-mapping => all-separate/idm/global/mapping
      • idm/A-sync => all-separate/idm/global/sync
      • idm/A-role => all-separate/idm/global/internalRole
  • idm/all.config.json => all/all.config.idm.json
  • idm/all.idm.json => all/all.idm.idm.json
  • idm/allEmailTemplates.template.email.json => all/allEmailTemplates.template.email.json
  • idm/allInternalRoles.internalRole.json => all/allInternalRoles.internalRole.json
  • idm/allMappings.mapping.json => all/allMappings.mapping.json

Copy link
Collaborator

@phalestrivir phalestrivir left a comment

Choose a reason for hiding this comment

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

There are still a few more changes that need to be made after I went through everything:

  • For the following files, I noticed you made the globalDeploymentTypes as part of the FrodoCommand constructor. We do not want to do this because those deployment types are specifically for the global flag, which can only be used for classic deployments in AM (except for a few exceptions such as services). For these files, you will want to create another variable for deploymentTypes for the normal use case, and pass that into the FrodoCommand constructor instead. Then, in the getTokens function calls, you will want to replace undefined with deploymentTypes. For these files, the deploymentTypes should contain all the deployment types with the exception of IDM. These are the files:
    • authn-describe.ts
    • authn-export.ts
    • authn-import.ts
    • agent-describe.ts
    • agent-export.ts
    • agent-import.ts
    • agent-list.ts

From my last review, I mentioned the test files need to be updated, and so far I think only one of them was. What I'm referring to is, say we take mapping-import.e2e.test.js file which hasn't been updated, it currently looks like this for the commands at the top:

/*
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import -i sync/managedAlpha_application_managedBravo_application -f test/e2e/exports/all/allMappings.mapping.json
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import --no-deps --mapping-id mapping/managedBravo_group_managedBravo_group --file allMappings.mapping.json -D test/e2e/exports/all
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import -f test/e2e/exports/all/allMappings.mapping.json
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import --no-deps --file allMappings.mapping.json --directory test/e2e/exports/all
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import -af test/e2e/exports/all/allMappings.mapping.json
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import --all --no-deps --file allMappings.mapping.json --directory test/e2e/exports/all
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import -AD test/e2e/exports/all-separate/cloud/global/idm
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import --all-separate --no-deps --directory test/e2e/exports/all-separate/cloud/global/idm

//IDM
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=http://openidm-frodo-dev.classic.com:9080/openidm frodo mapping import -af test/e2e/exports/all/idm/allMappings.mapping.json -m idm
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=http://openidm-frodo-dev.classic.com:9080/openidm frodo mapping import -AD test/e2e/exports/all-separate/idm/A-mapping -m idm
*/

When it should look like:

/*
// Cloud
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import -i sync/managedAlpha_application_managedBravo_application -f test/e2e/exports/all/allMappings.mapping.json
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import --no-deps --mapping-id mapping/managedBravo_group_managedBravo_group --file allMappings.mapping.json -D test/e2e/exports/all
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import -f test/e2e/exports/all/allMappings.mapping.json
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import --no-deps --file allMappings.mapping.json --directory test/e2e/exports/all
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import -af test/e2e/exports/all/allMappings.mapping.json
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import --all --no-deps --file allMappings.mapping.json --directory test/e2e/exports/all
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import -AD test/e2e/exports/all-separate/cloud/global/idm
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo mapping import --all-separate --no-deps --directory test/e2e/exports/all-separate/cloud/global/idm
// IDM
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=http://openidm-frodo-dev.classic.com:9080/openidm frodo mapping import -af test/e2e/exports/all/idm/allMappings.mapping.json -m idm
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=http://openidm-frodo-dev.classic.com:9080/openidm frodo mapping import -AD test/e2e/exports/all-separate/idm/A-mapping -m idm
*/

Basically, labeling the Cloud commands so it's obvious which commands are for which deployment type. Refer to my last review for the files that need to be updated.

The other thing is for the separate export files. In the test/e2e/exports/all-separate/idm directory, there should only be 1 directory: global. Currently, the global directory is stored in the A directory. All the A directories are unnecessary since the global directory contains all the separate exports. The reason for doing it this way is so that in the future if we need to update these export files we can simply run an export command such as frodo idm export -AD test/e2e/exports/all-separate/idm frodo-dev to update the files, plus doing it this way means we don't have the duplicated files. You will probably need to update your tests though to reference the directories in the global directory as opposed to the A directories.

The last thing is to go through the other comments I left on code and make those changes. If any of them are done I'll mark them as resolved.

Copy link
Collaborator

@phalestrivir phalestrivir left a comment

Choose a reason for hiding this comment

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

I made a commit to fix some linting and typos. Everything is good to go with the exception of two things:

  1. The config-import.e2e.test.js.snap file has a few tests which are displaying the help text. This indicates that there is an error with those tests that needs to be fixed.
  2. Connections.json, in the test/e2e/env folder, was updated to include the openidm connection. Is this necessary? We didn't have to do this for the on-prem AM tests, so I don't think we need to have it for the IDM tests

@phalestrivir phalestrivir changed the base branch from trivir to main June 5, 2025 19:36
Copy link
Collaborator

@phalestrivir phalestrivir left a comment

Choose a reason for hiding this comment

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

Looks good, and tests are passing

@phalestrivir phalestrivir requested a review from hfranklin June 17, 2025 21:22
@skootrivir
Copy link
Author

Created a new PR : #38

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