@rockcarver/frodo-lib 0.17.2 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -1
- package/cjs/api/ApiTypes.js +16 -16
- package/cjs/api/ApiTypes.js.map +1 -1
- package/cjs/api/IdmConfigApi.js +28 -7
- package/cjs/api/IdmConfigApi.js.map +1 -1
- package/cjs/api/SocialIdentityProvidersApi.js +22 -0
- package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
- package/cjs/index.js +3 -1
- package/cjs/index.js.map +1 -1
- package/cjs/ops/AgentOps.test.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.test.js.map +1 -1
- package/cjs/ops/IdmOps.test.js.map +1 -1
- package/cjs/ops/IdpOps.js +182 -275
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/IdpOps.test.js.map +1 -1
- package/cjs/test/mocks/ForgeRockApiMockEngine.js +1 -108
- package/cjs/test/mocks/ForgeRockApiMockEngine.js.map +1 -1
- package/esm/api/ApiTypes.mjs +16 -16
- package/esm/api/IdmConfigApi.mjs +19 -4
- package/esm/api/SocialIdentityProvidersApi.mjs +16 -0
- package/esm/index.mjs +1 -0
- package/esm/ops/AgentOps.test.mjs +1 -1
- package/esm/ops/ConnectionProfileOps.test.mjs +94 -54
- package/esm/ops/EmailTemplateOps.test.mjs +140 -28
- package/esm/ops/IdmOps.test.mjs +159 -62
- package/esm/ops/IdpOps.mjs +139 -210
- package/esm/ops/IdpOps.test.mjs +651 -52
- package/esm/test/mocks/ForgeRockApiMockEngine.mjs +1 -98
- package/package.json +1 -1
- package/types/api/ApiTypes.d.ts +21 -21
- package/types/api/ApiTypes.d.ts.map +1 -1
- package/types/api/IdmConfigApi.d.ts +11 -5
- package/types/api/IdmConfigApi.d.ts.map +1 -1
- package/types/api/SocialIdentityProvidersApi.d.ts +7 -0
- package/types/api/SocialIdentityProvidersApi.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/ops/IdpOps.d.ts +31 -24
- package/types/ops/IdpOps.d.ts.map +1 -1
- package/types/test/mocks/ForgeRockApiMockEngine.d.ts +1 -11
- package/types/test/mocks/ForgeRockApiMockEngine.d.ts.map +1 -1
package/cjs/ops/IdpOps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdpOps.js","names":["getFileDataTemplate","meta","script","idp","listSocialProviders","providers","getSocialIdentityProviders","result","sort","a","b","_id","localeCompare","forEach","socialIdentityProvider","printMessage","err","message","getSocialProvider","providerId","then","response","foundProviders","filter","provider","length","Error","exportSocialProviderToFile","file","fileName","getTypedFilename","createProgressIndicator","idpData","updateProgressIndicator","fileData","transform","scriptData","getScript","convertBase64TextToArray","saveJsonToFile","stopProgressIndicator","exportSocialProvidersToFile","getRealmString","allIdpsData","exportSocialProvidersToFiles","importSocialProviderFromFile","fs","readFile","data","JSON","parse","validateImport","found","idpId","hasOwnProperty","call","scriptId","convertTextArrayToBase64","createOrUpdateScript","putProviderByTypeAndId","_type","catch","importProviderErr","brightCyan","importFirstSocialProviderFromFile","importSocialProvidersFromFile","Object","keys","name","importSocialProvidersFromFiles","names","readdirSync","jsonFiles","toLowerCase","endsWith","total","readFileSync","count"],"sources":["ops/IdpOps.ts"],"sourcesContent":["import fs from 'fs';\nimport {\n getSocialIdentityProviders,\n putProviderByTypeAndId,\n} from '../api/SocialIdentityProvidersApi';\nimport { getScript } from '../api/ScriptApi';\nimport { createOrUpdateScript } from './ScriptOps';\nimport {\n convertBase64TextToArray,\n convertTextArrayToBase64,\n getRealmString,\n getTypedFilename,\n saveJsonToFile,\n validateImport,\n} from './utils/ExportImportUtils';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n} from './utils/Console';\n\n// use a function vs a template variable to avoid problems in loops\nfunction getFileDataTemplate() {\n return {\n meta: {},\n script: {},\n idp: {},\n };\n}\n\n/**\n * List providers\n */\nexport async function listSocialProviders() {\n try {\n const providers = await getSocialIdentityProviders();\n providers.result.sort((a, b) => a._id.localeCompare(b._id));\n providers.result.forEach((socialIdentityProvider) => {\n printMessage(`${socialIdentityProvider._id}`, 'data');\n });\n } catch (err) {\n printMessage(`listSocialProviders ERROR: ${err.message}`, 'error');\n printMessage(err, 'error');\n }\n}\n\n/**\n * Get social identity provider by id\n * @param {String} providerId social identity provider id/name\n * @returns {Promise} a promise that resolves a social identity provider object\n */\nexport async function getSocialProvider(providerId) {\n return getSocialIdentityProviders().then((response) => {\n const foundProviders = response.result.filter(\n (provider) => provider._id === providerId\n );\n switch (foundProviders.length) {\n case 1:\n return foundProviders[0];\n case 0:\n throw new Error(`Provider '${providerId}' not found`);\n default:\n throw new Error(\n `${foundProviders.length} providers '${providerId}' found`\n );\n }\n });\n}\n\n/**\n * Export provider by id\n * @param {String} providerId provider id/name\n * @param {String} file optional export file name\n */\nexport async function exportSocialProviderToFile(providerId, file = '') {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(providerId, 'idp');\n }\n createProgressIndicator(1, `Exporting ${providerId}`);\n try {\n const idpData = await getSocialProvider(providerId);\n updateProgressIndicator(`Writing file ${fileName}`);\n const fileData = getFileDataTemplate();\n fileData.idp[idpData._id] = idpData;\n if (idpData.transform) {\n const scriptData = await getScript(idpData.transform);\n scriptData.script = convertBase64TextToArray(scriptData.script);\n fileData.script[idpData.transform] = scriptData;\n }\n saveJsonToFile(fileData, fileName);\n stopProgressIndicator(\n `Exported ${providerId['brightCyan']} to ${fileName['brightCyan']}.`\n );\n } catch (err) {\n stopProgressIndicator(`${err}`);\n printMessage(`${err}`, 'error');\n }\n}\n\n/**\n * Export all providers\n * @param {String} file optional export file name\n */\nexport async function exportSocialProvidersToFile(file) {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(`all${getRealmString()}Providers`, 'idp');\n }\n const fileData = getFileDataTemplate();\n const allIdpsData = (await getSocialIdentityProviders()).result;\n createProgressIndicator(allIdpsData.length, 'Exporting providers');\n for (const idpData of allIdpsData) {\n updateProgressIndicator(`Exporting provider ${idpData._id}`);\n fileData.idp[idpData._id] = idpData;\n if (idpData.transform) {\n // eslint-disable-next-line no-await-in-loop\n const scriptData = await getScript(idpData.transform);\n scriptData.script = convertBase64TextToArray(scriptData.script);\n fileData.script[idpData.transform] = scriptData;\n }\n }\n saveJsonToFile(fileData, fileName);\n stopProgressIndicator(\n `${allIdpsData.length} providers exported to ${fileName}.`\n );\n}\n\n/**\n * Export all providers to individual files\n */\nexport async function exportSocialProvidersToFiles() {\n const allIdpsData = await (await getSocialIdentityProviders()).result;\n // printMessage(allIdpsData, 'data');\n createProgressIndicator(allIdpsData.length, 'Exporting providers');\n for (const idpData of allIdpsData) {\n updateProgressIndicator(`Writing provider ${idpData._id}`);\n const fileName = getTypedFilename(idpData._id, 'idp');\n const fileData = getFileDataTemplate();\n fileData.idp[idpData._id] = idpData;\n if (idpData.transform) {\n // eslint-disable-next-line no-await-in-loop\n const scriptData = await getScript(idpData.transform);\n scriptData.script = convertBase64TextToArray(scriptData.script);\n fileData.script[idpData.transform] = scriptData;\n }\n saveJsonToFile(fileData, fileName);\n }\n stopProgressIndicator(`${allIdpsData.length} providers exported.`);\n}\n\n/**\n * Import provider by id/name\n * @param {String} providerId provider id/name\n * @param {String} file import file name\n */\nexport async function importSocialProviderFromFile(providerId, file) {\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const fileData = JSON.parse(data);\n if (validateImport(fileData.meta)) {\n createProgressIndicator(1, 'Importing provider...');\n let found = false;\n for (const idpId in fileData.idp) {\n if ({}.hasOwnProperty.call(fileData.idp, idpId)) {\n if (idpId === providerId) {\n found = true;\n updateProgressIndicator(`Importing ${fileData.idp[idpId]._id}`);\n const scriptId = fileData.idp[idpId].transform;\n const scriptData = fileData.script[scriptId];\n if (scriptId && scriptData) {\n scriptData.script = convertTextArrayToBase64(scriptData.script);\n // eslint-disable-next-line no-await-in-loop\n await createOrUpdateScript(\n fileData.idp[idpId].transform,\n fileData.script[fileData.idp[idpId].transform]\n );\n }\n putProviderByTypeAndId(\n fileData.idp[idpId]._type._id,\n idpId,\n fileData.idp[idpId]\n )\n .then(() => {\n stopProgressIndicator(\n `Successfully imported provider ${providerId}.`\n );\n })\n .catch((importProviderErr) => {\n stopProgressIndicator(\n `Error importing provider ${fileData.idp[idpId]._id}`\n );\n printMessage(\n `\\nError importing provider ${providerId}`,\n 'error'\n );\n printMessage(importProviderErr.response.data, 'error');\n });\n break;\n }\n }\n }\n if (!found) {\n stopProgressIndicator(\n `Provider ${providerId.brightCyan} not found in ${file.brightCyan}!`\n );\n }\n } else {\n printMessage('Import validation failed...', 'error');\n }\n });\n}\n\n/**\n * Import first provider from file\n * @param {String} file import file name\n */\nexport async function importFirstSocialProviderFromFile(file) {\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const fileData = JSON.parse(data);\n if (validateImport(fileData.meta)) {\n createProgressIndicator(1, 'Importing provider...');\n for (const idpId in fileData.idp) {\n if ({}.hasOwnProperty.call(fileData.idp, idpId)) {\n updateProgressIndicator(`Importing ${fileData.idp[idpId]._id}`);\n const scriptId = fileData.idp[idpId].transform;\n const scriptData = fileData.script[scriptId];\n if (scriptId && scriptData) {\n scriptData.script = convertTextArrayToBase64(scriptData.script);\n // eslint-disable-next-line no-await-in-loop\n await createOrUpdateScript(\n fileData.idp[idpId].transform,\n fileData.script[fileData.idp[idpId].transform]\n );\n }\n putProviderByTypeAndId(\n fileData.idp[idpId]._type._id,\n idpId,\n fileData.idp[idpId]\n ).then((result) => {\n if (result == null) {\n stopProgressIndicator(\n `Error importing provider ${fileData.idp[idpId]._id}`\n );\n printMessage(\n `Error importing provider ${fileData.idp[idpId]._id}`,\n 'error'\n );\n } else {\n stopProgressIndicator(\n `Successfully imported provider ${fileData.idp[idpId]._id}.`\n );\n }\n });\n break;\n }\n }\n } else {\n printMessage('Import validation failed...', 'error');\n }\n });\n}\n\n/**\n * Import all providers from file\n * @param {String} file import file name\n */\nexport async function importSocialProvidersFromFile(file) {\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const fileData = JSON.parse(data);\n if (validateImport(fileData.meta)) {\n createProgressIndicator(\n Object.keys(fileData.idp).length,\n 'Importing providers...'\n );\n for (const idpId in fileData.idp) {\n if ({}.hasOwnProperty.call(fileData.idp, idpId)) {\n const scriptId = fileData.idp[idpId].transform;\n const scriptData = fileData.script[scriptId];\n if (scriptId && scriptData) {\n scriptData.script = convertTextArrayToBase64(scriptData.script);\n // eslint-disable-next-line no-await-in-loop\n await createOrUpdateScript(\n fileData.idp[idpId].transform,\n fileData.script[fileData.idp[idpId].transform]\n );\n }\n // eslint-disable-next-line no-await-in-loop\n const result = await putProviderByTypeAndId(\n fileData.idp[idpId]._type._id,\n idpId,\n fileData.idp[idpId]\n );\n if (!result) {\n updateProgressIndicator(\n `Successfully imported ${fileData.idp[idpId].name}`\n );\n }\n }\n }\n stopProgressIndicator(`Providers imported.`);\n } else {\n printMessage('Import validation failed...', 'error');\n }\n });\n}\n\n/**\n * Import providers from *.idp.json files in current working directory\n */\nexport async function importSocialProvidersFromFiles() {\n const names = fs.readdirSync('.');\n const jsonFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.idp.json')\n );\n\n createProgressIndicator(jsonFiles.length, 'Importing providers...');\n let total = 0;\n for (const file of jsonFiles) {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n if (validateImport(fileData.meta)) {\n const count = Object.keys(fileData.idp).length;\n total += count;\n for (const idpId in fileData.idp) {\n if ({}.hasOwnProperty.call(fileData.idp, idpId)) {\n // eslint-disable-next-line no-await-in-loop\n const result = await putProviderByTypeAndId(\n fileData.idp[idpId]._type._id,\n idpId,\n fileData.idp[idpId]\n );\n if (result == null) {\n printMessage(\n `Error importing ${count} providers from ${file}`,\n 'error'\n );\n }\n }\n }\n updateProgressIndicator(`Imported ${count} provider(s) from ${file}`);\n } else {\n printMessage(`Validation of ${file} failed!`, 'error');\n }\n }\n stopProgressIndicator(\n `Finished importing ${total} provider(s) from ${jsonFiles.length} file(s).`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAIA;AACA;AACA;AAQA;AAKyB;AAAA;AAAA;AAEzB;AACA,SAASA,mBAAmB,GAAG;EAC7B,OAAO;IACLC,IAAI,EAAE,CAAC,CAAC;IACRC,MAAM,EAAE,CAAC,CAAC;IACVC,GAAG,EAAE,CAAC;EACR,CAAC;AACH;;AAEA;AACA;AACA;AAFA,SAGsBC,mBAAmB;EAAA;AAAA;AAazC;AACA;AACA;AACA;AACA;AAJA;EAAA,yCAbO,aAAqC;IAC1C,IAAI;MACF,IAAMC,SAAS,SAAS,IAAAC,sDAA0B,GAAE;MACpDD,SAAS,CAACE,MAAM,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,GAAG,CAACC,aAAa,CAACF,CAAC,CAACC,GAAG,CAAC,CAAC;MAC3DN,SAAS,CAACE,MAAM,CAACM,OAAO,CAAEC,sBAAsB,IAAK;QACnD,IAAAC,qBAAY,YAAID,sBAAsB,CAACH,GAAG,GAAI,MAAM,CAAC;MACvD,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOK,GAAG,EAAE;MACZ,IAAAD,qBAAY,uCAA+BC,GAAG,CAACC,OAAO,GAAI,OAAO,CAAC;MAClE,IAAAF,qBAAY,EAACC,GAAG,EAAE,OAAO,CAAC;IAC5B;EACF,CAAC;EAAA;AAAA;AAAA,SAOqBE,iBAAiB;EAAA;AAAA;AAkBvC;AACA;AACA;AACA;AACA;AAJA;EAAA,uCAlBO,WAAiCC,UAAU,EAAE;IAClD,OAAO,IAAAb,sDAA0B,GAAE,CAACc,IAAI,CAAEC,QAAQ,IAAK;MACrD,IAAMC,cAAc,GAAGD,QAAQ,CAACd,MAAM,CAACgB,MAAM,CAC1CC,Q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E,KAAK,GAAGX,MAAM,CAACC,IAAI,CAACjC,QAAQ,CAAC/B,GAAG,CAAC,CAACsB,MAAM;QAC9CkD,KAAK,IAAIE,KAAK;QACd,KAAK,IAAMxB,KAAK,IAAInB,QAAQ,CAAC/B,GAAG,EAAE;UAChC,IAAI,CAAC,CAAC,CAACmD,cAAc,CAACC,IAAI,CAACrB,QAAQ,CAAC/B,GAAG,EAAEkD,KAAK,CAAC,EAAE;YAC/C;YACA,IAAM9C,MAAM,SAAS,IAAAoD,kDAAsB,EACzCzB,QAAQ,CAAC/B,GAAG,CAACkD,KAAK,CAAC,CAACO,KAAK,CAACjD,GAAG,EAC7B0C,KAAK,EACLnB,QAAQ,CAAC/B,GAAG,CAACkD,KAAK,CAAC,CACpB;YACD,IAAI9C,MAAM,IAAI,IAAI,EAAE;cAClB,IAAAQ,qBAAY,4BACS8D,KAAK,6BAAmBjD,IAAI,GAC/C,OAAO,CACR;YACH;UACF;QACF;QACA,IAAAK,gCAAuB,qBAAa4C,KAAK,+BAAqBjD,IAAI,EAAG;MACvE,CAAC,MAAM;QACL,IAAAb,qBAAY,0BAAkBa,IAAI,eAAY,OAAO,CAAC;MACxD;IACF;IACA,IAAAY,8BAAqB,+BACGmC,KAAK,+BAAqBH,SAAS,CAAC/C,MAAM,eACjE;EACH,CAAC;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"IdpOps.js","names":["createIdpExportTemplate","meta","getMetadata","script","idp","getSocialIdentityProviders","result","_getSocialIdentityProviders","getSocialProvider","providerId","response","foundProviders","filter","provider","_id","length","Error","putProviderByTypeAndId","providerType","providerData","debugMessage","_putProviderByTypeAndId","importError","status","data","message","validAttributes","detail","push","attribute","Object","keys","includes","state","getVerbose","printMessage","deleteSocialProvider","deleteProviderByTypeAndId","_type","exportSocialProvider","idpData","exportData","transform","scriptData","getScript","convertBase64TextToArray","exportSocialProviders","allIdpsData","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","importSocialProvider","importData","idpId","scriptId","convertTextArrayToBase64","createOrUpdateScript","importFirstSocialProvider","importSocialProviders","outcome","error"],"sources":["ops/IdpOps.ts"],"sourcesContent":["import {\n deleteProviderByTypeAndId,\n getSocialIdentityProviders as _getSocialIdentityProviders,\n putProviderByTypeAndId as _putProviderByTypeAndId,\n} from '../api/SocialIdentityProvidersApi';\nimport { getScript } from '../api/ScriptApi';\nimport { createOrUpdateScript } from './ScriptOps';\nimport {\n convertBase64TextToArray,\n convertTextArrayToBase64,\n} from './utils/ExportImportUtils';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n} from './utils/Console';\nimport { ExportMetaData } from './OpsTypes';\nimport { ScriptSkeleton, SocialIdpSkeleton } from '../api/ApiTypes';\nimport { getMetadata } from './utils/ExportImportUtils';\nimport * as state from '../shared/State';\nimport { debugMessage } from './utils/Console';\n\nexport interface SocialProviderExportInterface {\n meta?: ExportMetaData;\n script: Record<string, ScriptSkeleton>;\n idp: Record<string, SocialIdpSkeleton>;\n}\n\n/**\n * Create an empty idp export template\n * @returns {SocialProviderExportInterface} an empty idp export template\n */\nfunction createIdpExportTemplate(): SocialProviderExportInterface {\n return {\n meta: getMetadata(),\n script: {},\n idp: {},\n } as SocialProviderExportInterface;\n}\n\n/**\n * Get all social identity providers\n * @returns {Promise} a promise that resolves to an object containing an array of social identity providers\n */\nexport async function getSocialIdentityProviders() {\n const { result } = await _getSocialIdentityProviders();\n return result;\n}\n\n/**\n * Get social identity provider by id\n * @param {String} providerId social identity provider id/name\n * @returns {Promise} a promise that resolves a social identity provider object\n */\nexport async function getSocialProvider(providerId) {\n const response = await getSocialIdentityProviders();\n const foundProviders = response.filter(\n (provider) => provider._id === providerId\n );\n switch (foundProviders.length) {\n case 1:\n return foundProviders[0];\n case 0:\n throw new Error(`Provider '${providerId}' not found`);\n default:\n throw new Error(\n `${foundProviders.length} providers '${providerId}' found`\n );\n }\n}\n\nexport async function putProviderByTypeAndId(\n providerType: string,\n providerId: string,\n providerData: object\n) {\n debugMessage(`IdpOps.putProviderByTypeAndId: start`);\n try {\n const response = await _putProviderByTypeAndId(\n providerType,\n providerId,\n providerData\n );\n debugMessage(`IdpOps.putProviderByTypeAndId: end`);\n return response;\n } catch (importError) {\n if (\n importError.response?.status === 400 &&\n importError.response?.data?.message === 'Invalid attribute specified.'\n ) {\n const { validAttributes } = importError.response.data.detail;\n validAttributes.push('_id', '_type');\n for (const attribute of Object.keys(providerData)) {\n if (!validAttributes.includes(attribute)) {\n if (state.getVerbose())\n printMessage(\n `\\nRemoving invalid attribute: ${attribute}`,\n 'warn',\n false\n );\n delete providerData[attribute];\n }\n }\n if (state.getVerbose()) printMessage('\\n', 'warn', false);\n const response = await _putProviderByTypeAndId(\n providerType,\n providerId,\n providerData\n );\n debugMessage(`IdpOps.putProviderByTypeAndId: end (after retry)`);\n return response;\n } else {\n // re-throw unhandleable error\n throw importError;\n }\n }\n}\n\n/**\n * Delete social identity provider by id\n * @param {String} providerId social identity provider id/name\n * @returns {Promise} a promise that resolves a social identity provider object\n */\nexport async function deleteSocialProvider(\n providerId: string\n): Promise<unknown> {\n const response = await getSocialIdentityProviders();\n const foundProviders = response.filter(\n (provider) => provider._id === providerId\n );\n switch (foundProviders.length) {\n case 1:\n return await deleteProviderByTypeAndId(\n foundProviders[0]._type._id,\n foundProviders[0]._id\n );\n case 0:\n throw new Error(`Provider '${providerId}' not found`);\n default:\n throw new Error(\n `${foundProviders.length} providers '${providerId}' found`\n );\n }\n}\n\n/**\n * Export social provider by id\n * @param {string} providerId provider id/name\n * @returns {Promise<SocialProviderExportInterface>} a promise that resolves to a SocialProviderExportInterface object\n */\nexport async function exportSocialProvider(\n providerId: string\n): Promise<SocialProviderExportInterface> {\n debugMessage(`IdpOps.exportSocialProvider: start`);\n const idpData = await getSocialProvider(providerId);\n const exportData = createIdpExportTemplate();\n exportData.idp[idpData._id] = idpData;\n if (idpData.transform) {\n const scriptData = await getScript(idpData.transform);\n scriptData.script = convertBase64TextToArray(scriptData.script);\n exportData.script[idpData.transform] = scriptData;\n }\n debugMessage(`IdpOps.exportSocialProvider: end`);\n return exportData;\n}\n\n/**\n * Export all providers\n * @returns {Promise<SocialProviderExportInterface>} a promise that resolves to a SocialProviderExportInterface object\n */\nexport async function exportSocialProviders(): Promise<SocialProviderExportInterface> {\n const exportData = createIdpExportTemplate();\n const allIdpsData = await getSocialIdentityProviders();\n createProgressIndicator(allIdpsData.length, 'Exporting providers');\n for (const idpData of allIdpsData) {\n updateProgressIndicator(`Exporting provider ${idpData._id}`);\n exportData.idp[idpData._id] = idpData;\n if (idpData.transform) {\n // eslint-disable-next-line no-await-in-loop\n const scriptData = await getScript(idpData.transform);\n scriptData.script = convertBase64TextToArray(scriptData.script);\n exportData.script[idpData.transform] = scriptData;\n }\n }\n stopProgressIndicator(`${allIdpsData.length} providers exported.`);\n return exportData;\n}\n\n/**\n * Import provider by id/name\n * @param {string} providerId provider id/name\n * @param {SocialProviderExportInterface} importData import data\n */\nexport async function importSocialProvider(\n providerId: string,\n importData: SocialProviderExportInterface\n): Promise<boolean> {\n for (const idpId of Object.keys(importData.idp)) {\n if (idpId === providerId) {\n const scriptId = importData.idp[idpId].transform;\n const scriptData = importData.script[scriptId as string];\n if (scriptId && scriptData) {\n scriptData.script = convertTextArrayToBase64(scriptData.script);\n await createOrUpdateScript(scriptId, scriptData);\n }\n await putProviderByTypeAndId(\n importData.idp[idpId]._type._id,\n idpId,\n importData.idp[idpId]\n );\n return true;\n }\n }\n return false;\n}\n\n/**\n * Import first provider\n * @param {SocialProviderExportInterface} importData import data\n */\nexport async function importFirstSocialProvider(\n importData: SocialProviderExportInterface\n): Promise<boolean> {\n for (const idpId of Object.keys(importData.idp)) {\n const scriptId = importData.idp[idpId].transform;\n const scriptData = importData.script[scriptId as string];\n if (scriptId && scriptData) {\n scriptData.script = convertTextArrayToBase64(scriptData.script);\n await createOrUpdateScript(scriptId, scriptData);\n }\n await putProviderByTypeAndId(\n importData.idp[idpId]._type._id,\n idpId,\n importData.idp[idpId]\n );\n return true;\n }\n return false;\n}\n\n/**\n * Import all providers\n * @param {SocialProviderExportInterface} importData import data\n */\nexport async function importSocialProviders(\n importData: SocialProviderExportInterface\n): Promise<boolean> {\n let outcome = true;\n for (const idpId of Object.keys(importData.idp)) {\n try {\n const scriptId = importData.idp[idpId].transform;\n const scriptData = { ...importData.script[scriptId as string] };\n if (scriptId && scriptData) {\n scriptData.script = convertTextArrayToBase64(scriptData.script);\n await createOrUpdateScript(scriptId, scriptData);\n }\n await putProviderByTypeAndId(\n importData.idp[idpId]._type._id,\n idpId,\n importData.idp[idpId]\n );\n } catch (error) {\n printMessage(error.response?.data || error, 'error');\n printMessage(`\\nError importing provider ${idpId}`, 'error');\n outcome = false;\n }\n }\n return outcome;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAKA;AACA;AACA;AAIA;AASA;AAAyC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASzC;AACA;AACA;AACA;AACA,SAASA,uBAAuB,GAAkC;EAChE,OAAO;IACLC,IAAI,EAAE,IAAAC,8BAAW,GAAE;IACnBC,MAAM,EAAE,CAAC,CAAC;IACVC,GAAG,EAAE,CAAC;EACR,CAAC;AACH;;AAEA;AACA;AACA;AACA;AAHA,SAIsBC,0BAA0B;EAAA;AAAA;AAKhD;AACA;AACA;AACA;AACA;AAJA;EAAA,iDALO,aAA4C;IACjD,IAAM;MAAEC;IAAO,CAAC,SAAS,IAAAC,sDAA2B,GAAE;IACtD,OAAOD,MAAM;EACf,CAAC;EAAA;AAAA;AAAA,SAOqBE,iBAAiB;EAAA;AAAA;AAAA;EAAA,uCAAhC,WAAiCC,UAAU,EAAE;IAClD,IAAMC,QAAQ,SAASL,0BAA0B,EAAE;IACnD,IAAMM,cAAc,GAAGD,QAAQ,CAACE,MAAM,CACnCC,QAAQ,IAAKA,QAAQ,CAACC,GAAG,KAAKL,UAAU,CAC1C;IACD,QAAQE,cAAc,CAACI,MAAM;MAC3B,KAAK,CAAC;QACJ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ost","setRealm","setCookieName","setCookieValue","setDeploymentType","global","CLOUD_DEPLOYMENT_TYPE_KEY","describe","test","expect","Idp","exportSocialProviderToFile","toBeDefined","exportSocialProvidersToFile","exportSocialProvidersToFiles","getSocialProvider","importFirstSocialProviderFromFile","importSocialProviderFromFile","importSocialProvidersFromFile","importSocialProvidersFromFiles","listSocialProviders","mockGetSocialProviders","assertions","toBeTruthy"],"sources":["ops/IdpOps.test.ts"],"sourcesContent":["import axios from 'axios';\nimport MockAdapter from 'axios-mock-adapter';\nimport { Idp, state } from '../index';\nimport * as global from '../storage/StaticStorage';\nimport { mockGetSocialProviders } from '../test/mocks/ForgeRockApiMockEngine';\n\nconst mock = new MockAdapter(axios);\n\nstate.setHost('https://openam-frodo-dev.forgeblocks.com/am');\nstate.setRealm('alpha');\nstate.setCookieName('cookieName');\nstate.setCookieValue('cookieValue');\nstate.setDeploymentType(global.CLOUD_DEPLOYMENT_TYPE_KEY);\n\ndescribe('IdpOps - exportSocialProviderToFile()', () => {\n test('exportSocialProviderToFile() 0: Method is implemented', async () => {\n expect(Idp.exportSocialProviderToFile).toBeDefined();\n });\n});\n\ndescribe('IdpOps - exportSocialProvidersToFile()', () => {\n test('exportSocialProvidersToFile() 0: Method is implemented', async () => {\n expect(Idp.exportSocialProvidersToFile).toBeDefined();\n });\n});\n\ndescribe('IdpOps - exportSocialProvidersToFiles()', () => {\n test('exportSocialProvidersToFiles() 0: Method is implemented', async () => {\n expect(Idp.exportSocialProvidersToFiles).toBeDefined();\n });\n});\n\ndescribe('IdpOps - getSocialProvider()', () => {\n test('getSocialProvider() 0: Method is implemented', async () => {\n expect(Idp.getSocialProvider).toBeDefined();\n });\n});\n\ndescribe('IdpOps - importFirstSocialProviderFromFile()', () => {\n test('importFirstSocialProviderFromFile() 0: Method is implemented', async () => {\n expect(Idp.importFirstSocialProviderFromFile).toBeDefined();\n });\n});\n\ndescribe('IdpOps - importSocialProviderFromFile()', () => {\n test('importSocialProviderFromFile() 0: Method is implemented', async () => {\n expect(Idp.importSocialProviderFromFile).toBeDefined();\n });\n});\n\ndescribe('IdpOps - importSocialProvidersFromFile()', () => {\n test('importSocialProvidersFromFile() 0: Method is implemented', async () => {\n expect(Idp.importSocialProvidersFromFile).toBeDefined();\n });\n});\n\ndescribe('IdpOps - importSocialProvidersFromFiles()', () => {\n test('importSocialProvidersFromFiles() 0: Method is implemented', async () => {\n expect(Idp.importSocialProvidersFromFiles).toBeDefined();\n });\n});\n\ndescribe('IdpOps - listSocialProviders()', () => {\n test('listSocialProviders() 0: Method is implemented', async () => {\n expect(Idp.listSocialProviders).toBeDefined();\n });\n\n test('listSocialProviders() 1: List social identity providers', async () => {\n mockGetSocialProviders(mock);\n expect.assertions(2);\n await Idp.listSocialProviders();\n expect(true).toBeTruthy();\n });\n});\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AAA8E;AAAA;AAAA;AAAA;AAAA;AAE9E,IAAMA,IAAI,GAAG,IAAIC,yBAAW,CAACC,cAAK,CAAC;AAEnCC,YAAK,CAACC,OAAO,CAAC,6CAA6C,CAAC;AAC5DD,YAAK,CAACE,QAAQ,CAAC,OAAO,CAAC;AACvBF,YAAK,CAACG,aAAa,CAAC,YAAY,CAAC;AACjCH,YAAK,CAACI,cAAc,CAAC,aAAa,CAAC;AACnCJ,YAAK,CAACK,iBAAiB,CAACC,MAAM,CAACC,yBAAyB,CAAC;AAEzDC,QAAQ,CAAC,uCAAuC,EAAE,MAAM;EACtDC,IAAI,CAAC,uDAAuD,iCAAE,aAAY;IACxEC,MAAM,CAACC,UAAG,CAACC,0BAA0B,CAAC,CAACC,WAAW,EAAE;EACtD,CAAC,EAAC;AACJ,CAAC,CAAC;AAEFL,QAAQ,CAAC,wCAAwC,EAAE,MAAM;EACvDC,IAAI,CAAC,wDAAwD,iCAAE,aAAY;IACzEC,MAAM,CAACC,UAAG,CAACG,2BAA2B,CAAC,CAACD,WAAW,EAAE;EACvD,CAAC,EAAC;AACJ,CAAC,CAAC;AAEFL,Q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,WAAW,EAAE;EAC/C,CAAC,EAAC;EAEFJ,IAAI,CAAC,yDAAyD,iCAAE,aAAY;IAC1E,IAAAa,8CAAsB,EAACzB,IAAI,CAAC;IAC5Ba,MAAM,CAACa,UAAU,CAAC,CAAC,CAAC;IACpB,MAAMZ,UAAG,CAACU,mBAAmB,EAAE;IAC/BX,MAAM,CAAC,IAAI,CAAC,CAACc,UAAU,EAAE;EAC3B,CAAC,EAAC;AACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"IdpOps.test.js","names":["autoSetupPolly","stageIdp","idp","create","Idp","getSocialProvider","id","deleteSocialProvider","error","putProviderByTypeAndId","type","data","describe","idp1","clientId","pkceMethod","jwtEncryptionMethod","authorizationEndpoint","jwtEncryptionAlgorithm","clientSecret","issuerComparisonCheckType","scopeDelimiter","scopes","enabled","authenticationIdKey","uiConfig","buttonClass","buttonCustomStyle","buttonCustomStyleHover","buttonDisplayName","buttonImage","iconBackground","iconClass","iconFontColor","privateKeyJwtExpTime","revocationCheckOptions","transform","userInfoEndpoint","jwtSigningAlgorithm","redirectURI","clientAuthenticationMethod","responseMode","useCustomTrustStore","tokenEndpoint","_id","_type","name","collection","idp2","wellKnownEndpoint","encryptJwtRequestParameter","issuer","userInfoResponseType","acrValues","encryptedIdTokens","jwtRequestParameterOption","enableNativeNonce","idp3","idp4","idp5","idp6","idp7","idp8","import1","meta","origin","originAmVersion","exportedBy","exportDate","exportTool","exportToolVersion","script","description","default","language","context","createdBy","creationDate","lastModifiedBy","lastModifiedDate","FrodoTestIdp4","jwksUriEndpoint","importData1","FrodoTestIdp5","FrodoTestIdp6","redirectAfterFormPostURI","requestNativeAppForUserInfo","importData2","FrodoTestIdp7","FrodoTestIdp8","beforeAll","process","env","FRODO_POLLY_MODE","afterAll","test","expect","exportSocialProvider","toBeDefined","response","toMatchSnapshot","any","Object","exportSocialProviders","getSocialIdentityProviders","importSocialProvider","assertions","outcome","toBeTruthy","importFirstSocialProvider","importSocialProviders"],"sources":["ops/IdpOps.test.ts"],"sourcesContent":["/**\n * To record and update snapshots, you must perform 3 steps in order:\n *\n * 1. Record API responses & update ESM snapshots\n *\n * To record and update ESM snapshots, you must call the test:record\n * script and override all the connection state variables required\n * to connect to the env to record from:\n *\n * FRODO_DEBUG=1 FRODO_HOST=frodo-dev npm run test:record IdpOps\n *\n * The above command assumes that you have a connection profile for\n * 'frodo-dev' on your development machine.\n *\n * 2. Update CJS snapshots\n *\n * After recording, the ESM snapshots will already be updated as that happens\n * in one go, but you musty manually update the CJS snapshots by running:\n *\n * FRODO_DEBUG=1 npm run test:update IdpOps\n *\n * 3. Test your changes\n *\n * If 1 and 2 didn't produce any errors, you are ready to run the tests in\n * replay mode and make sure they all succeed as well:\n *\n * npm run test:only IdpOps\n *\n * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output\n * in case things don't function as expected\n */\nimport { Idp } from '../index';\nimport { autoSetupPolly } from '../utils/AutoSetupPolly';\n\nautoSetupPolly();\n\nasync function stageIdp(\n idp: { id: string; type: string; data: object },\n create = true\n) {\n // delete if exists, then create\n try {\n await Idp.getSocialProvider(idp.id);\n await Idp.deleteSocialProvider(idp.id);\n } catch (error) {\n // ignore\n } finally {\n if (create) {\n await Idp.putProviderByTypeAndId(idp.type, idp.id, idp.data);\n }\n }\n}\n\ndescribe('IdpOps', () => {\n const idp1 = {\n id: 'FrodoTestIdp1',\n type: 'oauth2Config',\n data: {\n clientId: '123741718342521',\n pkceMethod: 'S256',\n jwtEncryptionMethod: 'NONE',\n authorizationEndpoint: 'https://www.facebook.com/dialog/oauth',\n jwtEncryptionAlgorithm: 'NONE',\n clientSecret: '5up3r53cr3t!',\n issuerComparisonCheckType: 'EXACT',\n scopeDelimiter: ' ',\n scopes: ['email'],\n enabled: true,\n authenticationIdKey: 'id',\n uiConfig: {\n buttonClass: 'fa-facebook-official',\n buttonCustomStyle:\n 'background-color: #3b5998; border-color: #3b5998; color: white;',\n buttonCustomStyleHover:\n 'background-color: #334b7d; border-color: #334b7d; color: white;',\n buttonDisplayName: 'Facebook',\n buttonImage: '',\n iconBackground: '#3b5998',\n iconClass: 'fa-facebook',\n iconFontColor: 'white',\n },\n privateKeyJwtExpTime: 3600,\n revocationCheckOptions: [],\n transform: 'bae1d54a-e97d-4997-aa5d-c027f21af82c',\n userInfoEndpoint:\n 'https://graph.facebook.com/me?fields=id,name,picture,email,first_name,last_name,locale',\n jwtSigningAlgorithm: 'NONE',\n redirectURI: 'https://idc.scheuber.io/am/XUI/?realm=%2Falpha',\n clientAuthenticationMethod: 'CLIENT_SECRET_POST',\n responseMode: 'DEFAULT',\n useCustomTrustStore: false,\n tokenEndpoint: 'https://graph.facebook.com/v2.7/oauth/access_token',\n _id: 'FrodoTestIdp1',\n _type: {\n _id: 'oauth2Config',\n name: 'Client configuration for providers that implement the OAuth2 specification.',\n collection: true,\n },\n },\n };\n const idp2 = {\n id: 'FrodoTestIdp2',\n type: 'googleConfig',\n data: {\n clientId:\n '297318173925-mho17cgnm550s2gre7h27feb6sbs2msd.apps.googleusercontent.com',\n pkceMethod: 'S256',\n wellKnownEndpoint:\n 'https://accounts.google.com/.well-known/openid-configuration',\n jwtEncryptionMethod: 'NONE',\n authorizationEndpoint: 'https://accounts.google.com/o/oauth2/v2/auth',\n jwtEncryptionAlgorithm: 'NONE',\n clientSecret: null,\n issuerComparisonCheckType: 'EXACT',\n encryptJwtRequestParameter: false,\n scopeDelimiter: ' ',\n scopes: ['openid', 'profile', 'email'],\n issuer: 'https://accounts.google.com',\n userInfoResponseType: 'JSON',\n acrValues: [],\n encryptedIdTokens: false,\n enabled: true,\n jwtRequestParameterOption: 'NONE',\n authenticationIdKey: 'sub',\n uiConfig: {\n buttonClass: '',\n buttonCustomStyle:\n 'background-color: #fff; color: #757575; border-color: #ddd;',\n buttonCustomStyleHover:\n 'color: #6d6d6d; background-color: #eee; border-color: #ccc;',\n buttonDisplayName: 'Google',\n buttonImage: 'images/g-logo.png',\n iconBackground: '#4184f3',\n iconClass: 'fa-google',\n iconFontColor: 'white',\n },\n privateKeyJwtExpTime: 600,\n revocationCheckOptions: [],\n enableNativeNonce: true,\n transform: '58d29080-4563-480b-89bb-1e7719776a21',\n userInfoEndpoint: 'https://www.googleapis.com/oauth2/v3/userinfo',\n jwtSigningAlgorithm: 'NONE',\n redirectURI: 'https://idc.scheuber.io/login',\n clientAuthenticationMethod: 'CLIENT_SECRET_POST',\n responseMode: 'DEFAULT',\n useCustomTrustStore: false,\n tokenEndpoint: 'https://www.googleapis.com/oauth2/v4/token',\n _id: 'FrodoTestIdp2',\n _type: {\n _id: 'googleConfig',\n name: 'Client configuration for Google.',\n collection: true,\n },\n },\n };\n const idp3 = {\n id: 'FrodoTestIdp3',\n type: 'oidcConfig',\n data: {\n clientId: '0oa13r2cp29Rynmyw697',\n pkceMethod: 'S256',\n wellKnownEndpoint:\n 'https://trial-1234567.okta.com/.well-known/openid-configuration',\n jwtEncryptionMethod: 'NONE',\n authorizationEndpoint:\n 'https://trial-1234567.okta.com/oauth2/v1/authorize',\n jwtEncryptionAlgorithm: 'NONE',\n clientSecret: null,\n issuerComparisonCheckType: 'EXACT',\n encryptJwtRequestParameter: false,\n scopeDelimiter: ' ',\n scopes: ['openid', 'profile', 'email'],\n issuer: 'https://trial-1234567.okta.com',\n userInfoResponseType: 'JSON',\n acrValues: [],\n encryptedIdTokens: false,\n enabled: true,\n jwtRequestParameterOption: 'NONE',\n authenticationIdKey: 'id',\n uiConfig: {\n buttonDisplayName: 'Okta',\n },\n privateKeyJwtExpTime: 600,\n revocationCheckOptions: [],\n enableNativeNonce: true,\n transform: '6325cf19-a49b-471e-8d26-7e4df76df0e2',\n userInfoEndpoint: 'https://trial-1234567.okta.com/oauth2/v1/userinfo',\n jwtSigningAlgorithm: 'NONE',\n redirectURI: 'https://idc.scheuber.io/login',\n clientAuthenticationMethod: 'CLIENT_SECRET_POST',\n responseMode: 'DEFAULT',\n useCustomTrustStore: false,\n tokenEndpoint: 'https://trial-1234567.okta.com/oauth2/v1/token',\n _id: 'FrodoTestIdp3',\n _type: {\n _id: 'oidcConfig',\n name: 'Client configuration for providers that implement the OpenID Connect specification.',\n collection: true,\n },\n },\n };\n const idp4 = {\n id: 'FrodoTestIdp4',\n type: 'none',\n data: {},\n };\n const idp5 = {\n id: 'FrodoTestIdp5',\n type: 'none',\n data: {},\n };\n const idp6 = {\n id: 'FrodoTestIdp6',\n type: 'none',\n data: {},\n };\n const idp7 = {\n id: 'FrodoTestIdp7',\n type: 'none',\n data: {},\n };\n const idp8 = {\n id: 'FrodoTestIdp8',\n type: 'none',\n data: {},\n };\n const import1: { id: string; data: Idp.SocialProviderExportInterface } = {\n id: 'FrodoTestIdp4',\n data: {\n meta: {\n origin: 'https://openam-volker-dev.forgeblocks.com/am',\n originAmVersion: '7.3.0',\n exportedBy: 'volker.scheuber@forgerock.com',\n exportDate: '2022-12-28T19:02:10.599Z',\n exportTool: 'frodo',\n exportToolVersion: 'v0.17.2-0 [v18.7.0]',\n },\n script: {\n 'dbe0bf9a-72aa-49d5-8483-9db147985a47': {\n _id: 'dbe0bf9a-72aa-49d5-8483-9db147985a47',\n name: 'ADFS Profile Normalization (JS)',\n description: 'Normalizes raw profile data from ADFS',\n script: [\n '/*',\n ' * Copyright 2022 ForgeRock AS. All Rights Reserved',\n ' *',\n ' * Use of this code requires a commercial software license with ForgeRock AS',\n ' * or with one of its affiliates. All use shall be exclusively subject',\n ' * to such license between the licensee and ForgeRock AS.',\n ' */',\n '',\n '/*',\n ' * This script returns the social identity profile information for the authenticating user',\n ' * in a standard form expected by the Social Provider Handler Node.',\n ' *',\n ' * Defined variables:',\n ' * rawProfile - The social identity provider profile information for the authenticating user.',\n ' * JsonValue (1).',\n ' * logger - The debug logger instance:',\n ' * https://backstage.forgerock.com/docs/am/7/scripting-guide/scripting-api-global-logger.html#scripting-api-global-logger.',\n ' * realm - String (primitive).',\n ' * The name of the realm the user is authenticating to.',\n ' * requestHeaders - TreeMap (2).',\n ' * The object that provides methods for accessing headers in the login request:',\n ' * https://backstage.forgerock.com/docs/am/7/authentication-guide/scripting-api-node.html#scripting-api-node-requestHeaders.',\n ' * requestParameters - TreeMap (2).',\n ' * The object that contains the authentication request parameters.',\n ' * selectedIdp - String (primitive).',\n ' * The social identity provider name. For example: google.',\n ' * sharedState - LinkedHashMap (3).',\n ' * The object that holds the state of the authentication tree and allows data exchange between the stateless nodes:',\n ' * https://backstage.forgerock.com/docs/am/7/auth-nodes/core-action.html#accessing-tree-state.',\n ' * transientState - LinkedHashMap (3).',\n ' * The object for storing sensitive information that must not leave the server unencrypted,',\n ' * and that may not need to persist between authentication requests during the authentication session:',\n ' * https://backstage.forgerock.com/docs/am/7/auth-nodes/core-action.html#accessing-tree-state.',\n ' *',\n ' * Return - a JsonValue (1).',\n ' * The result of the last statement in the script is returned to the server.',\n ' * Currently, the Immediately Invoked Function Expression (also known as Self-Executing Anonymous Function)',\n ' * is the last (and only) statement in this script, and its return value will become the script result.',\n ' * Do not use \"return variable\" statement outside of a function definition.',\n ' *',\n \" * This script's last statement should result in a JsonValue (1) with the following keys:\",\n ' * {',\n ' * {\"displayName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"email\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"familyName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"givenName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"id\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"locale\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"photoUrl\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"username\": \"corresponding-social-identity-provider-value\"}',\n ' * }',\n ' *',\n ' * The consumer of this data defines which keys are required and which are optional.',\n ' * For example, the script associated with the Social Provider Handler Node and,',\n ' * ultimately, the managed object created/updated with this data',\n ' * will expect certain keys to be populated.',\n ' * In some common default configurations, the following keys are required to be not empty:',\n ' * username, givenName, familyName, email.',\n ' *',\n ' * From RFC4517: A value of the Directory String syntax is a string of one or more',\n ' * arbitrary characters from the Universal Character Set (UCS).',\n ' * A zero-length character string is not permitted.',\n ' *',\n ' * (1) JsonValue - https://backstage.forgerock.com/docs/am/7/apidocs/org/forgerock/json/JsonValue.html.',\n ' * (2) TreeMap - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/TreeMap.html.',\n ' * (3) LinkedHashMap - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/LinkedHashMap.html.',\n ' */',\n '',\n '(function () {',\n ' var frJava = JavaImporter(',\n ' org.forgerock.json.JsonValue',\n ' );',\n '',\n ' var normalizedProfileData = frJava.JsonValue.json(frJava.JsonValue.object());',\n ' ',\n \" //logger.message('Seguin rawProfile: '+rawProfile);\",\n '',\n \" normalizedProfileData.put('id', rawProfile.get('sub').asString());\",\n \" normalizedProfileData.put('displayName', rawProfile.get('givenName').asString() + ' ' + rawProfile.get('sn').asString());\",\n \" normalizedProfileData.put('email', rawProfile.get('mail').asString());\",\n \" normalizedProfileData.put('givenName', rawProfile.get('givenName').asString());\",\n \" normalizedProfileData.put('familyName', rawProfile.get('sn').asString());\",\n \" normalizedProfileData.put('username', rawProfile.get('upn').asString());\",\n \" normalizedProfileData.put('roles', rawProfile.get('roles').asString());\",\n ' ',\n \" //logger.message('Seguin normalizedProfileData: '+normalizedProfileData);\",\n '',\n ' return normalizedProfileData;',\n '}());',\n ],\n default: false,\n language: 'JAVASCRIPT',\n context: 'SOCIAL_IDP_PROFILE_TRANSFORMATION',\n createdBy: 'null',\n creationDate: 0,\n lastModifiedBy: 'null',\n lastModifiedDate: 0,\n },\n },\n idp: {\n FrodoTestIdp4: {\n clientId: 'aa9a179e-cdba-4db8-8477-3d1069d5ec04',\n pkceMethod: 'S256',\n wellKnownEndpoint:\n 'https://adfs.mytestrun.com/adfs/.well-known/openid-configuration',\n jwtEncryptionMethod: 'NONE',\n authorizationEndpoint:\n 'https://adfs.mytestrun.com/adfs/oauth2/authorize',\n jwtEncryptionAlgorithm: 'NONE',\n clientSecret: null,\n issuerComparisonCheckType: 'EXACT',\n encryptJwtRequestParameter: false,\n scopeDelimiter: ' ',\n scopes: ['openid', 'profile', 'email'],\n issuer: 'https://adfs.mytestrun.com/adfs',\n userInfoResponseType: 'JSON',\n acrValues: [],\n jwksUriEndpoint: 'https://adfs.mytestrun.com/adfs/discovery/keys',\n encryptedIdTokens: false,\n enabled: true,\n jwtRequestParameterOption: 'NONE',\n authenticationIdKey: 'sub',\n uiConfig: {\n buttonClass: '',\n buttonCustomStyle:\n 'background-color: #fff; border-color: #8b8b8b; color: #8b8b8b;',\n buttonCustomStyleHover:\n 'background-color: #fff; border-color: #8b8b8b; color: #8b8b8b;',\n buttonDisplayName: 'Microsoft ADFS',\n buttonImage: '/login/images/microsoft-logo.png',\n iconBackground: '#0078d7',\n iconClass: 'fa-windows',\n iconFontColor: 'white',\n },\n privateKeyJwtExpTime: 600,\n revocationCheckOptions: [],\n enableNativeNonce: true,\n transform: 'dbe0bf9a-72aa-49d5-8483-9db147985a47',\n jwtSigningAlgorithm: 'RS256',\n redirectURI: 'https://idc.scheuber.io/login',\n clientAuthenticationMethod: 'CLIENT_SECRET_POST',\n responseMode: 'DEFAULT',\n useCustomTrustStore: false,\n tokenEndpoint: 'https://adfs.mytestrun.com/adfs/oauth2/token',\n _id: 'FrodoTestIdp4',\n _type: {\n _id: 'oidcConfig',\n name: 'Client configuration for providers that implement the OpenID Connect specification.',\n collection: true,\n },\n },\n },\n },\n };\n const importData1: Idp.SocialProviderExportInterface = {\n meta: {\n origin: 'https://openam-volker-dev.forgeblocks.com/am',\n originAmVersion: '7.3.0',\n exportedBy: 'volker.scheuber@forgerock.com',\n exportDate: '2022-12-28T19:02:10.599Z',\n exportTool: 'frodo',\n exportToolVersion: 'v0.17.2-0 [v18.7.0]',\n },\n script: {\n 'dbe0bf9a-72aa-49d5-8483-9db147985a47': {\n _id: 'dbe0bf9a-72aa-49d5-8483-9db147985a47',\n name: 'ADFS Profile Normalization (JS)',\n description: 'Normalizes raw profile data from ADFS',\n script: [\n '/*',\n ' * Copyright 2022 ForgeRock AS. All Rights Reserved',\n ' *',\n ' * Use of this code requires a commercial software license with ForgeRock AS',\n ' * or with one of its affiliates. All use shall be exclusively subject',\n ' * to such license between the licensee and ForgeRock AS.',\n ' */',\n '',\n '/*',\n ' * This script returns the social identity profile information for the authenticating user',\n ' * in a standard form expected by the Social Provider Handler Node.',\n ' *',\n ' * Defined variables:',\n ' * rawProfile - The social identity provider profile information for the authenticating user.',\n ' * JsonValue (1).',\n ' * logger - The debug logger instance:',\n ' * https://backstage.forgerock.com/docs/am/7/scripting-guide/scripting-api-global-logger.html#scripting-api-global-logger.',\n ' * realm - String (primitive).',\n ' * The name of the realm the user is authenticating to.',\n ' * requestHeaders - TreeMap (2).',\n ' * The object that provides methods for accessing headers in the login request:',\n ' * https://backstage.forgerock.com/docs/am/7/authentication-guide/scripting-api-node.html#scripting-api-node-requestHeaders.',\n ' * requestParameters - TreeMap (2).',\n ' * The object that contains the authentication request parameters.',\n ' * selectedIdp - String (primitive).',\n ' * The social identity provider name. For example: google.',\n ' * sharedState - LinkedHashMap (3).',\n ' * The object that holds the state of the authentication tree and allows data exchange between the stateless nodes:',\n ' * https://backstage.forgerock.com/docs/am/7/auth-nodes/core-action.html#accessing-tree-state.',\n ' * transientState - LinkedHashMap (3).',\n ' * The object for storing sensitive information that must not leave the server unencrypted,',\n ' * and that may not need to persist between authentication requests during the authentication session:',\n ' * https://backstage.forgerock.com/docs/am/7/auth-nodes/core-action.html#accessing-tree-state.',\n ' *',\n ' * Return - a JsonValue (1).',\n ' * The result of the last statement in the script is returned to the server.',\n ' * Currently, the Immediately Invoked Function Expression (also known as Self-Executing Anonymous Function)',\n ' * is the last (and only) statement in this script, and its return value will become the script result.',\n ' * Do not use \"return variable\" statement outside of a function definition.',\n ' *',\n \" * This script's last statement should result in a JsonValue (1) with the following keys:\",\n ' * {',\n ' * {\"displayName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"email\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"familyName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"givenName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"id\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"locale\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"photoUrl\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"username\": \"corresponding-social-identity-provider-value\"}',\n ' * }',\n ' *',\n ' * The consumer of this data defines which keys are required and which are optional.',\n ' * For example, the script associated with the Social Provider Handler Node and,',\n ' * ultimately, the managed object created/updated with this data',\n ' * will expect certain keys to be populated.',\n ' * In some common default configurations, the following keys are required to be not empty:',\n ' * username, givenName, familyName, email.',\n ' *',\n ' * From RFC4517: A value of the Directory String syntax is a string of one or more',\n ' * arbitrary characters from the Universal Character Set (UCS).',\n ' * A zero-length character string is not permitted.',\n ' *',\n ' * (1) JsonValue - https://backstage.forgerock.com/docs/am/7/apidocs/org/forgerock/json/JsonValue.html.',\n ' * (2) TreeMap - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/TreeMap.html.',\n ' * (3) LinkedHashMap - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/LinkedHashMap.html.',\n ' */',\n '',\n '(function () {',\n ' var frJava = JavaImporter(',\n ' org.forgerock.json.JsonValue',\n ' );',\n '',\n ' var normalizedProfileData = frJava.JsonValue.json(frJava.JsonValue.object());',\n ' ',\n \" //logger.message('Seguin rawProfile: '+rawProfile);\",\n '',\n \" normalizedProfileData.put('id', rawProfile.get('sub').asString());\",\n \" normalizedProfileData.put('displayName', rawProfile.get('givenName').asString() + ' ' + rawProfile.get('sn').asString());\",\n \" normalizedProfileData.put('email', rawProfile.get('mail').asString());\",\n \" normalizedProfileData.put('givenName', rawProfile.get('givenName').asString());\",\n \" normalizedProfileData.put('familyName', rawProfile.get('sn').asString());\",\n \" normalizedProfileData.put('username', rawProfile.get('upn').asString());\",\n \" normalizedProfileData.put('roles', rawProfile.get('roles').asString());\",\n ' ',\n \" //logger.message('Seguin normalizedProfileData: '+normalizedProfileData);\",\n '',\n ' return normalizedProfileData;',\n '}());',\n ],\n default: false,\n language: 'JAVASCRIPT',\n context: 'SOCIAL_IDP_PROFILE_TRANSFORMATION',\n createdBy: 'null',\n creationDate: 0,\n lastModifiedBy: 'null',\n lastModifiedDate: 0,\n },\n '484e6246-dbc6-4288-97e6-54e55431402e': {\n _id: '484e6246-dbc6-4288-97e6-54e55431402e',\n name: 'Apple Profile Normalization',\n description: 'Normalizes raw profile data from Apple',\n script: [\n '/*',\n ' * Copyright 2021-2022 ForgeRock AS. All Rights Reserved',\n ' *',\n ' * Use of this code requires a commercial software license with ForgeRock AS.',\n ' * or with one of its affiliates. All use shall be exclusively subject',\n ' * to such license between the licensee and ForgeRock AS.',\n ' *',\n ' * In some common default configurations, the following keys are required to be not empty:',\n ' * username, givenName, familyName, email.',\n ' *',\n ' * From RFC4517: A value of the Directory String syntax is a string of one or more',\n ' * arbitrary characters from the Universal Character Set (UCS).',\n ' * A zero-length character string is not permitted.',\n ' */',\n '',\n 'import static org.forgerock.json.JsonValue.field',\n 'import static org.forgerock.json.JsonValue.json',\n 'import static org.forgerock.json.JsonValue.object',\n '',\n 'String email = \"change@me.com\"',\n 'String subjectId = rawProfile.sub',\n 'String firstName = \" \"',\n 'String lastName = \" \"',\n 'String username = subjectId',\n 'String name',\n '',\n 'if (rawProfile.isDefined(\"email\") && rawProfile.email.isNotNull()){ // User can elect to not share their email',\n ' email = rawProfile.email.asString()',\n ' username = email',\n '}',\n 'if (rawProfile.isDefined(\"name\") && rawProfile.name.isNotNull()) {',\n ' if (rawProfile.name.isDefined(\"firstName\") && rawProfile.name.firstName.isNotNull()) {',\n ' firstName = rawProfile.name.firstName.asString()',\n ' }',\n ' if (rawProfile.name.isDefined(\"lastName\") && rawProfile.name.lastName.isNotNull()) {',\n ' lastName = rawProfile.name.lastName.asString()',\n ' }',\n '}',\n '',\n 'name = (firstName?.trim() ? firstName : \"\") + (lastName?.trim() ? ((firstName?.trim() ? \" \" : \"\") + lastName) : \"\")',\n 'name = (!name?.trim()) ? \" \" : name',\n '',\n 'return json(object(',\n ' field(\"id\", subjectId),',\n ' field(\"displayName\", name),',\n ' field(\"email\", email),',\n ' field(\"givenName\", firstName),',\n ' field(\"familyName\", lastName),',\n ' field(\"username\", username)))',\n ],\n default: true,\n language: 'GROOVY',\n context: 'SOCIAL_IDP_PROFILE_TRANSFORMATION',\n createdBy: 'null',\n creationDate: 0,\n lastModifiedBy: 'null',\n lastModifiedDate: 0,\n },\n },\n idp: {\n FrodoTestIdp5: {\n clientId: 'aa9a179e-cdba-4db8-8477-3d1069d5ec04',\n pkceMethod: 'S256',\n wellKnownEndpoint:\n 'https://adfs.mytestrun.com/adfs/.well-known/openid-configuration',\n jwtEncryptionMethod: 'NONE',\n authorizationEndpoint:\n 'https://adfs.mytestrun.com/adfs/oauth2/authorize',\n jwtEncryptionAlgorithm: 'NONE',\n clientSecret: null,\n issuerComparisonCheckType: 'EXACT',\n encryptJwtRequestParameter: false,\n scopeDelimiter: ' ',\n scopes: ['openid', 'profile', 'email'],\n issuer: 'https://adfs.mytestrun.com/adfs',\n userInfoResponseType: 'JSON',\n acrValues: [],\n jwksUriEndpoint: 'https://adfs.mytestrun.com/adfs/discovery/keys',\n encryptedIdTokens: false,\n enabled: true,\n jwtRequestParameterOption: 'NONE',\n authenticationIdKey: 'sub',\n uiConfig: {\n buttonClass: '',\n buttonCustomStyle:\n 'background-color: #fff; border-color: #8b8b8b; color: #8b8b8b;',\n buttonCustomStyleHover:\n 'background-color: #fff; border-color: #8b8b8b; color: #8b8b8b;',\n buttonDisplayName: 'Microsoft ADFS',\n buttonImage: '/login/images/microsoft-logo.png',\n iconBackground: '#0078d7',\n iconClass: 'fa-windows',\n iconFontColor: 'white',\n },\n privateKeyJwtExpTime: 600,\n revocationCheckOptions: [],\n enableNativeNonce: true,\n transform: 'dbe0bf9a-72aa-49d5-8483-9db147985a47',\n jwtSigningAlgorithm: 'RS256',\n redirectURI: 'https://idc.scheuber.io/login',\n clientAuthenticationMethod: 'CLIENT_SECRET_POST',\n responseMode: 'DEFAULT',\n useCustomTrustStore: false,\n tokenEndpoint: 'https://adfs.mytestrun.com/adfs/oauth2/token',\n _id: 'FrodoTestIdp5',\n _type: {\n _id: 'oidcConfig',\n name: 'Client configuration for providers that implement the OpenID Connect specification.',\n collection: true,\n },\n },\n FrodoTestIdp6: {\n clientId: 'io.scheuber.idc.signinWithApple.service',\n pkceMethod: 'S256',\n wellKnownEndpoint:\n 'https://appleid.apple.com/.well-known/openid-configuration',\n jwtEncryptionMethod: 'NONE',\n authorizationEndpoint: 'https://appleid.apple.com/auth/authorize',\n jwtEncryptionAlgorithm: 'NONE',\n clientSecret: null,\n issuerComparisonCheckType: 'EXACT',\n encryptJwtRequestParameter: false,\n scopeDelimiter: ' ',\n scopes: ['name', 'email'],\n issuer: 'https://appleid.apple.com',\n redirectAfterFormPostURI: 'https://idc.scheuber.io/login',\n userInfoResponseType: 'JSON',\n acrValues: [],\n jwksUriEndpoint: 'https://appleid.apple.com/auth/keys',\n encryptedIdTokens: false,\n requestNativeAppForUserInfo: false,\n enabled: true,\n jwtRequestParameterOption: 'NONE',\n authenticationIdKey: 'sub',\n uiConfig: {\n buttonClass: '',\n buttonCustomStyle:\n 'background-color: #000000; color: #ffffff; border-color: #000000;',\n buttonCustomStyleHover:\n 'background-color: #000000; color: #ffffff; border-color: #000000;',\n buttonDisplayName: 'Apple',\n buttonImage: '/login/images/apple-logo.png',\n iconBackground: '#000000',\n iconClass: 'fa-apple',\n iconFontColor: 'white',\n },\n privateKeyJwtExpTime: 600,\n revocationCheckOptions: [],\n enableNativeNonce: true,\n transform: '484e6246-dbc6-4288-97e6-54e55431402e',\n jwtSigningAlgorithm: 'NONE',\n redirectURI:\n 'https://idc.scheuber.io/am/oauth2/client/form_post/apple_web',\n clientAuthenticationMethod: 'CLIENT_SECRET_POST',\n responseMode: 'FORM_POST',\n useCustomTrustStore: false,\n tokenEndpoint: 'https://appleid.apple.com/auth/token',\n _id: 'FrodoTestIdp6',\n _type: {\n _id: 'appleConfig',\n name: 'Client configuration for Apple.',\n collection: true,\n },\n },\n },\n };\n const importData2: Idp.SocialProviderExportInterface = {\n meta: {\n origin: 'https://openam-volker-dev.forgeblocks.com/am',\n originAmVersion: '7.3.0',\n exportedBy: 'volker.scheuber@forgerock.com',\n exportDate: '2022-12-28T19:02:10.599Z',\n exportTool: 'frodo',\n exportToolVersion: 'v0.17.2-0 [v18.7.0]',\n },\n script: {\n 'dbe0bf9a-72aa-49d5-8483-9db147985a47': {\n _id: 'dbe0bf9a-72aa-49d5-8483-9db147985a47',\n name: 'ADFS Profile Normalization (JS)',\n description: 'Normalizes raw profile data from ADFS',\n script: [\n '/*',\n ' * Copyright 2022 ForgeRock AS. All Rights Reserved',\n ' *',\n ' * Use of this code requires a commercial software license with ForgeRock AS',\n ' * or with one of its affiliates. All use shall be exclusively subject',\n ' * to such license between the licensee and ForgeRock AS.',\n ' */',\n '',\n '/*',\n ' * This script returns the social identity profile information for the authenticating user',\n ' * in a standard form expected by the Social Provider Handler Node.',\n ' *',\n ' * Defined variables:',\n ' * rawProfile - The social identity provider profile information for the authenticating user.',\n ' * JsonValue (1).',\n ' * logger - The debug logger instance:',\n ' * https://backstage.forgerock.com/docs/am/7/scripting-guide/scripting-api-global-logger.html#scripting-api-global-logger.',\n ' * realm - String (primitive).',\n ' * The name of the realm the user is authenticating to.',\n ' * requestHeaders - TreeMap (2).',\n ' * The object that provides methods for accessing headers in the login request:',\n ' * https://backstage.forgerock.com/docs/am/7/authentication-guide/scripting-api-node.html#scripting-api-node-requestHeaders.',\n ' * requestParameters - TreeMap (2).',\n ' * The object that contains the authentication request parameters.',\n ' * selectedIdp - String (primitive).',\n ' * The social identity provider name. For example: google.',\n ' * sharedState - LinkedHashMap (3).',\n ' * The object that holds the state of the authentication tree and allows data exchange between the stateless nodes:',\n ' * https://backstage.forgerock.com/docs/am/7/auth-nodes/core-action.html#accessing-tree-state.',\n ' * transientState - LinkedHashMap (3).',\n ' * The object for storing sensitive information that must not leave the server unencrypted,',\n ' * and that may not need to persist between authentication requests during the authentication session:',\n ' * https://backstage.forgerock.com/docs/am/7/auth-nodes/core-action.html#accessing-tree-state.',\n ' *',\n ' * Return - a JsonValue (1).',\n ' * The result of the last statement in the script is returned to the server.',\n ' * Currently, the Immediately Invoked Function Expression (also known as Self-Executing Anonymous Function)',\n ' * is the last (and only) statement in this script, and its return value will become the script result.',\n ' * Do not use \"return variable\" statement outside of a function definition.',\n ' *',\n \" * This script's last statement should result in a JsonValue (1) with the following keys:\",\n ' * {',\n ' * {\"displayName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"email\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"familyName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"givenName\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"id\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"locale\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"photoUrl\": \"corresponding-social-identity-provider-value\"},',\n ' * {\"username\": \"corresponding-social-identity-provider-value\"}',\n ' * }',\n ' *',\n ' * The consumer of this data defines which keys are required and which are optional.',\n ' * For example, the script associated with the Social Provider Handler Node and,',\n ' * ultimately, the managed object created/updated with this data',\n ' * will expect certain keys to be populated.',\n ' * In some common default configurations, the following keys are required to be not empty:',\n ' * username, givenName, familyName, email.',\n ' *',\n ' * From RFC4517: A value of the Directory String syntax is a string of one or more',\n ' * arbitrary characters from the Universal Character Set (UCS).',\n ' * A zero-length character string is not permitted.',\n ' *',\n ' * (1) JsonValue - https://backstage.forgerock.com/docs/am/7/apidocs/org/forgerock/json/JsonValue.html.',\n ' * (2) TreeMap - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/TreeMap.html.',\n ' * (3) LinkedHashMap - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/LinkedHashMap.html.',\n ' */',\n '',\n '(function () {',\n ' var frJava = JavaImporter(',\n ' org.forgerock.json.JsonValue',\n ' );',\n '',\n ' var normalizedProfileData = frJava.JsonValue.json(frJava.JsonValue.object());',\n ' ',\n \" //logger.message('Seguin rawProfile: '+rawProfile);\",\n '',\n \" normalizedProfileData.put('id', rawProfile.get('sub').asString());\",\n \" normalizedProfileData.put('displayName', rawProfile.get('givenName').asString() + ' ' + rawProfile.get('sn').asString());\",\n \" normalizedProfileData.put('email', rawProfile.get('mail').asString());\",\n \" normalizedProfileData.put('givenName', rawProfile.get('givenName').asString());\",\n \" normalizedProfileData.put('familyName', rawProfile.get('sn').asString());\",\n \" normalizedProfileData.put('username', rawProfile.get('upn').asString());\",\n \" normalizedProfileData.put('roles', rawProfile.get('roles').asString());\",\n ' ',\n \" //logger.message('Seguin normalizedProfileData: '+normalizedProfileData);\",\n '',\n ' return normalizedProfileData;',\n '}());',\n ],\n default: false,\n language: 'JAVASCRIPT',\n context: 'SOCIAL_IDP_PROFILE_TRANSFORMATION',\n createdBy: 'null',\n creationDate: 0,\n lastModifiedBy: 'null',\n lastModifiedDate: 0,\n },\n '484e6246-dbc6-4288-97e6-54e55431402e': {\n _id: '484e6246-dbc6-4288-97e6-54e55431402e',\n name: 'Apple Profile Normalization',\n description: 'Normalizes raw profile data from Apple',\n script: [\n '/*',\n ' * Copyright 2021-2022 ForgeRock AS. All Rights Reserved',\n ' *',\n ' * Use of this code requires a commercial software license with ForgeRock AS.',\n ' * or with one of its affiliates. All use shall be exclusively subject',\n ' * to such license between the licensee and ForgeRock AS.',\n ' *',\n ' * In some common default configurations, the following keys are required to be not empty:',\n ' * username, givenName, familyName, email.',\n ' *',\n ' * From RFC4517: A value of the Directory String syntax is a string of one or more',\n ' * arbitrary characters from the Universal Character Set (UCS).',\n ' * A zero-length character string is not permitted.',\n ' */',\n '',\n 'import static org.forgerock.json.JsonValue.field',\n 'import static org.forgerock.json.JsonValue.json',\n 'import static org.forgerock.json.JsonValue.object',\n '',\n 'String email = \"change@me.com\"',\n 'String subjectId = rawProfile.sub',\n 'String firstName = \" \"',\n 'String lastName = \" \"',\n 'String username = subjectId',\n 'String name',\n '',\n 'if (rawProfile.isDefined(\"email\") && rawProfile.email.isNotNull()){ // User can elect to not share their email',\n ' email = rawProfile.email.asString()',\n ' username = email',\n '}',\n 'if (rawProfile.isDefined(\"name\") && rawProfile.name.isNotNull()) {',\n ' if (rawProfile.name.isDefined(\"firstName\") && rawProfile.name.firstName.isNotNull()) {',\n ' firstName = rawProfile.name.firstName.asString()',\n ' }',\n ' if (rawProfile.name.isDefined(\"lastName\") && rawProfile.name.lastName.isNotNull()) {',\n ' lastName = rawProfile.name.lastName.asString()',\n ' }',\n '}',\n '',\n 'name = (firstName?.trim() ? firstName : \"\") + (lastName?.trim() ? ((firstName?.trim() ? \" \" : \"\") + lastName) : \"\")',\n 'name = (!name?.trim()) ? \" \" : name',\n '',\n 'return json(object(',\n ' field(\"id\", subjectId),',\n ' field(\"displayName\", name),',\n ' field(\"email\", email),',\n ' field(\"givenName\", firstName),',\n ' field(\"familyName\", lastName),',\n ' field(\"username\", username)))',\n ],\n default: true,\n language: 'GROOVY',\n context: 'SOCIAL_IDP_PROFILE_TRANSFORMATION',\n createdBy: 'null',\n creationDate: 0,\n lastModifiedBy: 'null',\n lastModifiedDate: 0,\n },\n },\n idp: {\n FrodoTestIdp7: {\n clientId: 'aa9a179e-cdba-4db8-8477-3d1069d5ec04',\n pkceMethod: 'S256',\n wellKnownEndpoint:\n 'https://adfs.mytestrun.com/adfs/.well-known/openid-configuration',\n jwtEncryptionMethod: 'NONE',\n authorizationEndpoint:\n 'https://adfs.mytestrun.com/adfs/oauth2/authorize',\n jwtEncryptionAlgorithm: 'NONE',\n clientSecret: null,\n issuerComparisonCheckType: 'EXACT',\n encryptJwtRequestParameter: false,\n scopeDelimiter: ' ',\n scopes: ['openid', 'profile', 'email'],\n issuer: 'https://adfs.mytestrun.com/adfs',\n userInfoResponseType: 'JSON',\n acrValues: [],\n jwksUriEndpoint: 'https://adfs.mytestrun.com/adfs/discovery/keys',\n encryptedIdTokens: false,\n enabled: true,\n jwtRequestParameterOption: 'NONE',\n authenticationIdKey: 'sub',\n uiConfig: {\n buttonClass: '',\n buttonCustomStyle:\n 'background-color: #fff; border-color: #8b8b8b; color: #8b8b8b;',\n buttonCustomStyleHover:\n 'background-color: #fff; border-color: #8b8b8b; color: #8b8b8b;',\n buttonDisplayName: 'Microsoft ADFS',\n buttonImage: '/login/images/microsoft-logo.png',\n iconBackground: '#0078d7',\n iconClass: 'fa-windows',\n iconFontColor: 'white',\n },\n privateKeyJwtExpTime: 600,\n revocationCheckOptions: [],\n enableNativeNonce: true,\n transform: 'dbe0bf9a-72aa-49d5-8483-9db147985a47',\n jwtSigningAlgorithm: 'RS256',\n redirectURI: 'https://idc.scheuber.io/login',\n clientAuthenticationMethod: 'CLIENT_SECRET_POST',\n responseMode: 'DEFAULT',\n useCustomTrustStore: false,\n tokenEndpoint: 'https://adfs.mytestrun.com/adfs/oauth2/token',\n _id: 'FrodoTestIdp7',\n _type: {\n _id: 'oidcConfig',\n name: 'Client configuration for providers that implement the OpenID Connect specification.',\n collection: true,\n },\n },\n FrodoTestIdp8: {\n clientId: 'io.scheuber.idc.signinWithApple.service',\n pkceMethod: 'S256',\n wellKnownEndpoint:\n 'https://appleid.apple.com/.well-known/openid-configuration',\n jwtEncryptionMethod: 'NONE',\n authorizationEndpoint: 'https://appleid.apple.com/auth/authorize',\n jwtEncryptionAlgorithm: 'NONE',\n clientSecret: null,\n issuerComparisonCheckType: 'EXACT',\n encryptJwtRequestParameter: false,\n scopeDelimiter: ' ',\n scopes: ['name', 'email'],\n issuer: 'https://appleid.apple.com',\n redirectAfterFormPostURI: 'https://idc.scheuber.io/login',\n userInfoResponseType: 'JSON',\n acrValues: [],\n jwksUriEndpoint: 'https://appleid.apple.com/auth/keys',\n encryptedIdTokens: false,\n requestNativeAppForUserInfo: false,\n enabled: true,\n jwtRequestParameterOption: 'NONE',\n authenticationIdKey: 'sub',\n uiConfig: {\n buttonClass: '',\n buttonCustomStyle:\n 'background-color: #000000; color: #ffffff; border-color: #000000;',\n buttonCustomStyleHover:\n 'background-color: #000000; color: #ffffff; border-color: #000000;',\n buttonDisplayName: 'Apple',\n buttonImage: '/login/images/apple-logo.png',\n iconBackground: '#000000',\n iconClass: 'fa-apple',\n iconFontColor: 'white',\n },\n privateKeyJwtExpTime: 600,\n revocationCheckOptions: [],\n enableNativeNonce: true,\n transform: '484e6246-dbc6-4288-97e6-54e55431402e',\n jwtSigningAlgorithm: 'NONE',\n redirectURI:\n 'https://idc.scheuber.io/am/oauth2/client/form_post/apple_web',\n clientAuthenticationMethod: 'CLIENT_SECRET_POST',\n responseMode: 'FORM_POST',\n useCustomTrustStore: false,\n tokenEndpoint: 'https://appleid.apple.com/auth/token',\n _id: 'FrodoTestIdp8',\n _type: {\n _id: 'appleConfig',\n name: 'Client configuration for Apple.',\n collection: true,\n },\n },\n },\n };\n // in recording mode, setup test data before recording\n beforeAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageIdp(idp1);\n await stageIdp(idp2);\n await stageIdp(idp3, false);\n }\n });\n // in recording mode, remove test data after recording\n afterAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageIdp(idp1, false);\n await stageIdp(idp2, false);\n await stageIdp(idp3, false);\n await stageIdp(idp4, false);\n await stageIdp(idp5, false);\n await stageIdp(idp6, false);\n await stageIdp(idp7, false);\n await stageIdp(idp8, false);\n }\n });\n\n describe('exportSocialProvider()', () => {\n test('0: Method is implemented', async () => {\n expect(Idp.exportSocialProvider).toBeDefined();\n });\n\n test(`1: Export social provider ${idp1.id}`, async () => {\n const response = await Idp.exportSocialProvider(idp1.id);\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n });\n\n describe('exportSocialProviders()', () => {\n test('0: Method is implemented', async () => {\n expect(Idp.exportSocialProviders).toBeDefined();\n });\n\n test('1: Export all social providers', async () => {\n const response = await Idp.exportSocialProviders();\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n });\n\n describe('getSocialProviders()', () => {\n test('0: Method is implemented', async () => {\n expect(Idp.getSocialIdentityProviders).toBeDefined();\n });\n\n test(`1: Get social providers`, async () => {\n const response = await Idp.getSocialIdentityProviders();\n expect(response).toMatchSnapshot();\n });\n });\n\n describe('getSocialProvider()', () => {\n test('0: Method is implemented', async () => {\n expect(Idp.getSocialProvider).toBeDefined();\n });\n\n test(`1: Get social provider ${idp1.id}`, async () => {\n const response = await Idp.getSocialProvider(idp1.id);\n expect(response).toMatchSnapshot();\n });\n });\n\n describe('putProviderByTypeAndId()', () => {\n test('0: Method is implemented', async () => {\n expect(Idp.putProviderByTypeAndId).toBeDefined();\n });\n\n test(`1: Put social provider ${idp3.id}`, async () => {\n const response = await Idp.putProviderByTypeAndId(\n idp3.type,\n idp3.id,\n idp3.data\n );\n expect(response).toMatchSnapshot();\n });\n });\n\n describe('importSocialProvider()', () => {\n test('0: Method is implemented', async () => {\n expect(Idp.importSocialProvider).toBeDefined();\n });\n\n test(`1: Import social provider ${import1.id}`, async () => {\n expect.assertions(1);\n const outcome = await Idp.importSocialProvider(import1.id, import1.data);\n expect(outcome).toBeTruthy();\n });\n });\n\n describe('importFirstSocialProvider()', () => {\n test('0: Method is implemented', async () => {\n expect(Idp.importFirstSocialProvider).toBeDefined();\n });\n\n test(`1: Import first social provider`, async () => {\n expect.assertions(1);\n const outcome = await Idp.importFirstSocialProvider(importData1);\n expect(outcome).toBeTruthy();\n });\n });\n\n describe('importSocialProviders()', () => {\n test('0: Method is implemented', async () => {\n expect(Idp.importSocialProviders).toBeDefined();\n });\n });\n\n test(`1: Import all social providers`, async () => {\n expect.assertions(1);\n const outcome = await Idp.importSocialProviders(importData2);\n expect(outcome).toBeTruthy();\n });\n});\n"],"mappings":";;AA+BA;AACA;AAAyD;AAAA;AAEzD,IAAAA,8BAAc,GAAE;AAAC,SAEFC,QAAQ;EAAA;AAAA;AAAA;EAAA,8BAAvB,WACEC,GAA+C,EAE/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MAAM;IACxCmF,IAAI,CAAC,0BAA0B,iCAAE,aAAY;MAC3CC,MAAM,CAAC5F,UAAG,CAAC0G,qBAAqB,CAAC,CAACZ,WAAW,EAAE;IACjD,CAAC,EAAC;EACJ,CAAC,CAAC;EAEFH,IAAI,kEAAmC,aAAY;IACjDC,MAAM,CAACU,UAAU,CAAC,CAAC,CAAC;IACpB,IAAMC,OAAO,SAASvG,UAAG,CAAC0G,qBAAqB,CAACvB,WAAW,CAAC;IAC5DS,MAAM,CAACW,OAAO,CAAC,CAACC,UAAU,EAAE;EAC9B,CAAC,EAAC;AACJ,CAAC,CAAC"}
|
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getAgent = getAgent;
|
|
7
|
-
exports.getAgentTypes = getAgentTypes;
|
|
8
|
-
exports.getAgents = getAgents;
|
|
9
7
|
exports.getCirclesOfTrust = getCirclesOfTrust;
|
|
10
8
|
exports.getSaml2ProviderImportData = getSaml2ProviderImportData;
|
|
11
9
|
exports.getSaml2Providers = getSaml2Providers;
|
|
@@ -24,14 +22,7 @@ exports.mockAuthorize = mockAuthorize;
|
|
|
24
22
|
exports.mockCreateCircleOfTrust = mockCreateCircleOfTrust;
|
|
25
23
|
exports.mockCreateManagedObject = mockCreateManagedObject;
|
|
26
24
|
exports.mockCreateSaml2Provider = mockCreateSaml2Provider;
|
|
27
|
-
exports.mockDeleteAgentByTypeAndId = mockDeleteAgentByTypeAndId;
|
|
28
|
-
exports.mockFindAgentById = mockFindAgentById;
|
|
29
|
-
exports.mockFindAgentByTypeAndId = mockFindAgentByTypeAndId;
|
|
30
25
|
exports.mockFindSaml2Providers = mockFindSaml2Providers;
|
|
31
|
-
exports.mockGetAgentByTypeAndId = mockGetAgentByTypeAndId;
|
|
32
|
-
exports.mockGetAgentTypes = mockGetAgentTypes;
|
|
33
|
-
exports.mockGetAgents = mockGetAgents;
|
|
34
|
-
exports.mockGetAgentsByType = mockGetAgentsByType;
|
|
35
26
|
exports.mockGetAllConfigEntities = mockGetAllConfigEntities;
|
|
36
27
|
exports.mockGetCirclesOfTrust = mockGetCirclesOfTrust;
|
|
37
28
|
exports.mockGetConfigEntitiesByType = mockGetConfigEntitiesByType;
|
|
@@ -46,7 +37,6 @@ exports.mockGetServerVersionInfo = mockGetServerVersionInfo;
|
|
|
46
37
|
exports.mockGetSocialProviders = mockGetSocialProviders;
|
|
47
38
|
exports.mockGetTree = mockGetTree;
|
|
48
39
|
exports.mockGetTrees = mockGetTrees;
|
|
49
|
-
exports.mockPutAgentByTypeAndId = mockPutAgentByTypeAndId;
|
|
50
40
|
exports.mockPutConfigEntity = mockPutConfigEntity;
|
|
51
41
|
exports.mockPutNode = mockPutNode;
|
|
52
42
|
exports.mockPutScript = mockPutScript;
|
|
@@ -429,110 +419,13 @@ function mockPutSocialProviderByTypeAndId(mock, callback) {
|
|
|
429
419
|
}
|
|
430
420
|
|
|
431
421
|
/**
|
|
432
|
-
* Agent
|
|
422
|
+
* Agent test utils
|
|
433
423
|
*/
|
|
434
424
|
|
|
435
|
-
function getAgentTypes() {
|
|
436
|
-
var objects = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, './AgentApi/getAgentTypes/agentTypes.json'), 'utf8'));
|
|
437
|
-
return objects;
|
|
438
|
-
}
|
|
439
|
-
function getAgents() {
|
|
440
|
-
var objects = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, './AgentApi/getAgents/agents.json'), 'utf8'));
|
|
441
|
-
return objects;
|
|
442
|
-
}
|
|
443
425
|
function getAgent(agentType, agentId) {
|
|
444
426
|
var objects = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, "./AgentApi/getAgentByTypeAndId/".concat(agentType, "/").concat(agentId, ".json")), 'utf8'));
|
|
445
427
|
return objects;
|
|
446
428
|
}
|
|
447
|
-
function mockGetAgentTypes(mock) {
|
|
448
|
-
mock.onGet(/\/json\/realms\/root\/realms\/alpha\/realm-config\/agents\?_action=getAllTypes/).reply(function () {
|
|
449
|
-
var mockStatus = 200;
|
|
450
|
-
var mockResponse = getAgentTypes();
|
|
451
|
-
if (typeof expect !== 'undefined') expect(mockResponse).toBeTruthy();
|
|
452
|
-
return [mockStatus, mockResponse];
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
function mockGetAgentsByType(mock) {
|
|
456
|
-
mock.onGet(/\/json\/realms\/root\/realms\/alpha\/realm-config\/agents\/.+?\?_queryFilter=true/).reply(function (config) {
|
|
457
|
-
var parsed = (0, _ApiUtils.parseUrl)(config.url);
|
|
458
|
-
var elements = parsed.pathname ? parsed.pathname.split('/') : [];
|
|
459
|
-
var agentType = elements[(elements === null || elements === void 0 ? void 0 : elements.length) - 1];
|
|
460
|
-
var mockStatus = 200;
|
|
461
|
-
var mockResponse = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, "./AgentApi/getAgentsByType/".concat(agentType, "s.json")), 'utf8'));
|
|
462
|
-
if (typeof expect !== 'undefined') expect(mockResponse).toBeTruthy();
|
|
463
|
-
return [mockStatus, mockResponse];
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
function mockGetAgents(mock) {
|
|
467
|
-
mock.onPost(/\/json\/realms\/root\/realms\/alpha\/realm-config\/agents\?_action=nextdescendents/).reply(function () {
|
|
468
|
-
var mockStatus = 200;
|
|
469
|
-
var mockResponse = getAgents();
|
|
470
|
-
if (typeof expect !== 'undefined') expect(mockResponse).toBeTruthy();
|
|
471
|
-
return [mockStatus, mockResponse];
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
function mockFindAgentById(mock) {
|
|
475
|
-
mock.onGet(/\/json\/realms\/root\/realms\/alpha\/realm-config\/agents\?_queryFilter=_id\+eq\+'.+?'/).reply(function (config) {
|
|
476
|
-
var parsed = (0, _ApiUtils.parseUrl)(config.url);
|
|
477
|
-
var filter = parsed.searchParam['_queryFilter'];
|
|
478
|
-
var agentId = filter.match(/_id\+eq\+'(.+?)'/)[1];
|
|
479
|
-
var mockStatus = 200;
|
|
480
|
-
var mockResponse = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, "./AgentApi/findAgentById/".concat(agentId, ".json")), 'utf8'));
|
|
481
|
-
if (typeof expect !== 'undefined') expect(mockResponse.result[0]._id).toBe(agentId);
|
|
482
|
-
return [mockStatus, mockResponse];
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
function mockFindAgentByTypeAndId(mock) {
|
|
486
|
-
mock.onGet(/\/json\/realms\/root\/realms\/alpha\/realm-config\/agents\/.+?\?_queryFilter=_id\+eq\+'.+?'/).reply(function (config) {
|
|
487
|
-
var parsed = (0, _ApiUtils.parseUrl)(config.url);
|
|
488
|
-
var elements = parsed.pathname ? parsed.pathname.split('/') : [];
|
|
489
|
-
var agentType = elements[(elements === null || elements === void 0 ? void 0 : elements.length) - 1];
|
|
490
|
-
var filter = parsed.searchParam['_queryFilter'];
|
|
491
|
-
var agentId = filter.match(/_id\+eq\+'(.+?)'/)[1];
|
|
492
|
-
var mockStatus = 200;
|
|
493
|
-
var mockResponse = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, "./AgentApi/findAgentByTypeAndId/not_found.json"), 'utf8'));
|
|
494
|
-
try {
|
|
495
|
-
mockResponse = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, "./AgentApi/findAgentByTypeAndId/".concat(agentType, "/").concat(agentId, ".json")), 'utf8'));
|
|
496
|
-
if (typeof expect !== 'undefined') expect(mockResponse.result[0]._id).toBe(agentId);
|
|
497
|
-
} catch (error) {
|
|
498
|
-
// ignore errors
|
|
499
|
-
}
|
|
500
|
-
return [mockStatus, mockResponse];
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
function mockGetAgentByTypeAndId(mock) {
|
|
504
|
-
mock.onGet(/\/json\/realms\/root\/realms\/alpha\/realm-config\/agents\/[a-zA-Z0-9/_-]+$/).reply(function (config) {
|
|
505
|
-
var elements = config.url ? config.url.split('/') : [];
|
|
506
|
-
var agentType = elements[(elements === null || elements === void 0 ? void 0 : elements.length) - 2];
|
|
507
|
-
var agentId = elements[(elements === null || elements === void 0 ? void 0 : elements.length) - 1];
|
|
508
|
-
var mockStatus = 200;
|
|
509
|
-
var mockResponse = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, "./AgentApi/getAgentByTypeAndId/".concat(agentType, "/").concat(agentId, ".json")), 'utf8'));
|
|
510
|
-
if (typeof expect !== 'undefined') expect(mockResponse._id).toBe(agentId);
|
|
511
|
-
return [mockStatus, mockResponse];
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
function mockPutAgentByTypeAndId(mock, callback) {
|
|
515
|
-
mock.onPut(/\/json\/realms\/root\/realms\/alpha\/realm-config\/agents\/.+/).reply(function (config) {
|
|
516
|
-
var elements = config.url ? config.url.split('/') : [];
|
|
517
|
-
var agentType = elements[(elements === null || elements === void 0 ? void 0 : elements.length) - 2];
|
|
518
|
-
var agentId = elements[(elements === null || elements === void 0 ? void 0 : elements.length) - 1];
|
|
519
|
-
var mockStatus = 200;
|
|
520
|
-
var mockAgentObj = JSON.parse(config.data);
|
|
521
|
-
callback(agentType, agentId, mockAgentObj);
|
|
522
|
-
return [mockStatus, mockAgentObj];
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
function mockDeleteAgentByTypeAndId(mock, callback) {
|
|
526
|
-
mock.onDelete(/\/json\/realms\/root\/realms\/alpha\/realm-config\/agents\/.+/).reply(function (config) {
|
|
527
|
-
var elements = config.url ? config.url.split('/') : [];
|
|
528
|
-
var agentType = elements[(elements === null || elements === void 0 ? void 0 : elements.length) - 2];
|
|
529
|
-
var agentId = elements[(elements === null || elements === void 0 ? void 0 : elements.length) - 1];
|
|
530
|
-
var mockStatus = 200;
|
|
531
|
-
var mockAgentObj = getAgent(agentType, agentId);
|
|
532
|
-
callback(agentType, agentId, mockAgentObj);
|
|
533
|
-
return [mockStatus, mockAgentObj];
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
429
|
|
|
537
430
|
/****
|
|
538
431
|
**
|