-
Notifications
You must be signed in to change notification settings - Fork 2
Changes in commands to support on prem idm #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
phalestrivir
left a comment
There was a problem hiding this 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
- admin-execute-rfc7523-authz-grant-flow.ts
- admin-generate-rfc7523-authz-grant-artefacts.ts
- admin-get-access-token.ts
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:
- email-template-export.e2e.test.js
- email-template-import.e2e.test.js
- idm-export.e2e.test.js
- idm-import.e2e.test.js
- mapping-import.e2e.test.js
- role-export.e2e.test.js
- role-import.e2e.test.js
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/emailTemplateidm/A-idm=>all-separate/idm/global/idmidm/A-mapping=>all-separate/idm/global/mappingidm/A-sync=>all-separate/idm/global/syncidm/A-role=>all-separate/idm/global/internalRole
- Make sure you do a fresh export so you have all the configuration data. You will be using these for the following directories:
idm/all.config.json=>all/all.config.idm.jsonidm/all.idm.json=>all/all.idm.idm.jsonidm/allEmailTemplates.template.email.json=>all/allEmailTemplates.template.email.jsonidm/allInternalRoles.internalRole.json=>all/allInternalRoles.internalRole.jsonidm/allMappings.mapping.json=>all/allMappings.mapping.json
There was a problem hiding this 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
globalDeploymentTypesas 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 fordeploymentTypesfor the normal use case, and pass that into the FrodoCommand constructor instead. Then, in thegetTokensfunction calls, you will want to replaceundefinedwithdeploymentTypes. For these files, thedeploymentTypesshould 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.
phalestrivir
left a comment
There was a problem hiding this 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:
- 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.
- 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
left a comment
There was a problem hiding this 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
|
Created a new PR : #38 |
Built with modified frodo-lib, the new code will detect 'idm' deployment type and support export/import/list commands for the following entities:
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.