@rockcarver/frodo-cli 0.22.0 → 0.22.2
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 +21 -1
- package/esm/ops/IdmOps.js +8 -5
- package/esm/ops/IdmOps.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.22.2] - 2023-02-15
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- \#203: Frodo no longer outputs cosmetic error messages when exporting IDM config.
|
|
15
|
+
|
|
16
|
+
## [0.22.1] - 2023-02-14
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Update to frodo-lib 0.18.5
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- \#196 and #197: Frodo now properly detects Encore environments as ForgeOps environments and obtains an access token for IDM APIs.
|
|
25
|
+
|
|
10
26
|
## [0.22.0] - 2023-02-13
|
|
11
27
|
|
|
12
28
|
### Added
|
|
@@ -1025,7 +1041,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1025
1041
|
- Fixed problem with adding connection profiles
|
|
1026
1042
|
- Miscellaneous bug fixes
|
|
1027
1043
|
|
|
1028
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.22.
|
|
1044
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.22.2...HEAD
|
|
1045
|
+
|
|
1046
|
+
[0.22.2]: https://github.com/rockcarver/frodo-cli/compare/v0.22.1...v0.22.2
|
|
1047
|
+
|
|
1048
|
+
[0.22.1]: https://github.com/rockcarver/frodo-cli/compare/v0.22.0...v0.22.1
|
|
1029
1049
|
|
|
1030
1050
|
[0.22.0]: https://github.com/rockcarver/frodo-cli/compare/v0.21.1...v0.22.0
|
|
1031
1051
|
|
package/esm/ops/IdmOps.js
CHANGED
|
@@ -90,12 +90,15 @@ export async function exportAllRawConfigEntities(directory) {
|
|
|
90
90
|
const entityPromises = [];
|
|
91
91
|
for (const configEntity of configurations) {
|
|
92
92
|
entityPromises.push(getConfigEntity(configEntity._id).catch(getConfigEntityError => {
|
|
93
|
-
var _getConfigEntityError, _getConfigEntityError2, _getConfigEntityError3, _getConfigEntityError4, _getConfigEntityError5, _getConfigEntityError6;
|
|
94
|
-
if (!(((_getConfigEntityError = getConfigEntityError.response) === null || _getConfigEntityError === void 0 ? void 0 : _getConfigEntityError.status) === 403 && ((_getConfigEntityError2 = getConfigEntityError.response) === null || _getConfigEntityError2 === void 0 ? void 0 : (_getConfigEntityError3 = _getConfigEntityError2.data) === null || _getConfigEntityError3 === void 0 ? void 0 : _getConfigEntityError3.message) === 'This operation is not available in ForgeRock Identity Cloud.') &&
|
|
93
|
+
var _getConfigEntityError, _getConfigEntityError2, _getConfigEntityError3, _getConfigEntityError4, _getConfigEntityError5, _getConfigEntityError6, _getConfigEntityError7, _getConfigEntityError8, _getConfigEntityError9;
|
|
94
|
+
if (!(((_getConfigEntityError = getConfigEntityError.response) === null || _getConfigEntityError === void 0 ? void 0 : _getConfigEntityError.status) === 403 && ((_getConfigEntityError2 = getConfigEntityError.response) === null || _getConfigEntityError2 === void 0 ? void 0 : (_getConfigEntityError3 = _getConfigEntityError2.data) === null || _getConfigEntityError3 === void 0 ? void 0 : _getConfigEntityError3.message) === 'This operation is not available in ForgeRock Identity Cloud.') && !(
|
|
95
|
+
// list of config entities, which do not exist by default or ever.
|
|
96
|
+
|
|
97
|
+
['script', 'notificationFactory', 'apiVersion', 'metrics', 'repo.init', 'endpoint/validateQueryFilter', 'endpoint/oauthproxy', 'external.rest', 'scheduler', 'org.apache.felix.fileinstall/openidm', 'cluster', 'endpoint/mappingDetails', 'fieldPolicy/teammember'].includes(configEntity._id) && ((_getConfigEntityError4 = getConfigEntityError.response) === null || _getConfigEntityError4 === void 0 ? void 0 : _getConfigEntityError4.status) === 404 && ((_getConfigEntityError5 = getConfigEntityError.response) === null || _getConfigEntityError5 === void 0 ? void 0 : (_getConfigEntityError6 = _getConfigEntityError5.data) === null || _getConfigEntityError6 === void 0 ? void 0 : _getConfigEntityError6.reason) === 'Not Found') &&
|
|
95
98
|
// https://bugster.forgerock.org/jira/browse/OPENIDM-18270
|
|
96
|
-
!(((
|
|
97
|
-
var
|
|
98
|
-
printMessage((
|
|
99
|
+
!(((_getConfigEntityError7 = getConfigEntityError.response) === null || _getConfigEntityError7 === void 0 ? void 0 : _getConfigEntityError7.status) === 404 && ((_getConfigEntityError8 = getConfigEntityError.response) === null || _getConfigEntityError8 === void 0 ? void 0 : (_getConfigEntityError9 = _getConfigEntityError8.data) === null || _getConfigEntityError9 === void 0 ? void 0 : _getConfigEntityError9.message) === 'No configuration exists for id org.apache.felix.fileinstall/openidm')) {
|
|
100
|
+
var _getConfigEntityError10;
|
|
101
|
+
printMessage((_getConfigEntityError10 = getConfigEntityError.response) === null || _getConfigEntityError10 === void 0 ? void 0 : _getConfigEntityError10.data, 'error');
|
|
99
102
|
printMessage(`Error getting config entity ${configEntity._id}: ${getConfigEntityError}`, 'error');
|
|
100
103
|
}
|
|
101
104
|
}));
|
package/esm/ops/IdmOps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdmOps.js","names":["fs","fse","path","propertiesReader","replaceall","Idm","Utils","ValidationUtils","createProgressIndicator","printMessage","stopProgressIndicator","getTypedFilename","readFiles","unSubstituteEnvParams","validateScriptHooks","getAllConfigEntities","getConfigEntity","putConfigEntity","queryAllManagedObjectsByType","testConnectorServers","warnAboutOfflineConnectorServers","all","offline","filter","status","ok","map","name","length","join","error","message","listAllConfigEntities","configurations","configEntity","_id","getAllConfigEntitiesError","exportConfigEntity","id","file","fileName","writeFile","JSON","stringify","err","exportAllRawConfigEntities","directory","existsSync","mkdirSync","undefined","entityPromises","push","catch","getConfigEntityError","response","data","results","Promise","item","outputFile","exportAllConfigEntities","entitiesFile","envFile","entriesToExport","readFile","entriesData","parse","idm","envParams","includes","configEntityString","each","key","value","importConfigEntity","entityId","validate","entityData","readFileSync","resolve","process","cwd","jsObject","isValid","putConfigEntityError","importAllRawConfigEntities","baseDirectory","files","jsonFiles","toLowerCase","endsWith","content","substring","everyScriptValid","isScriptValid","allSettled","errors","result","reason","importAllConfigEntities","entriesToImport","envReader","unsubstituted","countManagedObjects","type","count","resultCount","pagedResultsCookie","totalPagedResultsPolicy","totalPagedResults","remainingPagedResults"],"sources":["ops/IdmOps.ts"],"sourcesContent":["/* eslint-disable no-await-in-loop */\nimport fs from 'fs';\nimport fse from 'fs-extra';\nimport path from 'path';\nimport propertiesReader from 'properties-reader';\nimport replaceall from 'replaceall';\n\nimport { Idm, Utils, ValidationUtils } from '@rockcarver/frodo-lib';\nimport {\n createProgressIndicator,\n printMessage,\n stopProgressIndicator,\n} from '../utils/Console';\nimport { getTypedFilename } from '../utils/ExportImportUtils';\n\nconst { readFiles, unSubstituteEnvParams } = Utils;\nconst { validateScriptHooks } = ValidationUtils;\nconst {\n getAllConfigEntities,\n getConfigEntity,\n putConfigEntity,\n queryAllManagedObjectsByType,\n testConnectorServers,\n} = Idm;\n\n/**\n * Warn about and list offline remote connector servers\n */\nexport async function warnAboutOfflineConnectorServers() {\n try {\n const all = await testConnectorServers();\n const offline = all\n .filter((status) => !status.ok)\n .map((status) => status.name);\n if (offline.length) {\n printMessage(\n `\\nThe following connector server(s) are offline and their connectors and configuration unavailable:\\n${offline.join(\n '\\n'\n )}`,\n 'warn'\n );\n }\n } catch (error) {\n printMessage(error, 'error');\n printMessage(\n `Error getting offline connector servers: ${error.message}`,\n 'error'\n );\n }\n}\n\n/**\n * List all IDM configuration objects\n */\nexport async function listAllConfigEntities() {\n try {\n const { configurations } = await getAllConfigEntities();\n for (const configEntity of configurations) {\n printMessage(`${configEntity._id}`, 'data');\n }\n } catch (getAllConfigEntitiesError) {\n printMessage(getAllConfigEntitiesError, 'error');\n printMessage(\n `Error getting config entities: ${getAllConfigEntitiesError}`,\n 'error'\n );\n }\n}\n\n/**\n * Export an IDM configuration object.\n * @param {String} id the desired configuration object\n * @param {String} file optional export file\n */\nexport async function exportConfigEntity(id, file) {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(`${id}`, 'idm');\n }\n const configEntity = await getConfigEntity(id);\n fs.writeFile(fileName, JSON.stringify(configEntity, null, 2), (err) => {\n if (err) {\n return printMessage(`ERROR - can't save ${id} export to file`, 'error');\n }\n return '';\n });\n}\n\n/**\n * Export all IDM configuration objects into separate JSON files in a directory specified by <directory>\n * @param {String} directory export directory\n */\nexport async function exportAllRawConfigEntities(directory) {\n try {\n const { configurations } = await getAllConfigEntities();\n if (!fs.existsSync(directory)) {\n fs.mkdirSync(directory);\n }\n createProgressIndicator(\n 'indeterminate',\n undefined,\n 'Exporting config objects...'\n );\n const entityPromises = [];\n for (const configEntity of configurations) {\n entityPromises.push(\n getConfigEntity(configEntity._id).catch((getConfigEntityError) => {\n if (\n !(\n getConfigEntityError.response?.status === 403 &&\n getConfigEntityError.response?.data?.message ===\n 'This operation is not available in ForgeRock Identity Cloud.'\n ) &&\n // https://bugster.forgerock.org/jira/browse/OPENIDM-18270\n !(\n getConfigEntityError.response?.status === 404 &&\n getConfigEntityError.response?.data?.message ===\n 'No configuration exists for id org.apache.felix.fileinstall/openidm'\n )\n ) {\n printMessage(getConfigEntityError.response?.data, 'error');\n printMessage(\n `Error getting config entity ${configEntity._id}: ${getConfigEntityError}`,\n 'error'\n );\n }\n })\n );\n }\n const results = await Promise.all(entityPromises);\n for (const item of results) {\n if (item != null) {\n fse.outputFile(\n `${directory}/${item._id}.json`,\n JSON.stringify(item, null, 2),\n (err) => {\n if (err) {\n return printMessage(\n `ERROR - can't save config ${item._id} to file - ${err}`,\n 'error'\n );\n }\n }\n );\n }\n }\n stopProgressIndicator('Exported config objects.', 'success');\n } catch (getAllConfigEntitiesError) {\n printMessage(getAllConfigEntitiesError, 'error');\n printMessage(\n `Error getting config entities: ${getAllConfigEntitiesError}`,\n 'error'\n );\n }\n}\n\n/**\n * Export all IDM configuration objects\n * @param {String} directory export directory\n * @param {String} entitiesFile JSON file that specifies the config entities to export/import\n * @param {String} envFile File that defines environment specific variables for replacement during configuration export/import\n */\nexport async function exportAllConfigEntities(\n directory,\n entitiesFile,\n envFile\n) {\n let entriesToExport = [];\n // read list of entities to export\n fs.readFile(entitiesFile, 'utf8', async (err, data) => {\n if (err) throw err;\n const entriesData = JSON.parse(data);\n entriesToExport = entriesData.idm;\n // console.log(`entriesToExport ${entriesToExport}`);\n\n // read list of configs to parameterize for environment specific values\n const envParams = propertiesReader(envFile);\n\n try {\n const { configurations } = await getAllConfigEntities();\n // create export directory if not exist\n if (!fs.existsSync(directory)) {\n fs.mkdirSync(directory);\n }\n createProgressIndicator(\n 'indeterminate',\n undefined,\n 'Exporting config objects...'\n );\n const entityPromises = [];\n for (const configEntity of configurations) {\n if (entriesToExport.includes(configEntity._id)) {\n entityPromises.push(getConfigEntity(configEntity._id));\n }\n }\n const results = await Promise.all(entityPromises);\n for (const item of results) {\n if (item != null) {\n let configEntityString = JSON.stringify(item, null, 2);\n envParams.each((key, value) => {\n configEntityString = replaceall(\n value,\n `\\${${key}}`,\n configEntityString\n );\n });\n fse.outputFile(\n `${directory}/${item._id}.json`,\n configEntityString,\n (error) => {\n if (err) {\n return printMessage(\n `ERROR - can't save config ${item._id} to file - ${error}`,\n 'error'\n );\n }\n }\n );\n }\n }\n stopProgressIndicator(null, 'success');\n } catch (getAllConfigEntitiesError) {\n printMessage(getAllConfigEntitiesError, 'error');\n printMessage(\n `Error getting config entities: ${getAllConfigEntitiesError}`,\n 'error'\n );\n }\n });\n}\n\n/**\n * Import an IDM configuration object.\n * @param entityId the configuration object to import\n * @param file optional file to import\n */\nexport async function importConfigEntity(\n entityId: string,\n file?: string,\n validate?: boolean\n) {\n if (!file) {\n file = getTypedFilename(entityId, 'idm');\n }\n\n const entityData = fs.readFileSync(path.resolve(process.cwd(), file), 'utf8');\n\n const jsObject = JSON.parse(entityData);\n const isValid = validateScriptHooks(jsObject);\n if (validate && !isValid) {\n printMessage('Invalid IDM configuration object', 'error');\n return;\n }\n\n try {\n await putConfigEntity(entityId, entityData);\n } catch (putConfigEntityError) {\n printMessage(putConfigEntityError, 'error');\n printMessage(`Error: ${putConfigEntityError}`, 'error');\n }\n}\n\n/**\n * Import all IDM configuration objects from separate JSON files in a directory specified by <directory>\n * @param baseDirectory export directory\n * @param validate validate script hooks\n */\nexport async function importAllRawConfigEntities(\n baseDirectory: string,\n validate?: boolean\n) {\n if (!fs.existsSync(baseDirectory)) {\n return;\n }\n const files = await readFiles(baseDirectory);\n const jsonFiles = files\n .filter(({ path }) => path.toLowerCase().endsWith('.json'))\n .map(({ path, content }) => ({\n // Remove .json extension\n entityId: path.substring(0, path.length - 5),\n content,\n path,\n }));\n\n let everyScriptValid = true;\n for (const file of jsonFiles) {\n const jsObject = JSON.parse(file.content);\n const isScriptValid = validateScriptHooks(jsObject);\n if (!isScriptValid) {\n printMessage(`Invalid script hook in ${file.path}`, 'error');\n everyScriptValid = false;\n }\n }\n\n if (validate && !everyScriptValid) {\n return;\n }\n\n createProgressIndicator(\n 'indeterminate',\n undefined,\n 'Importing config objects...'\n );\n\n const entityPromises = jsonFiles.map((file) => {\n return putConfigEntity(file.entityId, file.content);\n });\n\n const results = await Promise.allSettled(entityPromises);\n const errors = results.filter(\n (result): result is PromiseRejectedResult => result.status === 'rejected'\n );\n\n if (errors.length > 0) {\n printMessage(`Failed to import ${errors.length} config objects:`, 'error');\n for (const error of errors) {\n printMessage(`- ${error.reason}`, 'error');\n }\n stopProgressIndicator(\n `Failed to import ${errors.length} config objects`,\n 'error'\n );\n return;\n }\n\n stopProgressIndicator(`Imported ${results.length} config objects`, 'success');\n}\n\n/**\n * Import all IDM configuration objects\n * @param baseDirectory import directory\n * @param entitiesFile JSON file that specifies the config entities to export/import\n * @param envFile File that defines environment specific variables for replacement during configuration export/import\n * @param validate validate script hooks\n */\nexport async function importAllConfigEntities(\n baseDirectory: string,\n entitiesFile: string,\n envFile: string,\n validate?: boolean\n) {\n if (!fs.existsSync(baseDirectory)) {\n return;\n }\n const entriesToImport = JSON.parse(fs.readFileSync(entitiesFile, 'utf8')).idm;\n\n const envReader = propertiesReader(envFile);\n\n const files = await readFiles(baseDirectory);\n const jsonFiles = files\n .filter(({ path }) => path.toLowerCase().endsWith('.json'))\n .map(({ content, path }) => ({\n // Remove .json extension\n entityId: path.substring(0, path.length - 5),\n content,\n path,\n }));\n\n let everyScriptValid = true;\n for (const file of jsonFiles) {\n const jsObject = JSON.parse(file.content);\n const isScriptValid = validateScriptHooks(jsObject);\n if (!isScriptValid) {\n printMessage(`Invalid script hook in ${file.path}`, 'error');\n everyScriptValid = false;\n }\n }\n\n if (validate && !everyScriptValid) {\n return;\n }\n\n createProgressIndicator(\n 'indeterminate',\n undefined,\n 'Importing config objects...'\n );\n\n const entityPromises = jsonFiles\n .filter(({ entityId }) => {\n return entriesToImport.includes(entityId);\n })\n .map(({ entityId, content }) => {\n const unsubstituted = unSubstituteEnvParams(content, envReader);\n return putConfigEntity(entityId, unsubstituted);\n });\n\n const results = await Promise.allSettled(entityPromises);\n const errors = results.filter(\n (result): result is PromiseRejectedResult => result.status === 'rejected'\n );\n\n if (errors.length > 0) {\n printMessage(`Failed to import ${errors.length} config objects:`, 'error');\n for (const error of errors) {\n printMessage(`- ${error.reason}`, 'error');\n }\n stopProgressIndicator(\n `Failed to import ${errors.length} config objects`,\n 'error'\n );\n return;\n }\n\n stopProgressIndicator(`Imported ${results.length} config objects`, 'success');\n}\n\n/**\n * Count number of managed objects of a given type\n * @param {String} type managed object type, e.g. alpha_user\n */\nexport async function countManagedObjects(type) {\n let count = 0;\n let result = {\n result: [],\n resultCount: 0,\n pagedResultsCookie: null,\n totalPagedResultsPolicy: 'NONE',\n totalPagedResults: -1,\n remainingPagedResults: -1,\n };\n try {\n do {\n result = await queryAllManagedObjectsByType(\n type,\n [],\n result.pagedResultsCookie\n );\n count += result.resultCount;\n } while (result.pagedResultsCookie);\n printMessage(`${type}: ${count}`);\n } catch (error) {\n printMessage(error.response.data, 'error');\n printMessage(`Error querying managed objects by type: ${error}`, 'error');\n }\n}\n"],"mappings":"AAAA;AACA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,GAAG,MAAM,UAAU;AAC1B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,GAAG,EAAEC,KAAK,EAAEC,eAAe,QAAQ,uBAAuB;AACnE,SACEC,uBAAuB,EACvBC,YAAY,EACZC,qBAAqB,QAChB,kBAAkB;AACzB,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,MAAM;EAAEC,SAAS;EAAEC;AAAsB,CAAC,GAAGP,KAAK;AAClD,MAAM;EAAEQ;AAAoB,CAAC,GAAGP,eAAe;AAC/C,MAAM;EACJQ,oBAAoB;EACpBC,eAAe;EACfC,eAAe;EACfC,4BAA4B;EAC5BC;AACF,CAAC,GAAGd,GAAG;;AAEP;AACA;AACA;AACA,OAAO,eAAee,gCAAgC,GAAG;EACvD,IAAI;IACF,MAAMC,GAAG,GAAG,MAAMF,oBAAoB,EAAE;IACxC,MAAMG,OAAO,GAAGD,GAAG,CAChBE,MAAM,CAAEC,MAAM,IAAK,CAACA,MAAM,CAACC,EAAE,CAAC,CAC9BC,GAAG,CAAEF,MAAM,IAAKA,MAAM,CAACG,IAAI,CAAC;IAC/B,IAAIL,OAAO,CAACM,MAAM,EAAE;MAClBnB,YAAY,CACT,wGAAuGa,OAAO,CAACO,IAAI,CAClH,IAAI,CACJ,EAAC,EACH,MAAM,CACP;IACH;EACF,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdrB,YAAY,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AkB,EAAE,IAAI;IACxBC,uBAAuB,EAAE,MAAM;IAC/BC,iBAAiB,EAAE,CAAC,CAAC;IACrBC,qBAAqB,EAAE,CAAC;EAC1B,CAAC;EACD,IAAI;IACF,GAAG;MACDb,MAAM,GAAG,MAAM/E,4BAA4B,CACzCsF,IAAI,EACJ,EAAE,EACFP,MAAM,CAACU,kBAAkB,CAC1B;MACDF,KAAK,IAAIR,MAAM,CAACS,WAAW;IAC7B,CAAC,QAAQT,MAAM,CAACU,kBAAkB;IAClClG,YAAY,CAAE,GAAE+F,IAAK,KAAIC,KAAM,EAAC,CAAC;EACnC,CAAC,CAAC,OAAO3E,KAAK,EAAE;IACdrB,YAAY,CAACqB,KAAK,CAACwB,QAAQ,CAACC,IAAI,EAAE,OAAO,CAAC;IAC1C9C,YAAY,CAAE,2CAA0CqB,KAAM,EAAC,EAAE,OAAO,CAAC;EAC3E;AACF"}
|
|
1
|
+
{"version":3,"file":"IdmOps.js","names":["fs","fse","path","propertiesReader","replaceall","Idm","Utils","ValidationUtils","createProgressIndicator","printMessage","stopProgressIndicator","getTypedFilename","readFiles","unSubstituteEnvParams","validateScriptHooks","getAllConfigEntities","getConfigEntity","putConfigEntity","queryAllManagedObjectsByType","testConnectorServers","warnAboutOfflineConnectorServers","all","offline","filter","status","ok","map","name","length","join","error","message","listAllConfigEntities","configurations","configEntity","_id","getAllConfigEntitiesError","exportConfigEntity","id","file","fileName","writeFile","JSON","stringify","err","exportAllRawConfigEntities","directory","existsSync","mkdirSync","undefined","entityPromises","push","catch","getConfigEntityError","response","data","includes","reason","results","Promise","item","outputFile","exportAllConfigEntities","entitiesFile","envFile","entriesToExport","readFile","entriesData","parse","idm","envParams","configEntityString","each","key","value","importConfigEntity","entityId","validate","entityData","readFileSync","resolve","process","cwd","jsObject","isValid","putConfigEntityError","importAllRawConfigEntities","baseDirectory","files","jsonFiles","toLowerCase","endsWith","content","substring","everyScriptValid","isScriptValid","allSettled","errors","result","importAllConfigEntities","entriesToImport","envReader","unsubstituted","countManagedObjects","type","count","resultCount","pagedResultsCookie","totalPagedResultsPolicy","totalPagedResults","remainingPagedResults"],"sources":["ops/IdmOps.ts"],"sourcesContent":["/* eslint-disable no-await-in-loop */\nimport fs from 'fs';\nimport fse from 'fs-extra';\nimport path from 'path';\nimport propertiesReader from 'properties-reader';\nimport replaceall from 'replaceall';\n\nimport { Idm, Utils, ValidationUtils } from '@rockcarver/frodo-lib';\nimport {\n createProgressIndicator,\n printMessage,\n stopProgressIndicator,\n} from '../utils/Console';\nimport { getTypedFilename } from '../utils/ExportImportUtils';\n\nconst { readFiles, unSubstituteEnvParams } = Utils;\nconst { validateScriptHooks } = ValidationUtils;\nconst {\n getAllConfigEntities,\n getConfigEntity,\n putConfigEntity,\n queryAllManagedObjectsByType,\n testConnectorServers,\n} = Idm;\n\n/**\n * Warn about and list offline remote connector servers\n */\nexport async function warnAboutOfflineConnectorServers() {\n try {\n const all = await testConnectorServers();\n const offline = all\n .filter((status) => !status.ok)\n .map((status) => status.name);\n if (offline.length) {\n printMessage(\n `\\nThe following connector server(s) are offline and their connectors and configuration unavailable:\\n${offline.join(\n '\\n'\n )}`,\n 'warn'\n );\n }\n } catch (error) {\n printMessage(error, 'error');\n printMessage(\n `Error getting offline connector servers: ${error.message}`,\n 'error'\n );\n }\n}\n\n/**\n * List all IDM configuration objects\n */\nexport async function listAllConfigEntities() {\n try {\n const { configurations } = await getAllConfigEntities();\n for (const configEntity of configurations) {\n printMessage(`${configEntity._id}`, 'data');\n }\n } catch (getAllConfigEntitiesError) {\n printMessage(getAllConfigEntitiesError, 'error');\n printMessage(\n `Error getting config entities: ${getAllConfigEntitiesError}`,\n 'error'\n );\n }\n}\n\n/**\n * Export an IDM configuration object.\n * @param {String} id the desired configuration object\n * @param {String} file optional export file\n */\nexport async function exportConfigEntity(id, file) {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(`${id}`, 'idm');\n }\n const configEntity = await getConfigEntity(id);\n fs.writeFile(fileName, JSON.stringify(configEntity, null, 2), (err) => {\n if (err) {\n return printMessage(`ERROR - can't save ${id} export to file`, 'error');\n }\n return '';\n });\n}\n\n/**\n * Export all IDM configuration objects into separate JSON files in a directory specified by <directory>\n * @param {String} directory export directory\n */\nexport async function exportAllRawConfigEntities(directory) {\n try {\n const { configurations } = await getAllConfigEntities();\n if (!fs.existsSync(directory)) {\n fs.mkdirSync(directory);\n }\n createProgressIndicator(\n 'indeterminate',\n undefined,\n 'Exporting config objects...'\n );\n const entityPromises = [];\n for (const configEntity of configurations) {\n entityPromises.push(\n getConfigEntity(configEntity._id).catch((getConfigEntityError) => {\n if (\n !(\n getConfigEntityError.response?.status === 403 &&\n getConfigEntityError.response?.data?.message ===\n 'This operation is not available in ForgeRock Identity Cloud.'\n ) &&\n !(\n // list of config entities, which do not exist by default or ever.\n (\n [\n 'script',\n 'notificationFactory',\n 'apiVersion',\n 'metrics',\n 'repo.init',\n 'endpoint/validateQueryFilter',\n 'endpoint/oauthproxy',\n 'external.rest',\n 'scheduler',\n 'org.apache.felix.fileinstall/openidm',\n 'cluster',\n 'endpoint/mappingDetails',\n 'fieldPolicy/teammember',\n ].includes(configEntity._id) &&\n getConfigEntityError.response?.status === 404 &&\n getConfigEntityError.response?.data?.reason === 'Not Found'\n )\n ) &&\n // https://bugster.forgerock.org/jira/browse/OPENIDM-18270\n !(\n getConfigEntityError.response?.status === 404 &&\n getConfigEntityError.response?.data?.message ===\n 'No configuration exists for id org.apache.felix.fileinstall/openidm'\n )\n ) {\n printMessage(getConfigEntityError.response?.data, 'error');\n printMessage(\n `Error getting config entity ${configEntity._id}: ${getConfigEntityError}`,\n 'error'\n );\n }\n })\n );\n }\n const results = await Promise.all(entityPromises);\n for (const item of results) {\n if (item != null) {\n fse.outputFile(\n `${directory}/${item._id}.json`,\n JSON.stringify(item, null, 2),\n (err) => {\n if (err) {\n return printMessage(\n `ERROR - can't save config ${item._id} to file - ${err}`,\n 'error'\n );\n }\n }\n );\n }\n }\n stopProgressIndicator('Exported config objects.', 'success');\n } catch (getAllConfigEntitiesError) {\n printMessage(getAllConfigEntitiesError, 'error');\n printMessage(\n `Error getting config entities: ${getAllConfigEntitiesError}`,\n 'error'\n );\n }\n}\n\n/**\n * Export all IDM configuration objects\n * @param {String} directory export directory\n * @param {String} entitiesFile JSON file that specifies the config entities to export/import\n * @param {String} envFile File that defines environment specific variables for replacement during configuration export/import\n */\nexport async function exportAllConfigEntities(\n directory,\n entitiesFile,\n envFile\n) {\n let entriesToExport = [];\n // read list of entities to export\n fs.readFile(entitiesFile, 'utf8', async (err, data) => {\n if (err) throw err;\n const entriesData = JSON.parse(data);\n entriesToExport = entriesData.idm;\n // console.log(`entriesToExport ${entriesToExport}`);\n\n // read list of configs to parameterize for environment specific values\n const envParams = propertiesReader(envFile);\n\n try {\n const { configurations } = await getAllConfigEntities();\n // create export directory if not exist\n if (!fs.existsSync(directory)) {\n fs.mkdirSync(directory);\n }\n createProgressIndicator(\n 'indeterminate',\n undefined,\n 'Exporting config objects...'\n );\n const entityPromises = [];\n for (const configEntity of configurations) {\n if (entriesToExport.includes(configEntity._id)) {\n entityPromises.push(getConfigEntity(configEntity._id));\n }\n }\n const results = await Promise.all(entityPromises);\n for (const item of results) {\n if (item != null) {\n let configEntityString = JSON.stringify(item, null, 2);\n envParams.each((key, value) => {\n configEntityString = replaceall(\n value,\n `\\${${key}}`,\n configEntityString\n );\n });\n fse.outputFile(\n `${directory}/${item._id}.json`,\n configEntityString,\n (error) => {\n if (err) {\n return printMessage(\n `ERROR - can't save config ${item._id} to file - ${error}`,\n 'error'\n );\n }\n }\n );\n }\n }\n stopProgressIndicator(null, 'success');\n } catch (getAllConfigEntitiesError) {\n printMessage(getAllConfigEntitiesError, 'error');\n printMessage(\n `Error getting config entities: ${getAllConfigEntitiesError}`,\n 'error'\n );\n }\n });\n}\n\n/**\n * Import an IDM configuration object.\n * @param entityId the configuration object to import\n * @param file optional file to import\n */\nexport async function importConfigEntity(\n entityId: string,\n file?: string,\n validate?: boolean\n) {\n if (!file) {\n file = getTypedFilename(entityId, 'idm');\n }\n\n const entityData = fs.readFileSync(path.resolve(process.cwd(), file), 'utf8');\n\n const jsObject = JSON.parse(entityData);\n const isValid = validateScriptHooks(jsObject);\n if (validate && !isValid) {\n printMessage('Invalid IDM configuration object', 'error');\n return;\n }\n\n try {\n await putConfigEntity(entityId, entityData);\n } catch (putConfigEntityError) {\n printMessage(putConfigEntityError, 'error');\n printMessage(`Error: ${putConfigEntityError}`, 'error');\n }\n}\n\n/**\n * Import all IDM configuration objects from separate JSON files in a directory specified by <directory>\n * @param baseDirectory export directory\n * @param validate validate script hooks\n */\nexport async function importAllRawConfigEntities(\n baseDirectory: string,\n validate?: boolean\n) {\n if (!fs.existsSync(baseDirectory)) {\n return;\n }\n const files = await readFiles(baseDirectory);\n const jsonFiles = files\n .filter(({ path }) => path.toLowerCase().endsWith('.json'))\n .map(({ path, content }) => ({\n // Remove .json extension\n entityId: path.substring(0, path.length - 5),\n content,\n path,\n }));\n\n let everyScriptValid = true;\n for (const file of jsonFiles) {\n const jsObject = JSON.parse(file.content);\n const isScriptValid = validateScriptHooks(jsObject);\n if (!isScriptValid) {\n printMessage(`Invalid script hook in ${file.path}`, 'error');\n everyScriptValid = false;\n }\n }\n\n if (validate && !everyScriptValid) {\n return;\n }\n\n createProgressIndicator(\n 'indeterminate',\n undefined,\n 'Importing config objects...'\n );\n\n const entityPromises = jsonFiles.map((file) => {\n return putConfigEntity(file.entityId, file.content);\n });\n\n const results = await Promise.allSettled(entityPromises);\n const errors = results.filter(\n (result): result is PromiseRejectedResult => result.status === 'rejected'\n );\n\n if (errors.length > 0) {\n printMessage(`Failed to import ${errors.length} config objects:`, 'error');\n for (const error of errors) {\n printMessage(`- ${error.reason}`, 'error');\n }\n stopProgressIndicator(\n `Failed to import ${errors.length} config objects`,\n 'error'\n );\n return;\n }\n\n stopProgressIndicator(`Imported ${results.length} config objects`, 'success');\n}\n\n/**\n * Import all IDM configuration objects\n * @param baseDirectory import directory\n * @param entitiesFile JSON file that specifies the config entities to export/import\n * @param envFile File that defines environment specific variables for replacement during configuration export/import\n * @param validate validate script hooks\n */\nexport async function importAllConfigEntities(\n baseDirectory: string,\n entitiesFile: string,\n envFile: string,\n validate?: boolean\n) {\n if (!fs.existsSync(baseDirectory)) {\n return;\n }\n const entriesToImport = JSON.parse(fs.readFileSync(entitiesFile, 'utf8')).idm;\n\n const envReader = propertiesReader(envFile);\n\n const files = await readFiles(baseDirectory);\n const jsonFiles = files\n .filter(({ path }) => path.toLowerCase().endsWith('.json'))\n .map(({ content, path }) => ({\n // Remove .json extension\n entityId: path.substring(0, path.length - 5),\n content,\n path,\n }));\n\n let everyScriptValid = true;\n for (const file of jsonFiles) {\n const jsObject = JSON.parse(file.content);\n const isScriptValid = validateScriptHooks(jsObject);\n if (!isScriptValid) {\n printMessage(`Invalid script hook in ${file.path}`, 'error');\n everyScriptValid = false;\n }\n }\n\n if (validate && !everyScriptValid) {\n return;\n }\n\n createProgressIndicator(\n 'indeterminate',\n undefined,\n 'Importing config objects...'\n );\n\n const entityPromises = jsonFiles\n .filter(({ entityId }) => {\n return entriesToImport.includes(entityId);\n })\n .map(({ entityId, content }) => {\n const unsubstituted = unSubstituteEnvParams(content, envReader);\n return putConfigEntity(entityId, unsubstituted);\n });\n\n const results = await Promise.allSettled(entityPromises);\n const errors = results.filter(\n (result): result is PromiseRejectedResult => result.status === 'rejected'\n );\n\n if (errors.length > 0) {\n printMessage(`Failed to import ${errors.length} config objects:`, 'error');\n for (const error of errors) {\n printMessage(`- ${error.reason}`, 'error');\n }\n stopProgressIndicator(\n `Failed to import ${errors.length} config objects`,\n 'error'\n );\n return;\n }\n\n stopProgressIndicator(`Imported ${results.length} config objects`, 'success');\n}\n\n/**\n * Count number of managed objects of a given type\n * @param {String} type managed object type, e.g. alpha_user\n */\nexport async function countManagedObjects(type) {\n let count = 0;\n let result = {\n result: [],\n resultCount: 0,\n pagedResultsCookie: null,\n totalPagedResultsPolicy: 'NONE',\n totalPagedResults: -1,\n remainingPagedResults: -1,\n };\n try {\n do {\n result = await queryAllManagedObjectsByType(\n type,\n [],\n result.pagedResultsCookie\n );\n count += result.resultCount;\n } while (result.pagedResultsCookie);\n printMessage(`${type}: ${count}`);\n } catch (error) {\n printMessage(error.response.data, 'error');\n printMessage(`Error querying managed objects by type: ${error}`, 'error');\n }\n}\n"],"mappings":"AAAA;AACA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,GAAG,MAAM,UAAU;AAC1B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,GAAG,EAAEC,KAAK,EAAEC,eAAe,QAAQ,uBAAuB;AACnE,SACEC,uBAAuB,EACvBC,YAAY,EACZC,qBAAqB,QAChB,kBAAkB;AACzB,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,MAAM;EAAEC,SAAS;EAAEC;AAAsB,CAAC,GAAGP,KAAK;AAClD,MAAM;EAAEQ;AAAoB,CAAC,GAAGP,eAAe;AAC/C,MAAM;EACJQ,oBAAoB;EACpBC,eAAe;EACfC,eAAe;EACfC,4BAA4B;EAC5BC;AACF,CAAC,GAAGd,GAAG;;AAEP;AACA;AACA;AACA,OAAO,eAAee,gCAAgC,GAAG;EACvD,IAAI;IACF,MAAMC,GAAG,GAAG,MAAMF,oBAAoB,EAAE;IACxC,MAAMG,OAAO,GAAGD,GAAG,CAChBE,MAAM,CAAEC,MAAM,IAAK,CAACA,MAAM,CAACC,EAAE,CAAC,CAC9BC,GAAG,CAAEF,MAAM,IAAKA,MAAM,CAACG,IAAI,CAAC;IAC/B,IAAIL,OAAO,CAACM,MAAM,EAAE;MAClBnB,YAAY,CACT,wGAAuGa,OAAO,CAACO,IAAI,CAClH,IAAI,CACJ,EAAC,EACH,MAAM,CACP;IACH;EACF,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdrB,YAAY,CAACqB,KAAK,EA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AIqB,KAAK,CAAC2B,MAAO,EAAC,EAAE,OAAO,CAAC;IAC5C;IACA/C,qBAAqB,CAClB,oBAAmBuF,MAAM,CAACrE,MAAO,iBAAgB,EAClD,OAAO,CACR;IACD;EACF;EAEAlB,qBAAqB,CAAE,YAAWgD,OAAO,CAAC9B,MAAO,iBAAgB,EAAE,SAAS,CAAC;AAC/E;;AAEA;AACA;AACA;AACA;AACA,OAAO,eAAe2E,mBAAmB,CAACC,IAAI,EAAE;EAC9C,IAAIC,KAAK,GAAG,CAAC;EACb,IAAIP,MAAM,GAAG;IACXA,MAAM,EAAE,EAAE;IACVQ,WAAW,EAAE,CAAC;IACdC,kBAAkB,EAAE,IAAI;IACxBC,uBAAuB,EAAE,MAAM;IAC/BC,iBAAiB,EAAE,CAAC,CAAC;IACrBC,qBAAqB,EAAE,CAAC;EAC1B,CAAC;EACD,IAAI;IACF,GAAG;MACDZ,MAAM,GAAG,MAAMhF,4BAA4B,CACzCsF,IAAI,EACJ,EAAE,EACFN,MAAM,CAACS,kBAAkB,CAC1B;MACDF,KAAK,IAAIP,MAAM,CAACQ,WAAW;IAC7B,CAAC,QAAQR,MAAM,CAACS,kBAAkB;IAClClG,YAAY,CAAE,GAAE+F,IAAK,KAAIC,KAAM,EAAC,CAAC;EACnC,CAAC,CAAC,OAAO3E,KAAK,EAAE;IACdrB,YAAY,CAACqB,KAAK,CAACwB,QAAQ,CAACC,IAAI,EAAE,OAAO,CAAC;IAC1C9C,YAAY,CAAE,2CAA0CqB,KAAM,EAAC,EAAE,OAAO,CAAC;EAC3E;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockcarver/frodo-cli",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
|
|
6
6
|
"keywords": [
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
]
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@rockcarver/frodo-lib": "0.18.
|
|
107
|
+
"@rockcarver/frodo-lib": "0.18.5",
|
|
108
108
|
"chokidar": "^3.5.3",
|
|
109
109
|
"cli-progress": "^3.11.2",
|
|
110
110
|
"cli-table3": "^0.6.3",
|