From 507dab437c158e3dda2ee43871360220a4c52cd4 Mon Sep 17 00:00:00 2001 From: Dallin Sevy Date: Tue, 18 Aug 2026 13:35:17 -0600 Subject: [PATCH] feat: add config-manager idm-authentication commands --- .../config-manager-pull-idm-authentication.ts | 47 ++ .../config-manager-pull.ts | 2 + .../config-manager-push-idm-authentication.ts | 47 ++ .../config-manager-push.ts | 2 + .../FrConfigIdmAuthenticationOpts.ts | 44 ++ ...nager-pull-idm-authentication.test.js.snap | 29 + .../config-manager-pull.test.js.snap | 61 ++ ...nager-push-idm-authentication.test.js.snap | 29 + .../config-manager-push.test.js.snap | 1 + ...ig-manager-pull-idm-authentication.test.js | 10 + .../client_cli/en/config-manager-pull.test.js | 10 + ...ig-manager-push-idm-authentication.test.js | 10 + ...r-pull-idm-authentication.e2e.test.js.snap | 68 ++ ...r-push-idm-authentication.e2e.test.js.snap | 8 + ...anager-pull-idm-authentication.e2e.test.js | 67 ++ ...anager-push-idm-authentication.e2e.test.js | 71 ++ .../authentication.json | 60 ++ .../am_1076162899/recording.har | 631 ++++++++++++++++++ .../oauth2_393036114/recording.har | 289 ++++++++ .../openidm_3290118515/recording.har | 158 +++++ .../am_1076162899/recording.har | 631 ++++++++++++++++++ .../oauth2_393036114/recording.har | 289 ++++++++ .../openidm_3290118515/recording.har | 167 +++++ 23 files changed, 2731 insertions(+) create mode 100644 src/cli/config-manager/config-manager-pull/config-manager-pull-idm-authentication.ts create mode 100644 src/cli/config-manager/config-manager-push/config-manager-push-idm-authentication.ts create mode 100644 src/configManagerOps/FrConfigIdmAuthenticationOpts.ts create mode 100644 test/client_cli/en/__snapshots__/config-manager-pull-idm-authentication.test.js.snap create mode 100644 test/client_cli/en/__snapshots__/config-manager-pull.test.js.snap create mode 100644 test/client_cli/en/__snapshots__/config-manager-push-idm-authentication.test.js.snap create mode 100644 test/client_cli/en/config-manager-pull-idm-authentication.test.js create mode 100644 test/client_cli/en/config-manager-pull.test.js create mode 100644 test/client_cli/en/config-manager-push-idm-authentication.test.js create mode 100644 test/e2e/__snapshots__/config-manager-pull-idm-authentication.e2e.test.js.snap create mode 100644 test/e2e/__snapshots__/config-manager-push-idm-authentication.e2e.test.js.snap create mode 100644 test/e2e/config-manager-pull-idm-authentication.e2e.test.js create mode 100644 test/e2e/config-manager-push-idm-authentication.e2e.test.js create mode 100644 test/e2e/exports/fr-config-manager/forgeops/idm-authentication-config/authentication.json create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/am_1076162899/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/oauth2_393036114/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/openidm_3290118515/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/am_1076162899/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/oauth2_393036114/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/openidm_3290118515/recording.har diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-idm-authentication.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-idm-authentication.ts new file mode 100644 index 000000000..3ea20f107 --- /dev/null +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-idm-authentication.ts @@ -0,0 +1,47 @@ +import { frodo } from '@rockcarver/frodo-lib'; + +import { configManagerExportIdmAuthentication } from '../../../configManagerOps/FrConfigIdmAuthenticationOpts'; +import { getTokens } from '../../../ops/AuthenticateOps'; +import { verboseMessage } from '../../../utils/Console'; +import { FrodoCommand } from '../../FrodoCommand'; + +const { CLOUD_DEPLOYMENT_TYPE_KEY, FORGEOPS_DEPLOYMENT_TYPE_KEY } = + frodo.utils.constants; + +const deploymentTypes = [ + CLOUD_DEPLOYMENT_TYPE_KEY, + FORGEOPS_DEPLOYMENT_TYPE_KEY, +]; + +export default function setup() { + const program = new FrodoCommand( + 'frodo config-manager pull idm-authentication', + [], + deploymentTypes + ); + + program + .description('Export idm authentication config.') + .action(async (host, realm, user, password, options, command) => { + command.handleDefaultArgsAndOpts( + host, + realm, + user, + password, + options, + command + ); + + const getTokensIsSuccessful = await getTokens( + false, + true, + deploymentTypes + ); + if (!getTokensIsSuccessful) process.exit(1); + verboseMessage('Exporting idm authentication configuration.'); + const outcome = await configManagerExportIdmAuthentication(); + if (!outcome) process.exitCode = 1; + }); + + return program; +} diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull.ts index cc5701a31..060232971 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull.ts @@ -14,6 +14,7 @@ import CustomNodes from './config-manager-pull-custom-nodes'; import EmailProvider from './config-manager-pull-email-provider'; import EmailTemplates from './config-manager-pull-email-templates'; import Endpoints from './config-manager-pull-endpoints'; +import IdmAuthentication from './config-manager-pull-idm-authentication'; import IgaWorkflows from './config-manager-pull-iga-workflows'; import InternalRoles from './config-manager-pull-internal-roles'; import Journeys from './config-manager-pull-journeys'; @@ -58,6 +59,7 @@ export default function setup() { program.addCommand(EmailProvider().name('email-provider')); program.addCommand(EmailTemplates().name('email-templates')); program.addCommand(Endpoints().name('endpoints')); + program.addCommand(IdmAuthentication().name('idm-authentication')); program.addCommand(InternalRoles().name('internal-roles')); program.addCommand(Journeys().name('journeys')); program.addCommand(Kba().name('kba')); diff --git a/src/cli/config-manager/config-manager-push/config-manager-push-idm-authentication.ts b/src/cli/config-manager/config-manager-push/config-manager-push-idm-authentication.ts new file mode 100644 index 000000000..56ebf7865 --- /dev/null +++ b/src/cli/config-manager/config-manager-push/config-manager-push-idm-authentication.ts @@ -0,0 +1,47 @@ +import { frodo } from '@rockcarver/frodo-lib'; + +import { configManagerImportIdmAuthentication } from '../../../configManagerOps/FrConfigIdmAuthenticationOpts'; +import { getTokens } from '../../../ops/AuthenticateOps'; +import { verboseMessage } from '../../../utils/Console'; +import { FrodoCommand } from '../../FrodoCommand'; + +const { CLOUD_DEPLOYMENT_TYPE_KEY, FORGEOPS_DEPLOYMENT_TYPE_KEY } = + frodo.utils.constants; + +const deploymentTypes = [ + CLOUD_DEPLOYMENT_TYPE_KEY, + FORGEOPS_DEPLOYMENT_TYPE_KEY, +]; + +export default function setup() { + const program = new FrodoCommand( + 'frodo config-manager push idm-authentication', + [], + deploymentTypes + ); + + program + .description('Import idm authentication.') + .action(async (host, realm, user, password, options, command) => { + command.handleDefaultArgsAndOpts( + host, + realm, + user, + password, + options, + command + ); + + const getTokensIsSuccessful = await getTokens( + false, + true, + deploymentTypes + ); + if (!getTokensIsSuccessful) process.exit(1); + verboseMessage('Importing idm authentication configuration.'); + const outcome = await configManagerImportIdmAuthentication(); + if (!outcome) process.exitCode = 1; + }); + + return program; +} diff --git a/src/cli/config-manager/config-manager-push/config-manager-push.ts b/src/cli/config-manager/config-manager-push/config-manager-push.ts index 542ec2c7e..24f71c30b 100644 --- a/src/cli/config-manager/config-manager-push/config-manager-push.ts +++ b/src/cli/config-manager/config-manager-push/config-manager-push.ts @@ -11,6 +11,7 @@ import CustomNodes from './config-manager-push-custom-nodes'; import EmailProvider from './config-manager-push-email-provider'; import EmailTemplates from './config-manager-push-email-templates'; import Endpoints from './config-manager-push-endpoints'; +import IdmAuthentication from './config-manager-push-idm-authentication'; import IgaWorkflows from './config-manager-push-iga-workflows'; import InternalRoles from './config-manager-push-internal-roles'; import Journeys from './config-manager-push-journeys'; @@ -42,6 +43,7 @@ export default function setup() { program.addCommand(Kba().name('kba')); program.addCommand(InternalRoles().name('internal-roles')); program.addCommand(IgaWorkflows().name('iga-workflows')); + program.addCommand(IdmAuthentication().name('idm-authentication')); program.addCommand(EmailTemplates().name('email-templates')); program.addCommand(Schedules().name('schedules')); program.addCommand(OrgPrivileges().name('org-privileges')); diff --git a/src/configManagerOps/FrConfigIdmAuthenticationOpts.ts b/src/configManagerOps/FrConfigIdmAuthenticationOpts.ts new file mode 100644 index 000000000..310ce81d7 --- /dev/null +++ b/src/configManagerOps/FrConfigIdmAuthenticationOpts.ts @@ -0,0 +1,44 @@ +import { frodo } from '@rockcarver/frodo-lib'; +import { IdObjectSkeletonInterface } from '@rockcarver/frodo-lib/types/api/ApiTypes'; + +import { printError } from '../utils/Console'; + +const { readConfigEntity, updateConfigEntity } = frodo.idm.config; +const { getFilePath, saveJsonToFile, readJsonFile } = frodo.utils; + +/** + * Export Idm authentication configuration in fr-config-manager format. + * @return {Promise} a promise that resolves to true if successful, false otherwise + */ +export async function configManagerExportIdmAuthentication(): Promise { + try { + const exportData = await readConfigEntity('authentication'); + saveJsonToFile( + exportData, + getFilePath('idm-authentication-config/authentication.json', true), + false + ); + return true; + } catch (error) { + printError(error, `Error exporting config entity selfservice.kba`); + } + return false; +} + +/** + * Import Idm authentication configuration in fr-config-manager format. + * @return {Promise} a promise that resolves to true if successful, false otherwise + */ +export async function configManagerImportIdmAuthentication(): Promise { + try { + const filePath = getFilePath( + 'idm-authentication-config/authentication.json' + ); + const config = readJsonFile(filePath) as IdObjectSkeletonInterface; + await updateConfigEntity(config._id, config); + return true; + } catch (error) { + printError(error); + } + return false; +} diff --git a/test/client_cli/en/__snapshots__/config-manager-pull-idm-authentication.test.js.snap b/test/client_cli/en/__snapshots__/config-manager-pull-idm-authentication.test.js.snap new file mode 100644 index 000000000..d7c072c52 --- /dev/null +++ b/test/client_cli/en/__snapshots__/config-manager-pull-idm-authentication.test.js.snap @@ -0,0 +1,29 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CLI help interface for 'config-manager pull idm-authentication' should be expected english 1`] = ` +"Usage: frodo config-manager pull idm-authentication [options] [host] [realm] [username] [password] + +[Experimental] Export idm authentication config. + +Arguments: + host AM base URL, e.g.: https://cdk.iam.example.com/am. To use a + connection profile, just specify a unique substring or + alias. + realm Realm. Specify realm as '/' for the root realm or 'realm' or + '/parent/child' otherwise. (default: "alpha" for Identity + Cloud tenants, "/" otherwise.) + username Username to login with. Must be an admin user with + appropriate rights to manage authentication journeys/trees. + If given without a password, and it matches the username + already stored in the connection profile for the target + host, frodo uses that profile's stored password instead of + requiring it on the command line. + password Password. + +Options: + -h, --help Help + -hh, --help-more Help with all options. + -hhh, --help-all Help with all options, environment variables, and usage + examples. +" +`; diff --git a/test/client_cli/en/__snapshots__/config-manager-pull.test.js.snap b/test/client_cli/en/__snapshots__/config-manager-pull.test.js.snap new file mode 100644 index 000000000..5a94b8107 --- /dev/null +++ b/test/client_cli/en/__snapshots__/config-manager-pull.test.js.snap @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CLI help interface for 'config-manager pull' should be expected english 1`] = ` +"Usage: frodo config-manager pull [options] [command] + +[Experimental] Export configuration optimized for CI/CD pipelines (format +compatible with fr-config-manager). + +Options: + -h, --help Help + -hh, --help-more Help with all options. + -hhh, --help-all Help with all options, environment variables, and usage + examples. + +Commands: + access-config [Experimental] Export access-config objects. + all [Experimental] Export all config. + all-static [Experimental] Export all static config. + audit [Experimental] Export audit objects. + authentication [Experimental] Export authentication objects. + authz-policies [Experimental] Export authorization policies from + realm. + connector-definitions [Experimental] Export aconnector definitions. + connector-mappings [Experimental] Export connector mappings. + cookie-domains [Experimental] Export cookie-domains objects. + cors [Experimental] Export CORS configuration. + csp [Experimental] Export content security policy. + custom-nodes [Experimental] Export custom nodes. + email-provider [Experimental] Export email provider configuration. + email-templates [Experimental] Export email-templates objects. + endpoints [Experimental] Export custom endpoints objects. + help display help for command + idm-authentication [Experimental] Export idm authentication config. + internal-roles [Experimental] Export internal roles. + journeys [Experimental] Export journeys. + kba [Experimental] Export kba-config objects. + locales [Experimental] Export custom locales objects. + managed-objects [Experimental] Export managed-objects. + oauth2-agents [Experimental] Export OAuth2 Agents + org-privileges [Experimental] Export organization privileges config. + password-policy [Experimental] Export password-policy objects. + raw [Experimental] Export raw configurations from the + tenant. + remote-servers [Experimental] Export remote-servers objects. + saml [Experimental] Export saml. + schedules [Experimental] Export schedules. + scripts [Experimental] Export authorization scripts. + secret-mappings [Experimental] Export secret mappings. + secrets [Experimental] Export secrets. + service-objects [Experimental] Export service objects. + services [Experimental] Export authentication services. + terms-and-conditions [Experimental] Export terms and conditions. + test [Experimental] Test connection and authentication. + themes [Experimental] Export themes. + ui-config [Experimental] Export ui-configuration objects. + variables [Experimental] Export variables objects. + + (Cloud-only): + iga-workflows [Experimental] Export iga-workflows. +" +`; diff --git a/test/client_cli/en/__snapshots__/config-manager-push-idm-authentication.test.js.snap b/test/client_cli/en/__snapshots__/config-manager-push-idm-authentication.test.js.snap new file mode 100644 index 000000000..d14a4f603 --- /dev/null +++ b/test/client_cli/en/__snapshots__/config-manager-push-idm-authentication.test.js.snap @@ -0,0 +1,29 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CLI help interface for 'config-manager push idm-authentication' should be expected english 1`] = ` +"Usage: frodo config-manager push idm-authentication [options] [host] [realm] [username] [password] + +[Experimental] Import idm authentication. + +Arguments: + host AM base URL, e.g.: https://cdk.iam.example.com/am. To use a + connection profile, just specify a unique substring or + alias. + realm Realm. Specify realm as '/' for the root realm or 'realm' or + '/parent/child' otherwise. (default: "alpha" for Identity + Cloud tenants, "/" otherwise.) + username Username to login with. Must be an admin user with + appropriate rights to manage authentication journeys/trees. + If given without a password, and it matches the username + already stored in the connection profile for the target + host, frodo uses that profile's stored password instead of + requiring it on the command line. + password Password. + +Options: + -h, --help Help + -hh, --help-more Help with all options. + -hhh, --help-all Help with all options, environment variables, and usage + examples. +" +`; diff --git a/test/client_cli/en/__snapshots__/config-manager-push.test.js.snap b/test/client_cli/en/__snapshots__/config-manager-push.test.js.snap index e0c932fb4..81cc2947b 100644 --- a/test/client_cli/en/__snapshots__/config-manager-push.test.js.snap +++ b/test/client_cli/en/__snapshots__/config-manager-push.test.js.snap @@ -25,6 +25,7 @@ Commands: email-templates [Experimental] Import email template objects. endpoints [Experimental] Import custom endpoints objects. help display help for command + idm-authentication [Experimental] Import idm authentication. internal-roles [Experimental] Import internal roles. journeys [Experimental] Import journeys. kba [Experimental] Import kba configuration. diff --git a/test/client_cli/en/config-manager-pull-idm-authentication.test.js b/test/client_cli/en/config-manager-pull-idm-authentication.test.js new file mode 100644 index 000000000..2fa03ded0 --- /dev/null +++ b/test/client_cli/en/config-manager-pull-idm-authentication.test.js @@ -0,0 +1,10 @@ +import cp from 'child_process'; +import { promisify } from 'util'; + +const exec = promisify(cp.exec); +const CMD = 'frodo config-manager pull idm-authentication --help'; +const { stdout } = await exec(CMD); + +test("CLI help interface for 'config-manager pull idm-authentication' should be expected english", async () => { + expect(stdout).toMatchSnapshot(); +}); \ No newline at end of file diff --git a/test/client_cli/en/config-manager-pull.test.js b/test/client_cli/en/config-manager-pull.test.js new file mode 100644 index 000000000..8590ce677 --- /dev/null +++ b/test/client_cli/en/config-manager-pull.test.js @@ -0,0 +1,10 @@ +import cp from 'child_process'; +import { promisify } from 'util'; + +const exec = promisify(cp.exec); +const CMD = 'frodo config-manager pull --help'; +const { stdout } = await exec(CMD); + +test("CLI help interface for 'config-manager pull' should be expected english", async () => { + expect(stdout).toMatchSnapshot(); +}); diff --git a/test/client_cli/en/config-manager-push-idm-authentication.test.js b/test/client_cli/en/config-manager-push-idm-authentication.test.js new file mode 100644 index 000000000..e2b7b011b --- /dev/null +++ b/test/client_cli/en/config-manager-push-idm-authentication.test.js @@ -0,0 +1,10 @@ +import cp from 'child_process'; +import { promisify } from 'util'; + +const exec = promisify(cp.exec); +const CMD = 'frodo config-manager push idm-authentication --help'; +const { stdout } = await exec(CMD); + +test("CLI help interface for 'config-manager push idm-authentication' should be expected english", async () => { + expect(stdout).toMatchSnapshot(); +}); \ No newline at end of file diff --git a/test/e2e/__snapshots__/config-manager-pull-idm-authentication.e2e.test.js.snap b/test/e2e/__snapshots__/config-manager-pull-idm-authentication.e2e.test.js.snap new file mode 100644 index 000000000..27b5eabfe --- /dev/null +++ b/test/e2e/__snapshots__/config-manager-pull-idm-authentication.e2e.test.js.snap @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`frodo config-manager pull idm-authentication "frodo config-manager pull idm-authentication -D idmAuthDir -m forgeops": should export idm authentication from forgeops" 1`] = `0`; + +exports[`frodo config-manager pull idm-authentication "frodo config-manager pull idm-authentication -D idmAuthDir -m forgeops": should export idm authentication from forgeops" 2`] = `""`; + +exports[`frodo config-manager pull idm-authentication "frodo config-manager pull idm-authentication -D idmAuthDir -m forgeops": should export idm authentication from forgeops": idmAuthDir/idm-authentication-config/authentication.json 1`] = ` +{ + "_id": "authentication", + "rsFilter": { + "anonymousUserMapping": { + "executeAugmentationScript": false, + "localUser": "internal/user/anonymous", + "roles": [ + "internal/role/openidm-reg", + ], + }, + "augmentSecurityContext": { + "source": "require('auth/orgPrivileges').assignPrivilegesToUser(resource, security, properties, subjectMapping, privileges, 'privileges', 'privilegeAssignments');", + "type": "text/javascript", + }, + "cache": { + "maxTimeout": "300 seconds", + }, + "clientId": "idm-resource-server", + "clientSecret": "&{rs.client.secret|password}", + "scopes": [ + "fr:idm:*", + ], + "staticUserMapping": [ + { + "executeAugmentationScript": false, + "localUser": "internal/user/openidm-admin", + "roles": [ + "internal/role/openidm-authorized", + "internal/role/openidm-admin", + ], + "subject": "amadmin", + }, + { + "executeAugmentationScript": false, + "localUser": "internal/user/idm-provisioning", + "roles": [ + "internal/role/openidm-admin", + ], + "subject": "idm-provisioning", + }, + ], + "subjectMapping": [ + { + "additionalUserFields": [ + "adminOfOrg", + "ownerOfOrg", + ], + "defaultRoles": [ + "internal/role/openidm-authorized", + ], + "propertyMapping": { + "sub": "_id", + }, + "queryOnResource": "managed/user", + "userRoles": "authzRoles/*", + }, + ], + "tokenIntrospectUrl": "http://am/am/oauth2/introspect", + }, +} +`; diff --git a/test/e2e/__snapshots__/config-manager-push-idm-authentication.e2e.test.js.snap b/test/e2e/__snapshots__/config-manager-push-idm-authentication.e2e.test.js.snap new file mode 100644 index 000000000..1ef399c18 --- /dev/null +++ b/test/e2e/__snapshots__/config-manager-push-idm-authentication.e2e.test.js.snap @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`frodo config-manager push idm-authentication "frodo config-manager push idm-authentication -D test/e2e/exports/fr-config-manager/forgeops/ -m forgeops": should import idm authentication into forgeops" 1`] = `""`; + +exports[`frodo config-manager push idm-authentication "frodo config-manager push idm-authentication -D test/e2e/exports/fr-config-manager/forgeops/ -m forgeops": should import idm authentication into forgeops" 2`] = ` +"Experimental feature in use: 'frodo config-manager push idm-authentication'. This feature may change without notice. +" +`; diff --git a/test/e2e/config-manager-pull-idm-authentication.e2e.test.js b/test/e2e/config-manager-pull-idm-authentication.e2e.test.js new file mode 100644 index 000000000..6a50abac5 --- /dev/null +++ b/test/e2e/config-manager-pull-idm-authentication.e2e.test.js @@ -0,0 +1,67 @@ +/** + * Follow this process to write e2e tests for the CLI project: + * + * 1. Test if all the necessary mocks for your tests already exist. + * In mock mode, run the command you want to test with the same arguments + * and parameters exactly as you want to test it, for example: + * + * $ FRODO_MOCK=1 frodo conn save https://openam-frodo-dev.forgeblocks.com/am volker.scheuber@forgerock.com Sup3rS3cr3t! + * + * If your command completes without errors and with the expected results, + * all the required mocks already exist and you are good to write your + * test and skip to step #4. + * + * If, however, your command fails and you see errors like the one below, + * you know you need to record the mock responses first: + * + * [Polly] [adapter:node-http] Recording for the following request is not found and `recordIfMissing` is `false`. + * + * 2. Record mock responses for your exact command. + * In mock record mode, run the command you want to test with the same arguments + * and parameters exactly as you want to test it, for example: + * + * $ FRODO_MOCK=record frodo conn save https://openam-frodo-dev.forgeblocks.com/am volker.scheuber@forgerock.com Sup3rS3cr3t! + * + * Wait until you see all the Polly instances (mock recording adapters) have + * shutdown before you try to run step #1 again. + * Messages like these indicate mock recording adapters shutting down: + * + * Polly instance 'conn/4' stopping in 3s... + * Polly instance 'conn/4' stopping in 2s... + * Polly instance 'conn/save/3' stopping in 3s... + * Polly instance 'conn/4' stopping in 1s... + * Polly instance 'conn/save/3' stopping in 2s... + * Polly instance 'conn/4' stopped. + * Polly instance 'conn/save/3' stopping in 1s... + * Polly instance 'conn/save/3' stopped. + * + * 3. Validate your freshly recorded mock responses are complete and working. + * Re-run the exact command you want to test in mock mode (see step #1). + * + * 4. Write your test. + * Make sure to use the exact command including number of arguments and params. + * + * 5. Commit both your test and your new recordings to the repository. + * Your tests are likely going to reside outside the frodo-lib project but + * the recordings must be committed to the frodo-lib project. + */ + +/* +// ForgeOps +FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://nightly.gcp.forgeops.com/am frodo config-manager pull idm-authentication -D test/e2e/exports/fr-config-manager/forgeops -m forgeops + +*/ +import { getEnv, testExport } from './utils/TestUtils'; +import { forgeops_connection as fc } from './utils/TestConfig'; + +process.env['FRODO_MOCK'] = '1'; +const forgeopsEnv = getEnv(fc); + +const dirName = "idmAuthDir"; + +describe('frodo config-manager pull idm-authentication', () => { + test(`"frodo config-manager pull idm-authentication -D ${dirName} -m forgeops": should export idm authentication from forgeops"`, async () => { + const CMD = `frodo config-manager pull idm-authentication -D ${dirName} -m forgeops`; + await testExport(CMD, forgeopsEnv, undefined, undefined, dirName, false); + }); +}); diff --git a/test/e2e/config-manager-push-idm-authentication.e2e.test.js b/test/e2e/config-manager-push-idm-authentication.e2e.test.js new file mode 100644 index 000000000..93097c664 --- /dev/null +++ b/test/e2e/config-manager-push-idm-authentication.e2e.test.js @@ -0,0 +1,71 @@ +/** + * Follow this process to write e2e tests for the CLI project: + * + * 1. Test if all the necessary mocks for your tests already exist. + * In mock mode, run the command you want to test with the same arguments + * and parameters exactly as you want to test it, for example: + * + * $ FRODO_MOCK=1 frodo conn save https://openam-frodo-dev.forgeblocks.com/am volker.scheuber@forgerock.com Sup3rS3cr3t! + * + * If your command completes without errors and with the expected results, + * all the required mocks already exist and you are good to write your + * test and skip to step #4. + * + * If, however, your command fails and you see errors like the one below, + * you know you need to record the mock responses first: + * + * [Polly] [adapter:node-http] Recording for the following request is not found and `recordIfMissing` is `false`. + * + * 2. Record mock responses for your exact command. + * In mock record mode, run the command you want to test with the same arguments + * and parameters exactly as you want to test it, for example: + * + * $ FRODO_MOCK=record frodo conn save https://openam-frodo-dev.forgeblocks.com/am volker.scheuber@forgerock.com Sup3rS3cr3t! + * + * Wait until you see all the Polly instances (mock recording adapters) have + * shutdown before you try to run step #1 again. + * Messages like these indicate mock recording adapters shutting down: + * + * Polly instance 'conn/4' stopping in 3s... + * Polly instance 'conn/4' stopping in 2s... + * Polly instance 'conn/save/3' stopping in 3s... + * Polly instance 'conn/4' stopping in 1s... + * Polly instance 'conn/save/3' stopping in 2s... + * Polly instance 'conn/4' stopped. + * Polly instance 'conn/save/3' stopping in 1s... + * Polly instance 'conn/save/3' stopped. + * + * 3. Validate your freshly recorded mock responses are complete and working. + * Re-run the exact command you want to test in mock mode (see step #1). + * + * 4. Write your test. + * Make sure to use the exact command including number of arguments and params. + * + * 5. Commit both your test and your new recordings to the repository. + * Your tests are likely going to reside outside the frodo-lib project but + * the recordings must be committed to the frodo-lib project. + */ + +/* +// ForgeOps +FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://nightly.gcp.forgeops.com/am frodo config-manager push idm-authentication -D test/e2e/exports/fr-config-manager/forgeops -m forgeops + +*/ + +import { getEnv, testSuccess } from './utils/TestUtils'; +import { forgeops_connection as fc } from './utils/TestConfig'; + + + +process.env['FRODO_MOCK'] = '1'; +const forgeopsEnv = getEnv(fc); + + +const forgeopsDirectory = "test/e2e/exports/fr-config-manager/forgeops/"; + +describe('frodo config-manager push idm-authentication', () => { + test(`"frodo config-manager push idm-authentication -D ${forgeopsDirectory} -m forgeops": should import idm authentication into forgeops"`, async () => { + const CMD = `frodo config-manager push idm-authentication -D ${forgeopsDirectory} -m forgeops`; + await testSuccess(CMD, forgeopsEnv); + }); +}); \ No newline at end of file diff --git a/test/e2e/exports/fr-config-manager/forgeops/idm-authentication-config/authentication.json b/test/e2e/exports/fr-config-manager/forgeops/idm-authentication-config/authentication.json new file mode 100644 index 000000000..2b178188b --- /dev/null +++ b/test/e2e/exports/fr-config-manager/forgeops/idm-authentication-config/authentication.json @@ -0,0 +1,60 @@ +{ + "_id": "authentication", + "rsFilter": { + "anonymousUserMapping": { + "executeAugmentationScript": false, + "localUser": "internal/user/anonymous", + "roles": [ + "internal/role/openidm-reg" + ] + }, + "augmentSecurityContext": { + "source": "require('auth/orgPrivileges').assignPrivilegesToUser(resource, security, properties, subjectMapping, privileges, 'privileges', 'privilegeAssignments');", + "type": "text/javascript" + }, + "cache": { + "maxTimeout": "300 seconds" + }, + "clientId": "idm-resource-server", + "clientSecret": "&{rs.client.secret|password}", + "scopes": [ + "fr:idm:*" + ], + "staticUserMapping": [ + { + "executeAugmentationScript": false, + "localUser": "internal/user/openidm-admin", + "roles": [ + "internal/role/openidm-authorized", + "internal/role/openidm-admin" + ], + "subject": "amadmin" + }, + { + "executeAugmentationScript": false, + "localUser": "internal/user/idm-provisioning", + "roles": [ + "internal/role/openidm-admin" + ], + "subject": "idm-provisioning" + } + ], + "subjectMapping": [ + { + "additionalUserFields": [ + "adminOfOrg", + "ownerOfOrg" + ], + "defaultRoles": [ + "internal/role/openidm-authorized" + ], + "propertyMapping": { + "sub": "_id" + }, + "queryOnResource": "managed/user", + "userRoles": "authzRoles/*" + } + ], + "tokenIntrospectUrl": "http://am/am/oauth2/introspect" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/am_1076162899/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/am_1076162899/recording.har new file mode 100644 index 000000000..5c9dd7f79 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/am_1076162899/recording.har @@ -0,0 +1,631 @@ +{ + "log": { + "_recordingName": "config-manager/pull/idm-authentication/0_D_m/am", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ccd7a5defd0fdeaa986a2b54642d911a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "resource=1.1" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 367, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://platform.dev.trivir.com/am/json/serverinfo/*" + }, + "response": { + "bodySize": 585, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 585, + "text": "{\"_id\":\"*\",\"_rev\":\"-2120245986\",\"domains\":[],\"protectedUserAttributes\":[\"telephoneNumber\",\"mail\"],\"cookieName\":\"iPlanetDirectoryPro\",\"secureCookie\":true,\"forgotPassword\":\"true\",\"forgotUsername\":\"true\",\"kbaEnabled\":\"false\",\"selfRegistration\":\"true\",\"lang\":\"en-US\",\"successfulUserRegistrationDestination\":\"default\",\"socialImplementations\":[],\"referralsEnabled\":\"false\",\"zeroPageLogin\":{\"enabled\":false,\"refererWhitelist\":[],\"allowedWithoutReferer\":true},\"realm\":\"/\",\"xuiUserSessionValidationEnabled\":true,\"fileBasedConfiguration\":true,\"userIdAttributes\":[],\"nodeDesignerXuiEnabled\":true}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "585" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.1" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 630, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:13:25.352Z", + "time": 28, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 28 + } + }, + { + "_id": "9f5671275c36a1c0090d0df26ce0e93f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 2, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "resource=2.0, protocol=1.0" + }, + { + "name": "x-openam-username", + "value": "" + }, + { + "name": "x-openam-password", + "value": "" + }, + { + "name": "content-length", + "value": "2" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 494, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{}" + }, + "queryString": [], + "url": "https://platform.dev.trivir.com/am/json/realms/root/authenticate" + }, + "response": { + "bodySize": 167, + "content": { + "mimeType": "application/json", + "size": 167, + "text": "{\"tokenId\":\"\",\"successUrl\":\"/am/console\",\"realm\":\"/\"}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + }, + { + "httpOnly": true, + "name": "iPlanetDirectoryPro", + "path": "/", + "sameSite": "none", + "secure": true, + "value": "" + }, + { + "httpOnly": true, + "name": "amlbcookie", + "path": "/", + "sameSite": "none", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "content-length", + "value": "167" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "iPlanetDirectoryPro=; Path=/; Secure; HttpOnly; SameSite=none" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "amlbcookie=; Path=/; Secure; HttpOnly; SameSite=none" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "private" + }, + { + "name": "content-api-version", + "value": "resource=2.1" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 693, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:13:25.387Z", + "time": 39, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 39 + } + }, + { + "_id": "6a3744385d3fd7416ea7089e610fa7e7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 128, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "resource=4.0" + }, + { + "name": "content-length", + "value": "128" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 421, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"tokenId\":\"\"}" + }, + "queryString": [ + { + "name": "_action", + "value": "getSessionInfo" + } + ], + "url": "https://platform.dev.trivir.com/am/json/realms/root/sessions/?_action=getSessionInfo" + }, + "response": { + "bodySize": 289, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 289, + "text": "{\"username\":\"amadmin\",\"universalId\":\"id=amadmin,ou=user,ou=am-config\",\"realm\":\"/\",\"latestAccessTime\":\"2026-08-18T19:13:25Z\",\"maxIdleExpirationTime\":\"2026-08-18T19:43:25Z\",\"maxSessionExpirationTime\":\"2026-08-18T21:13:24Z\",\"properties\":{\"AMCtxId\":\"b87e08c1-edd8-4888-82cc-7967a2744f53-718\"}}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "289" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "private" + }, + { + "name": "content-api-version", + "value": "resource=4.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 610, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:13:25.433Z", + "time": 8, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 8 + } + }, + { + "_id": "6125d0328ad0dcaee55f73fd8b22ca14", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "resource=1.0" + }, + { + "name": "cookie", + "value": "iPlanetDirectoryPro=" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 517, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://platform.dev.trivir.com/am/json/serverinfo/version" + }, + "response": { + "bodySize": 257, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 257, + "text": "{\"_id\":\"version\",\"_rev\":\"-466575464\",\"version\":\"8.0.1\",\"fullVersion\":\"ForgeRock Access Management 8.0.1 Build b59bc0908346197b0c33afcb9e733d0400feeea1 (2025-April-15 11:37)\",\"revision\":\"b59bc0908346197b0c33afcb9e733d0400feeea1\",\"date\":\"2025-April-15 11:37\"}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "257" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 631, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:13:25.446Z", + "time": 11, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 11 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/oauth2_393036114/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/oauth2_393036114/recording.har new file mode 100644 index 000000000..20cfc7594 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/oauth2_393036114/recording.har @@ -0,0 +1,289 @@ +{ + "log": { + "_recordingName": "config-manager/pull/idm-authentication/0_D_m/oauth2", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "a684e2f67fd67a4263878c3124af167a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 365, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/x-www-form-urlencoded" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "cookie", + "value": "iPlanetDirectoryPro=" + }, + { + "name": "content-length", + "value": "365" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [], + "text": "redirect_uri=https://platform.dev.trivir.com/platform/appAuthHelperRedirect.html&scope=fr:idm:* openid&response_type=code&client_id=idm-admin-ui&csrf=L_5e4ngF0zHX8W5tW5_ARLsbvk0.*AAJTSQACMDIAAlNLABxMcitlS2ZXTklXbHVkVS8yNDlDWW1Wd29oZ3c9AAR0eXBlAANDVFMAAlMxAAIwMQ..*&decision=allow&code_challenge=wisxEJB74Z8BzD29oQwztZhWtTGkLVI2Hzltkmwekns&code_challenge_method=S256" + }, + "queryString": [], + "url": "https://platform.dev.trivir.com/am/oauth2/authorize" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + }, + { + "expires": "1970-01-01T00:00:00.000Z", + "httpOnly": true, + "name": "OAUTH_REQUEST_ATTRIBUTES", + "path": "/", + "sameSite": "none", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-length", + "value": "0" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "OAUTH_REQUEST_ATTRIBUTES=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/; Secure; HttpOnly; SameSite=none" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "location", + "value": "https://platform.dev.trivir.com/platform/appAuthHelperRedirect.html?code=49zgdmfoVMm5o0Zfd8YbM2FEsT4&iss=https%3A%2F%2Fplatform.dev.trivir.com%2Fam%2Foauth2&client_id=idm-admin-ui" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 673, + "httpVersion": "HTTP/1.1", + "redirectURL": "https://platform.dev.trivir.com/platform/appAuthHelperRedirect.html?code=49zgdmfoVMm5o0Zfd8YbM2FEsT4&iss=https%3A%2F%2Fplatform.dev.trivir.com%2Fam%2Foauth2&client_id=idm-admin-ui", + "status": 302, + "statusText": "Found" + }, + "startedDateTime": "2026-08-18T19:13:25.465Z", + "time": 34, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 34 + } + }, + { + "_id": "ff75519a93ccab829f8ee8cf5e92b49f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 224, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/x-www-form-urlencoded" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "content-length", + "value": "224" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 421, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [], + "text": "client_id=idm-admin-ui&redirect_uri=https://platform.dev.trivir.com/platform/appAuthHelperRedirect.html&grant_type=authorization_code&code=49zgdmfoVMm5o0Zfd8YbM2FEsT4&code_verifier=z5gxuop8SncQO10boY-CDcQXf7UzYwD5ykxoVZMbG1Y" + }, + "queryString": [], + "url": "https://platform.dev.trivir.com/am/oauth2/access_token" + }, + "response": { + "bodySize": 1246, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1246, + "text": "{\"access_token\":\"\",\"scope\":\"openid fr:idm:*\",\"id_token\":\"\",\"token_type\":\"Bearer\",\"expires_in\":239}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1246" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 405, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:13:25.506Z", + "time": 74, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 74 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/openidm_3290118515/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/openidm_3290118515/recording.har new file mode 100644 index 000000000..850a6ffa5 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/idm-authentication_1052639682/0_D_m_314327836/openidm_3290118515/recording.har @@ -0,0 +1,158 @@ +{ + "log": { + "_recordingName": "config-manager/pull/idm-authentication/0_D_m/openidm", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "653fe2843bcc7fd80db785216049a251", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 393, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://platform.dev.trivir.com/openidm/config/authentication" + }, + "response": { + "bodySize": 1140, + "content": { + "mimeType": "application/json;charset=utf-8", + "size": 1140, + "text": "{\"_id\":\"authentication\",\"rsFilter\":{\"clientId\":\"idm-resource-server\",\"clientSecret\":\"&{rs.client.secret|password}\",\"tokenIntrospectUrl\":\"http://am/am/oauth2/introspect\",\"scopes\":[\"fr:idm:*\"],\"cache\":{\"maxTimeout\":\"300 seconds\"},\"augmentSecurityContext\":{\"type\":\"text/javascript\",\"source\":\"require('auth/orgPrivileges').assignPrivilegesToUser(resource, security, properties, subjectMapping, privileges, 'privileges', 'privilegeAssignments');\"},\"subjectMapping\":[{\"queryOnResource\":\"managed/user\",\"propertyMapping\":{\"sub\":\"_id\"},\"userRoles\":\"authzRoles/*\",\"additionalUserFields\":[\"adminOfOrg\",\"ownerOfOrg\"],\"defaultRoles\":[\"internal/role/openidm-authorized\"]}],\"anonymousUserMapping\":{\"localUser\":\"internal/user/anonymous\",\"roles\":[\"internal/role/openidm-reg\"],\"executeAugmentationScript\":false},\"staticUserMapping\":[{\"subject\":\"amadmin\",\"localUser\":\"internal/user/openidm-admin\",\"roles\":[\"internal/role/openidm-authorized\",\"internal/role/openidm-admin\"],\"executeAugmentationScript\":false},{\"subject\":\"idm-provisioning\",\"localUser\":\"internal/user/idm-provisioning\",\"roles\":[\"internal/role/openidm-admin\"],\"executeAugmentationScript\":false}]}}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/openidm", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=utf-8" + }, + { + "name": "content-length", + "value": "1140" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/openidm; Secure; HttpOnly" + }, + { + "name": "vary", + "value": "Accept-Encoding, Origin" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "x-frame-options", + "value": "DENY" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 655, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:13:25.587Z", + "time": 32, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 32 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/am_1076162899/recording.har b/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/am_1076162899/recording.har new file mode 100644 index 000000000..4b091e941 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/am_1076162899/recording.har @@ -0,0 +1,631 @@ +{ + "log": { + "_recordingName": "config-manager/push/idm-authentication/0_D_m/am", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ccd7a5defd0fdeaa986a2b54642d911a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "resource=1.1" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 367, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://platform.dev.trivir.com/am/json/serverinfo/*" + }, + "response": { + "bodySize": 585, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 585, + "text": "{\"_id\":\"*\",\"_rev\":\"-2120245986\",\"domains\":[],\"protectedUserAttributes\":[\"telephoneNumber\",\"mail\"],\"cookieName\":\"iPlanetDirectoryPro\",\"secureCookie\":true,\"forgotPassword\":\"true\",\"forgotUsername\":\"true\",\"kbaEnabled\":\"false\",\"selfRegistration\":\"true\",\"lang\":\"en-US\",\"successfulUserRegistrationDestination\":\"default\",\"socialImplementations\":[],\"referralsEnabled\":\"false\",\"zeroPageLogin\":{\"enabled\":false,\"refererWhitelist\":[],\"allowedWithoutReferer\":true},\"realm\":\"/\",\"xuiUserSessionValidationEnabled\":true,\"fileBasedConfiguration\":true,\"userIdAttributes\":[],\"nodeDesignerXuiEnabled\":true}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "585" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.1" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:16:38.084Z", + "time": 29, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 29 + } + }, + { + "_id": "9f5671275c36a1c0090d0df26ce0e93f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 2, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "resource=2.0, protocol=1.0" + }, + { + "name": "x-openam-username", + "value": "" + }, + { + "name": "x-openam-password", + "value": "" + }, + { + "name": "content-length", + "value": "2" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 494, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{}" + }, + "queryString": [], + "url": "https://platform.dev.trivir.com/am/json/realms/root/authenticate" + }, + "response": { + "bodySize": 167, + "content": { + "mimeType": "application/json", + "size": 167, + "text": "{\"tokenId\":\"\",\"successUrl\":\"/am/console\",\"realm\":\"/\"}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + }, + { + "httpOnly": true, + "name": "iPlanetDirectoryPro", + "path": "/", + "sameSite": "none", + "secure": true, + "value": "" + }, + { + "httpOnly": true, + "name": "amlbcookie", + "path": "/", + "sameSite": "none", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "content-length", + "value": "167" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "iPlanetDirectoryPro=; Path=/; Secure; HttpOnly; SameSite=none" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "amlbcookie=; Path=/; Secure; HttpOnly; SameSite=none" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "private" + }, + { + "name": "content-api-version", + "value": "resource=2.1" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 693, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:16:38.120Z", + "time": 33, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 33 + } + }, + { + "_id": "6a3744385d3fd7416ea7089e610fa7e7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 128, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "resource=4.0" + }, + { + "name": "content-length", + "value": "128" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 421, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"tokenId\":\"\"}" + }, + "queryString": [ + { + "name": "_action", + "value": "getSessionInfo" + } + ], + "url": "https://platform.dev.trivir.com/am/json/realms/root/sessions/?_action=getSessionInfo" + }, + "response": { + "bodySize": 289, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 289, + "text": "{\"username\":\"amadmin\",\"universalId\":\"id=amadmin,ou=user,ou=am-config\",\"realm\":\"/\",\"latestAccessTime\":\"2026-08-18T19:16:38Z\",\"maxIdleExpirationTime\":\"2026-08-18T19:46:38Z\",\"maxSessionExpirationTime\":\"2026-08-18T21:16:37Z\",\"properties\":{\"AMCtxId\":\"b87e08c1-edd8-4888-82cc-7967a2744f53-995\"}}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "289" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "private" + }, + { + "name": "content-api-version", + "value": "resource=4.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 610, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:16:38.161Z", + "time": 11, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 11 + } + }, + { + "_id": "6125d0328ad0dcaee55f73fd8b22ca14", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "resource=1.0" + }, + { + "name": "cookie", + "value": "iPlanetDirectoryPro=" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 517, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://platform.dev.trivir.com/am/json/serverinfo/version" + }, + "response": { + "bodySize": 257, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 257, + "text": "{\"_id\":\"version\",\"_rev\":\"-466575464\",\"version\":\"8.0.1\",\"fullVersion\":\"ForgeRock Access Management 8.0.1 Build b59bc0908346197b0c33afcb9e733d0400feeea1 (2025-April-15 11:37)\",\"revision\":\"b59bc0908346197b0c33afcb9e733d0400feeea1\",\"date\":\"2025-April-15 11:37\"}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "257" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 631, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:16:38.177Z", + "time": 14, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 14 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/oauth2_393036114/recording.har b/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/oauth2_393036114/recording.har new file mode 100644 index 000000000..a1c33c5eb --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/oauth2_393036114/recording.har @@ -0,0 +1,289 @@ +{ + "log": { + "_recordingName": "config-manager/push/idm-authentication/0_D_m/oauth2", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "a684e2f67fd67a4263878c3124af167a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 365, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/x-www-form-urlencoded" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "cookie", + "value": "iPlanetDirectoryPro=" + }, + { + "name": "content-length", + "value": "365" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [], + "text": "redirect_uri=https://platform.dev.trivir.com/platform/appAuthHelperRedirect.html&scope=fr:idm:* openid&response_type=code&client_id=idm-admin-ui&csrf=Yfcg2j5_mQawNc_3gi0xQECQNXU.*AAJTSQACMDIAAlNLABxrc0podDhrSFY5SS9BRjFVWTVFemZESzFvR3c9AAR0eXBlAANDVFMAAlMxAAIwMQ..*&decision=allow&code_challenge=Dh85B7zeM2Vq7e1okZVaJvVt3lU6t4eNkkj3D3VEqRM&code_challenge_method=S256" + }, + "queryString": [], + "url": "https://platform.dev.trivir.com/am/oauth2/authorize" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + }, + { + "expires": "1970-01-01T00:00:00.000Z", + "httpOnly": true, + "name": "OAUTH_REQUEST_ATTRIBUTES", + "path": "/", + "sameSite": "none", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-length", + "value": "0" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "OAUTH_REQUEST_ATTRIBUTES=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/; Secure; HttpOnly; SameSite=none" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "location", + "value": "https://platform.dev.trivir.com/platform/appAuthHelperRedirect.html?code=VbdbJFGHbQU3rVN-isN-zNttRvs&iss=https%3A%2F%2Fplatform.dev.trivir.com%2Fam%2Foauth2&client_id=idm-admin-ui" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 673, + "httpVersion": "HTTP/1.1", + "redirectURL": "https://platform.dev.trivir.com/platform/appAuthHelperRedirect.html?code=VbdbJFGHbQU3rVN-isN-zNttRvs&iss=https%3A%2F%2Fplatform.dev.trivir.com%2Fam%2Foauth2&client_id=idm-admin-ui", + "status": 302, + "statusText": "Found" + }, + "startedDateTime": "2026-08-18T19:16:38.199Z", + "time": 29, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 29 + } + }, + { + "_id": "ff75519a93ccab829f8ee8cf5e92b49f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 224, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/x-www-form-urlencoded" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "accept-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "content-length", + "value": "224" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 421, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [], + "text": "client_id=idm-admin-ui&redirect_uri=https://platform.dev.trivir.com/platform/appAuthHelperRedirect.html&grant_type=authorization_code&code=VbdbJFGHbQU3rVN-isN-zNttRvs&code_verifier=OvNKx9g2tuQciMk5GNMmAx6SZzC6U8c4UnkjfnIxsdk" + }, + "queryString": [], + "url": "https://platform.dev.trivir.com/am/oauth2/access_token" + }, + "response": { + "bodySize": 1247, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1247, + "text": "{\"access_token\":\"\",\"scope\":\"openid fr:idm:*\",\"id_token\":\"\",\"token_type\":\"Bearer\",\"expires_in\":239}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/am", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1247" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/am; Secure; HttpOnly" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 405, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:16:38.240Z", + "time": 71, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 71 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/openidm_3290118515/recording.har b/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/openidm_3290118515/recording.har new file mode 100644 index 000000000..c0bb72e6b --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/push_2272264157/idm-authentication_1052639682/0_D_m_314327836/openidm_3290118515/recording.har @@ -0,0 +1,167 @@ +{ + "log": { + "_recordingName": "config-manager/push/idm-authentication/0_D_m/openidm", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "e5d4aec279b6a0c039410eba6fbae96a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 1140, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "" + }, + { + "name": "x-forgerock-transactionid", + "value": "" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "content-length", + "value": "1140" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 415, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"_id\":\"authentication\",\"rsFilter\":{\"anonymousUserMapping\":{\"executeAugmentationScript\":false,\"localUser\":\"internal/user/anonymous\",\"roles\":[\"internal/role/openidm-reg\"]},\"augmentSecurityContext\":{\"source\":\"require('auth/orgPrivileges').assignPrivilegesToUser(resource, security, properties, subjectMapping, privileges, 'privileges', 'privilegeAssignments');\",\"type\":\"text/javascript\"},\"cache\":{\"maxTimeout\":\"300 seconds\"},\"clientId\":\"idm-resource-server\",\"clientSecret\":\"&{rs.client.secret|password}\",\"scopes\":[\"fr:idm:*\"],\"staticUserMapping\":[{\"executeAugmentationScript\":false,\"localUser\":\"internal/user/openidm-admin\",\"roles\":[\"internal/role/openidm-authorized\",\"internal/role/openidm-admin\"],\"subject\":\"amadmin\"},{\"executeAugmentationScript\":false,\"localUser\":\"internal/user/idm-provisioning\",\"roles\":[\"internal/role/openidm-admin\"],\"subject\":\"idm-provisioning\"}],\"subjectMapping\":[{\"additionalUserFields\":[\"adminOfOrg\",\"ownerOfOrg\"],\"defaultRoles\":[\"internal/role/openidm-authorized\"],\"propertyMapping\":{\"sub\":\"_id\"},\"queryOnResource\":\"managed/user\",\"userRoles\":\"authzRoles/*\"}],\"tokenIntrospectUrl\":\"http://am/am/oauth2/introspect\"}}" + }, + "queryString": [], + "url": "https://platform.dev.trivir.com/openidm/config/authentication" + }, + "response": { + "bodySize": 1140, + "content": { + "mimeType": "application/json;charset=utf-8", + "size": 1140, + "text": "{\"_id\":\"authentication\",\"rsFilter\":{\"anonymousUserMapping\":{\"executeAugmentationScript\":false,\"localUser\":\"internal/user/anonymous\",\"roles\":[\"internal/role/openidm-reg\"]},\"augmentSecurityContext\":{\"source\":\"require('auth/orgPrivileges').assignPrivilegesToUser(resource, security, properties, subjectMapping, privileges, 'privileges', 'privilegeAssignments');\",\"type\":\"text/javascript\"},\"cache\":{\"maxTimeout\":\"300 seconds\"},\"clientId\":\"idm-resource-server\",\"clientSecret\":\"&{rs.client.secret|password}\",\"scopes\":[\"fr:idm:*\"],\"staticUserMapping\":[{\"executeAugmentationScript\":false,\"localUser\":\"internal/user/openidm-admin\",\"roles\":[\"internal/role/openidm-authorized\",\"internal/role/openidm-admin\"],\"subject\":\"amadmin\"},{\"executeAugmentationScript\":false,\"localUser\":\"internal/user/idm-provisioning\",\"roles\":[\"internal/role/openidm-admin\"],\"subject\":\"idm-provisioning\"}],\"subjectMapping\":[{\"additionalUserFields\":[\"adminOfOrg\",\"ownerOfOrg\"],\"defaultRoles\":[\"internal/role/openidm-authorized\"],\"propertyMapping\":{\"sub\":\"_id\"},\"queryOnResource\":\"managed/user\",\"userRoles\":\"authzRoles/*\"}],\"tokenIntrospectUrl\":\"http://am/am/oauth2/introspect\"}}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "route", + "path": "/openidm", + "secure": true, + "value": "" + } + ], + "headers": [ + { + "name": "date", + "value": "" + }, + { + "name": "content-type", + "value": "application/json;charset=utf-8" + }, + { + "name": "content-length", + "value": "1140" + }, + { + "name": "connection", + "value": "keep-alive" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "route=; Path=/openidm; Secure; HttpOnly" + }, + { + "name": "vary", + "value": "Origin" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "x-frame-options", + "value": "DENY" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + } + ], + "headersSize": 638, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-08-18T19:16:38.318Z", + "time": 57, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 57 + } + } + ], + "pages": [], + "version": "1.2" + } +}