@rockcarver/frodo-cli 0.18.2-12 → 0.18.2-13
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/esm/cli/idm/idm-count.js +4 -6
- package/esm/cli/idm/idm-count.js.map +1 -1
- package/esm/cli/idm/idm-export.js +2 -6
- package/esm/cli/idm/idm-export.js.map +1 -1
- package/esm/cli/idm/idm-import.js +2 -6
- package/esm/cli/idm/idm-import.js.map +1 -1
- package/esm/cli/idm/idm-list.js +2 -4
- package/esm/cli/idm/idm-list.js.map +1 -1
- package/esm/cli/logging/logs-fetch.js +1 -1
- package/esm/cli/logging/logs-fetch.js.map +1 -1
- package/esm/cli/logging/logs-tail.js +1 -1
- package/esm/cli/logging/logs-tail.js.map +1 -1
- package/esm/ops/IdmOps.js +317 -0
- package/esm/ops/IdmOps.js.map +1 -0
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.18.2-13] - 2022-12-01
|
|
11
|
+
|
|
10
12
|
## [0.18.2-12] - 2022-11-29
|
|
11
13
|
|
|
12
14
|
## [0.18.2-11] - 2022-11-26
|
|
@@ -738,7 +740,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
738
740
|
- Fixed problem with adding connection profiles
|
|
739
741
|
- Miscellaneous bug fixes
|
|
740
742
|
|
|
741
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.18.2-
|
|
743
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.18.2-13...HEAD
|
|
744
|
+
|
|
745
|
+
[0.18.2-13]: https://github.com/rockcarver/frodo-cli/compare/v0.18.2-12...v0.18.2-13
|
|
742
746
|
|
|
743
747
|
[0.18.2-12]: https://github.com/rockcarver/frodo-cli/compare/v0.18.2-11...v0.18.2-12
|
|
744
748
|
|
package/esm/cli/idm/idm-count.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate,
|
|
3
|
-
import * as common from '../cmd_common
|
|
4
|
-
import { verboseMessage } from '../../utils/Console
|
|
2
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
+
import * as common from '../cmd_common';
|
|
4
|
+
import { verboseMessage } from '../../utils/Console';
|
|
5
|
+
import { countManagedObjects } from '../../ops/IdmOps';
|
|
5
6
|
const {
|
|
6
7
|
getTokens
|
|
7
8
|
} = Authenticate;
|
|
8
|
-
const {
|
|
9
|
-
countManagedObjects
|
|
10
|
-
} = Idm;
|
|
11
9
|
const program = new Command('frodo idm count');
|
|
12
10
|
program.description('Count managed objects.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-m, --managed-object <type>', 'Type of managed object to count. E.g. "alpha_user", "alpha_role", "user", "role".')).action(
|
|
13
11
|
// implement command logic inside action handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idm-count.js","names":["Command","Option","Authenticate","
|
|
1
|
+
{"version":3,"file":"idm-count.js","names":["Command","Option","Authenticate","state","common","verboseMessage","countManagedObjects","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","managedObject","parse"],"sources":["cli/idm/idm-count.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { verboseMessage } from '../../utils/Console';\nimport { countManagedObjects } from '../../ops/IdmOps';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo idm count');\n\nprogram\n .description('Count managed objects.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-m, --managed-object <type>',\n 'Type of managed object to count. E.g. \"alpha_user\", \"alpha_role\", \"user\", \"role\".'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (await getTokens()) {\n verboseMessage(`Counting managed ${options.managedObject} objects...`);\n countManagedObjects(options.managedObject);\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,WAAW;AAC3C,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mBAAmB,QAAQ,kBAAkB;AAEtD,MAAM;EAAEC;AAAU,CAAC,GAAGL,YAAY;AAElC,MAAMM,OAAO,GAAG,IAAIR,OAAO,CAAC,iBAAiB,CAAC;AAE9CQ,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CAChCC,kBAAkB,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EACrD,IAAI,MAAMpC,SAAS,EAAE,EAAE;IACrBF,cAAc,CAAE,oBAAmBsB,OAAO,CAACiB,aAAc,aAAY,CAAC;IACtEtC,mBAAmB,CAACqB,OAAO,CAACiB,aAAa,CAAC;EAC5C;AACF;AACA;AAAA,CACD;;AAEHpC,OAAO,CAACqC,KAAK,EAAE"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate,
|
|
2
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common';
|
|
4
4
|
import { printMessage, verboseMessage } from '../../utils/Console';
|
|
5
|
+
import { exportAllConfigEntities, exportAllRawConfigEntities, exportConfigEntity } from '../../ops/IdmOps';
|
|
5
6
|
const {
|
|
6
7
|
getTokens
|
|
7
8
|
} = Authenticate;
|
|
8
|
-
const {
|
|
9
|
-
exportAllConfigEntities,
|
|
10
|
-
exportAllRawConfigEntities,
|
|
11
|
-
exportConfigEntity
|
|
12
|
-
} = Idm;
|
|
13
9
|
const program = new Command('frodo idm export');
|
|
14
10
|
program.description('Export IDM configuration objects.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-N, --name <name>', 'Config entity name. E.g. "managed", "sync", "provisioner-<connector-name>", etc.')).addOption(new Option('-f, --file [file]', 'Export file. Ignored with -A.')).addOption(new Option('-E, --entities-file [entities-file]', 'Name of the entity file. Ignored with -A.')).addOption(new Option('-e, --env-file [envfile]', 'Name of the env file. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all IDM configuration objects into a single file in directory -D. Ignored with -N.')).addOption(new Option('-A, --all-separate', 'Export all IDM configuration objects into separate JSON files in directory -D. Ignored with -N, and -a.')).addOption(new Option('-D, --directory <directory>', 'Export directory. Required with and ignored without -a/-A.')).action(
|
|
15
11
|
// implement command logic inside action handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idm-export.js","names":["Command","Option","Authenticate","
|
|
1
|
+
{"version":3,"file":"idm-export.js","names":["Command","Option","Authenticate","state","common","printMessage","verboseMessage","exportAllConfigEntities","exportAllRawConfigEntities","exportConfigEntity","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","name","getRealm","file","allSeparate","directory","entitiesFile","envFile","help","parse"],"sources":["cli/idm/idm-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport {\n exportAllConfigEntities,\n exportAllRawConfigEntities,\n exportConfigEntity,\n} from '../../ops/IdmOps';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo idm export');\n\nprogram\n .description('Export IDM configuration objects.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-N, --name <name>',\n 'Config entity name. E.g. \"managed\", \"sync\", \"provisioner-<connector-name>\", etc.'\n )\n )\n .addOption(new Option('-f, --file [file]', 'Export file. Ignored with -A.'))\n .addOption(\n new Option(\n '-E, --entities-file [entities-file]',\n 'Name of the entity file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-e, --env-file [envfile]',\n 'Name of the env file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all IDM configuration objects into a single file in directory -D. Ignored with -N.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all IDM configuration objects into separate JSON files in directory -D. Ignored with -N, and -a.'\n )\n )\n .addOption(\n new Option(\n '-D, --directory <directory>',\n 'Export directory. Required with and ignored without -a/-A.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n // export by id/name\n if (options.name && (await getTokens())) {\n verboseMessage(\n `Exporting object \"${\n options.name\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n exportConfigEntity(options.name, options.file);\n }\n // --all-separate -A\n else if (\n options.allSeparate &&\n options.directory &&\n options.entitiesFile &&\n options.envFile &&\n (await getTokens())\n ) {\n verboseMessage(\n `Exporting IDM configuration objects specified in ${options.entitiesFile} into separate files in ${options.directory} using ${options.envFile} for variable replacement...`\n );\n exportAllConfigEntities(\n options.directory,\n options.entitiesFile,\n options.envFile\n );\n }\n // --all-separate -A without variable replacement\n else if (\n options.allSeparate &&\n options.directory &&\n (await getTokens())\n ) {\n verboseMessage(\n `Exporting all IDM configuration objects into separate files in ${options.directory}...`\n );\n exportAllRawConfigEntities(options.directory);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,WAAW;AAC3C,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,OAAO,KAAK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ACuB,OAAO,KACd,MAAM5C,SAAS,EAAE,CAAC,EACnB;IACAJ,cAAc,CACX,oDAAmDyB,OAAO,CAACsB,YAAa,2BAA0BtB,OAAO,CAACqB,SAAU,UAASrB,OAAO,CAACuB,OAAQ,8BAA6B,CAC5K;IACD/C,uBAAuB,CACrBwB,OAAO,CAACqB,SAAS,EACjBrB,OAAO,CAACsB,YAAY,EACpBtB,OAAO,CAACuB,OAAO,CAChB;EACH;EACA;EAAA,KACK,IACHvB,OAAO,CAACoB,WAAW,IACnBpB,OAAO,CAACqB,SAAS,KAChB,MAAM1C,SAAS,EAAE,CAAC,EACnB;IACAJ,cAAc,CACX,kEAAiEyB,OAAO,CAACqB,SAAU,KAAI,CACzF;IACD5C,0BAA0B,CAACuB,OAAO,CAACqB,SAAS,CAAC;EAC/C;EACA;EAAA,KACK;IACH/C,YAAY,CACV,sDAAsD,EACtD,OAAO,CACR;IACDM,OAAO,CAAC4C,IAAI,EAAE;EAChB;AACF;AACA;AAAA,CACD;;AAEH5C,OAAO,CAAC6C,KAAK,EAAE"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate,
|
|
2
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common';
|
|
4
4
|
import { printMessage, verboseMessage } from '../../utils/Console';
|
|
5
|
+
import { importAllConfigEntities, importAllRawConfigEntities, importConfigEntity } from '../../ops/IdmOps';
|
|
5
6
|
const {
|
|
6
7
|
getTokens
|
|
7
8
|
} = Authenticate;
|
|
8
|
-
const {
|
|
9
|
-
importAllConfigEntities,
|
|
10
|
-
importAllRawConfigEntities,
|
|
11
|
-
importConfigEntity
|
|
12
|
-
} = Idm;
|
|
13
9
|
const program = new Command('frodo idm import');
|
|
14
10
|
program.description('Import IDM configuration objects.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-N, --name <name>', 'Config entity name. E.g. "managed", "sync", "provisioner-<connector-name>", etc.')).addOption(new Option('-f, --file [file]', 'Import file. Ignored with -A.')).addOption(new Option('-E, --entities-file [entities-file]', 'Name of the entity file. Ignored with -A.')).addOption(new Option('-e, --env-file [envfile]', 'Name of the env file. Ignored with -A.')).addOption(new Option('-A, --all-separate', 'Import all IDM configuration objects into separate JSON files in directory -D. Ignored with -N, and -a.')).addOption(new Option('-D, --directory <directory>', 'Import directory. Required with and ignored without -a/-A.')).action(
|
|
15
11
|
// implement command logic inside action handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idm-import.js","names":["Command","Option","Authenticate","
|
|
1
|
+
{"version":3,"file":"idm-import.js","names":["Command","Option","Authenticate","state","common","printMessage","verboseMessage","importAllConfigEntities","importAllRawConfigEntities","importConfigEntity","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","name","getRealm","file","allSeparate","directory","entitiesFile","envFile","help","parse"],"sources":["cli/idm/idm-import.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport {\n importAllConfigEntities,\n importAllRawConfigEntities,\n importConfigEntity,\n} from '../../ops/IdmOps';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo idm import');\n\ninterface IdmImportOptions {\n type?: string;\n insecure?: string;\n verbose?: boolean;\n debug?: boolean;\n curlirize?: boolean;\n name?: string;\n file?: string;\n entitiesFile?: string;\n envFile?: string;\n all?: string;\n allSeparate?: string;\n directory?: string;\n}\n\nprogram\n .description('Import IDM configuration objects.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-N, --name <name>',\n 'Config entity name. E.g. \"managed\", \"sync\", \"provisioner-<connector-name>\", etc.'\n )\n )\n .addOption(new Option('-f, --file [file]', 'Import file. Ignored with -A.'))\n .addOption(\n new Option(\n '-E, --entities-file [entities-file]',\n 'Name of the entity file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-e, --env-file [envfile]',\n 'Name of the env file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all IDM configuration objects into separate JSON files in directory -D. Ignored with -N, and -a.'\n )\n )\n .addOption(\n new Option(\n '-D, --directory <directory>',\n 'Import directory. Required with and ignored without -a/-A.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (\n host: string,\n realm: string,\n user: string,\n password: string,\n options: IdmImportOptions\n ) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n // import by id/name\n if (options.name && (await getTokens())) {\n verboseMessage(\n `Importing object \"${\n options.name\n }\" to realm \"${state.default.session.getRealm()}\"...`\n );\n await importConfigEntity(options.name, options.file);\n }\n // --all-separate -A\n else if (\n options.allSeparate &&\n options.directory &&\n options.entitiesFile &&\n options.envFile &&\n (await getTokens())\n ) {\n verboseMessage(\n `Importing IDM configuration objects specified in ${options.entitiesFile} into separate files in ${options.directory} using ${options.envFile} for variable replacement...`\n );\n await importAllConfigEntities(\n options.directory,\n options.entitiesFile,\n options.envFile\n );\n }\n // --all-separate -A without variable replacement\n else if (\n options.allSeparate &&\n options.directory &&\n (await getTokens())\n ) {\n verboseMessage(\n `Importing all IDM configuration objects into separate files in ${options.directory}...`\n );\n await importAllRawConfigEntities(options.directory);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,WAAW;AAC3C,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SACEC,uBAAuB,EACvBC,0BAA0B,EAC1BC,kBAAkB,QACb,kBAAkB;AAEzB,MAAM;EAAEC;AAAU,CAAC,GAAGR,YAAY;AAElC,MAAMS,OAAO,GAAG,IAAIX,OAAO,CAAC,kBAAkB,CAAC;AAiB/CW,OAAO,CACJC,WAAW,CAAC,mCAAmC,CAAC,CAChDC,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CAChCC,kBAAkB,EAAE,CACpBC,WAAW,CAACX,MAAM,CAACY,aAAa,CAAC,CACjCD,WAAW,CAACX,MAAM,CAACa,aAAa,CAAC,CACjCF,WAAW,CAACX,MAAM,CAACc,YAAY,CAAC,CAChCH,WAAW,CAACX,MAAM,CAACe,gBAAgB,CAAC,CACpCC,SAAS,CAAChB,MAAM,CAACiB,gBAAgB,CAAC,CAClCD,SAAS,CAAChB,MAAM,CAACkB,cAAc,CAAC,CAChCF,SAAS,CAAChB,MAAM,CAACmB,aAAa,CAAC,CAC/BH,SAAS,CAAChB,MAAM,CAACoB,WAAW,CAAC,CAC7BJ,SAAS,CAAChB,MAAM,CA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,CAACgB,SAAS,CAAC;EACrD;EACA,IAAIhB,OAAO,CAACiB,IAAI,KAAK,MAAMtC,SAAS,EAAE,CAAC,EAAE;IACvCJ,cAAc,CACX,qBACCyB,OAAO,CAACiB,IACT,eAAc7C,KAAK,CAAC6B,OAAO,CAACC,OAAO,CAACgB,QAAQ,EAAG,MAAK,CACtD;IACD,MAAMxC,kBAAkB,CAACsB,OAAO,CAACiB,IAAI,EAAEjB,OAAO,CAACmB,IAAI,CAAC;EACtD;EACA;EAAA,KACK,IACHnB,OAAO,CAACoB,WAAW,IACnBpB,OAAO,CAACqB,SAAS,IACjBrB,OAAO,CAACsB,YAAY,IACpBtB,OAAO,CAACuB,OAAO,KACd,MAAM5C,SAAS,EAAE,CAAC,EACnB;IACAJ,cAAc,CACX,oDAAmDyB,OAAO,CAACsB,YAAa,2BAA0BtB,OAAO,CAACqB,SAAU,UAASrB,OAAO,CAACuB,OAAQ,8BAA6B,CAC5K;IACD,MAAM/C,uBAAuB,CAC3BwB,OAAO,CAACqB,SAAS,EACjBrB,OAAO,CAACsB,YAAY,EACpBtB,OAAO,CAACuB,OAAO,CAChB;EACH;EACA;EAAA,KACK,IACHvB,OAAO,CAACoB,WAAW,IACnBpB,OAAO,CAACqB,SAAS,KAChB,MAAM1C,SAAS,EAAE,CAAC,EACnB;IACAJ,cAAc,CACX,kEAAiEyB,OAAO,CAACqB,SAAU,KAAI,CACzF;IACD,MAAM5C,0BAA0B,CAACuB,OAAO,CAACqB,SAAS,CAAC;EACrD;EACA;EAAA,KACK;IACH/C,YAAY,CACV,sDAAsD,EACtD,OAAO,CACR;IACDM,OAAO,CAAC4C,IAAI,EAAE;EAChB;AACF;AACA;AAAA,CACD;;AAEH5C,OAAO,CAAC6C,KAAK,EAAE"}
|
package/esm/cli/idm/idm-list.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { Authenticate,
|
|
2
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common';
|
|
4
4
|
import { verboseMessage } from '../../utils/Console';
|
|
5
|
+
import { listAllConfigEntities } from '../../ops/IdmOps';
|
|
5
6
|
const {
|
|
6
7
|
getTokens
|
|
7
8
|
} = Authenticate;
|
|
8
|
-
const {
|
|
9
|
-
listAllConfigEntities
|
|
10
|
-
} = Idm;
|
|
11
9
|
const program = new Command('frodo idm list');
|
|
12
10
|
program.description('List IDM configuration objects.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption)
|
|
13
11
|
// .addOption(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idm-list.js","names":["Command","Authenticate","
|
|
1
|
+
{"version":3,"file":"idm-list.js","names":["Command","Authenticate","state","common","verboseMessage","listAllConfigEntities","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","parse"],"sources":["cli/idm/idm-list.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { verboseMessage } from '../../utils/Console';\nimport { listAllConfigEntities } from '../../ops/IdmOps';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo idm list');\n\nprogram\n .description('List IDM configuration objects.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n // .addOption(\n // new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (await getTokens()) {\n verboseMessage('Listing all IDM configuration objects...');\n listAllConfigEntities();\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,WAAW;AACnC,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,MAAM;EAAEC;AAAU,CAAC,GAAGL,YAAY;AAElC,MAAMM,OAAO,GAAG,IAAIP,OAAO,CAAC,gBAAgB,CAAC;AAE7CO,OAAO,CACJC,WAAW,CAAC,iCAAiC,CAAC,CAC9CC,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CAChCC,kBAAkB,EAAE,CACpBC,WAAW,CAACR,MAAM,CAACS,aAAa,CAAC,CACjCD,WAAW,CAACR,MAAM,CAACU,aAAa,CAAC,CACjCF,WAAW,CAACR,MAAM,CAACW,YAAY,CAAC,CAChCH,WAAW,CAACR,MAAM,CAACY,gBAAgB,CAAC,CACpCC,SAAS,CAACb,MAAM,CAACc,gBAAgB,CAAC,CAClCD,SAAS,CAACb,MAAM,CAACe,cAAc,CAAC,CAChCF,SAAS,CAACb,MAAM,CAACgB,aAAa,CAAC,CAC/BH,SAAS,CAACb,MAAM,CAACiB,WAAW,CAAC,CAC7BJ,SAAS,CAACb,MAAM,CAACkB,eAAe;AACjC;AACA;AACA;AAAA,CACCC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,KAAK;EAC9CzB,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACC,SAAS,CAACP,IAAI,CAAC;EACrCrB,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACE,QAAQ,CAACP,KAAK,CAAC;EACrCtB,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACG,WAAW,CAACP,IAAI,CAAC;EACvCvB,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACI,WAAW,CAACP,QAAQ,CAAC;EAC3CxB,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACK,iBAAiB,CAACP,OAAO,CAACQ,IAAI,CAAC;EACrDjC,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACO,0BAA0B,CAACT,OAAO,CAACU,QAAQ,CAAC;EAClEnC,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACS,UAAU,CAACX,OAAO,CAACY,OAAO,CAAC;EACjDrC,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACW,QAAQ,CAACb,OAAO,CAACc,KAAK,CAAC;EAC7CvC,KAAK,CAAC0B,OAAO,CAACC,OAAO,CAACa,YAAY,CAACf,OAAO,CAACgB,SAAS,CAAC;EACrD,IAAI,MAAMrC,SAAS,EAAE,EAAE;IACrBF,cAAc,CAAC,0CAA0C,CAAC;IAC1DC,qBAAqB,EAAE;EACzB;AACF;AACA;AAAA,CACD;;AAEHE,OAAO,CAACqC,KAAK,EAAE"}
|
|
@@ -27,7 +27,7 @@ Following values are possible (values on the same line are equivalent): \
|
|
|
27
27
|
\n2, INFO or INFORMATION\n3, DEBUG, FINE, FINER or FINEST\
|
|
28
28
|
\n4 or ALL').default('ERROR', `${resolveLevel('ERROR')}`)).addOption(new Option('-t, --transaction-id <txid>', 'Filter by transactionId')).addOption(new Option('-b, --begin-timestamp <beginTs>', 'Begin timestamp for period (in ISO8601, example: "2022-10-13T19:06:28Z", or "2022-09.30". \
|
|
29
29
|
Cannot be more than 30 days in the past. If not specified, logs from one hour ago are fetched \
|
|
30
|
-
(-e is ignored)')).addOption(new Option('-e, --end-timestamp <endTs>', 'End timestamp for period. Default: "now"')).addOption(new Option('-s, --search-string <ss>', 'Filter by a specific string (ANDed with transactionID filter)')).addOption(new Option('-d, --defaults', 'Use default logging noise filters').default(false, `Use custom logging noise filters defined in $
|
|
30
|
+
(-e is ignored)')).addOption(new Option('-e, --end-timestamp <endTs>', 'End timestamp for period. Default: "now"')).addOption(new Option('-s, --search-string <ss>', 'Filter by a specific string (ANDed with transactionID filter)')).addOption(new Option('-d, --defaults', 'Use default logging noise filters').default(false, `Use custom logging noise filters defined in $HOME/${config.FRODO_LOG_NOISEFILTER_FILENAME}`)).action(async (host, user, password, options, command) => {
|
|
31
31
|
let credsFromParameters = true;
|
|
32
32
|
state.default.session.setTenant(host);
|
|
33
33
|
state.default.session.setUsername(user);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-fetch.js","names":["Command","Option","Authenticate","ConnectionProfile","Log","state","common","config","printMessage","provisionCreds","fetchLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","SECONDS_IN_30_DAYS","SECONDS_IN_1_HOUR","LOG_TIME_WINDOW_MAX","LOG_TIME_WINDOW_INCREMENT","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","verboseOption","debugOption","curlirizeOption","sourcesOptionM","default","getConfigPath","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","credsFromParameters","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","now","Date","beginTimestamp","tempStartDate","setTime","toISOString","tempEndDate","endTimestamp","beginTs","parse","intermediateEndTs","opts","sources","level","transactionId","searchString","getNoiseFilters","defaults"],"sources":["cli/logging/logs-fetch.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, fetchLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst SECONDS_IN_30_DAYS = 2592000;\nconst SECONDS_IN_1_HOUR = 3600;\nconst LOG_TIME_WINDOW_MAX = SECONDS_IN_30_DAYS;\nconst LOG_TIME_WINDOW_INCREMENT = SECONDS_IN_1_HOUR;\n\nconst program = new Command('frodo logs fetch');\nprogram\n .description(\n 'Fetch Identity Cloud logs between a specified begin and end time period.\\\n WARNING: depending on filters and time period specified, this could take substantial time to complete.'\n )\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(common.sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option(\n '-b, --begin-timestamp <beginTs>',\n 'Begin timestamp for period (in ISO8601, example: \"2022-10-13T19:06:28Z\", or \"2022-09.30\". \\\nCannot be more than 30 days in the past. If not specified, logs from one hour ago are fetched \\\n(-e is ignored)'\n )\n )\n .addOption(\n new Option(\n '-e, --end-timestamp <endTs>',\n 'End timestamp for period. Default: \"now\"'\n )\n )\n .addOption(\n new Option(\n '-s, --search-string <ss>',\n 'Filter by a specific string (ANDed with transactionID filter)'\n )\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in ${config.getConfigPath()}/${\n config.FRODO_LOG_NOISEFILTER_FILENAME\n }`\n )\n )\n .action(async (host, user, password, options, command) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n const now = Date.now() / 1000;\n if (\n typeof options.beginTimestamp === 'undefined' ||\n !options.beginTimestamp\n ) {\n // no beginTimestamp value specified, default is 1 hour ago\n const tempStartDate = new Date();\n tempStartDate.setTime((now - SECONDS_IN_1_HOUR) * 1000);\n options.beginTimestamp = tempStartDate.toISOString();\n // also override endTimestamp to now\n const tempEndDate = new Date();\n tempEndDate.setTime(now * 1000);\n options.endTimestamp = tempEndDate;\n printMessage(\n 'No timestamps specified, defaulting to logs from 1 hour ago',\n 'info'\n );\n }\n if (typeof options.endTimestamp === 'undefined' || !options.endTimestamp) {\n // no endTimestamp value specified, default is now\n options.endTimestamp = now * 1000;\n printMessage(\n 'No end timestamp specified, defaulting end timestamp to \"now\"',\n 'info'\n );\n }\n let beginTs = Date.parse(options.beginTimestamp) / 1000;\n if (Date.parse(options.endTimestamp) / 1000 < beginTs) {\n printMessage('End timestamp can not be before begin timestamp', 'error');\n return;\n }\n if (now - beginTs > LOG_TIME_WINDOW_MAX) {\n printMessage(\n 'Begin timestamp can not be more than 30 days in the past',\n 'error'\n );\n return;\n }\n let intermediateEndTs = 0;\n printMessage(\n `Fetching ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}]...`\n );\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n\n do {\n intermediateEndTs = beginTs + LOG_TIME_WINDOW_INCREMENT;\n await fetchLogs(\n command.opts().sources,\n new Date(beginTs * 1000).toISOString(),\n new Date(intermediateEndTs * 1000).toISOString(),\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n command.opts().searchString,\n null,\n config.getNoiseFilters(options.defaults)\n );\n beginTs = intermediateEndTs;\n } while (intermediateEndTs < Date.parse(options.endTimestamp) / 1000);\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,WAAW;AAC3C,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,MAAM,MAAM,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC,cAAc;EAAEC,SAAS;EAAEC;AAAa,CAAC,GAAGP,GAAG;AACvD,MAAM;EAAEQ,oBAAoB;EAAEC;AAAsB,CAAC,GAAGV,iBAAiB;AACzE,MAAM;EAAEW;AAAU,CAAC,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E,CAACG,aAAa,EAC5BxC,OAAO,CAACqC,IAAI,EAAE,CAACI,YAAY,EAC3B,IAAI,EACJ3E,MAAM,CAAC4E,eAAe,CAAC3C,OAAO,CAAC4C,QAAQ,CAAC,CACzC;IACDT,OAAO,GAAGE,iBAAiB;EAC7B,CAAC,QAAQA,iBAAiB,GAAGT,IAAI,CAACQ,KAAK,CAACpC,OAAO,CAACkC,YAAY,CAAC,GAAG,IAAI;AACtE,CAAC,CAAC;AAEJvD,OAAO,CAACyD,KAAK,EAAE"}
|
|
1
|
+
{"version":3,"file":"logs-fetch.js","names":["Command","Option","Authenticate","ConnectionProfile","Log","state","common","config","printMessage","provisionCreds","fetchLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","SECONDS_IN_30_DAYS","SECONDS_IN_1_HOUR","LOG_TIME_WINDOW_MAX","LOG_TIME_WINDOW_INCREMENT","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","verboseOption","debugOption","curlirizeOption","sourcesOptionM","default","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","credsFromParameters","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","now","Date","beginTimestamp","tempStartDate","setTime","toISOString","tempEndDate","endTimestamp","beginTs","parse","intermediateEndTs","opts","sources","level","transactionId","searchString","getNoiseFilters","defaults"],"sources":["cli/logging/logs-fetch.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, fetchLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst SECONDS_IN_30_DAYS = 2592000;\nconst SECONDS_IN_1_HOUR = 3600;\nconst LOG_TIME_WINDOW_MAX = SECONDS_IN_30_DAYS;\nconst LOG_TIME_WINDOW_INCREMENT = SECONDS_IN_1_HOUR;\n\nconst program = new Command('frodo logs fetch');\nprogram\n .description(\n 'Fetch Identity Cloud logs between a specified begin and end time period.\\\n WARNING: depending on filters and time period specified, this could take substantial time to complete.'\n )\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(common.sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option(\n '-b, --begin-timestamp <beginTs>',\n 'Begin timestamp for period (in ISO8601, example: \"2022-10-13T19:06:28Z\", or \"2022-09.30\". \\\nCannot be more than 30 days in the past. If not specified, logs from one hour ago are fetched \\\n(-e is ignored)'\n )\n )\n .addOption(\n new Option(\n '-e, --end-timestamp <endTs>',\n 'End timestamp for period. Default: \"now\"'\n )\n )\n .addOption(\n new Option(\n '-s, --search-string <ss>',\n 'Filter by a specific string (ANDed with transactionID filter)'\n )\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in $HOME/${config.FRODO_LOG_NOISEFILTER_FILENAME}`\n )\n )\n .action(async (host, user, password, options, command) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n const now = Date.now() / 1000;\n if (\n typeof options.beginTimestamp === 'undefined' ||\n !options.beginTimestamp\n ) {\n // no beginTimestamp value specified, default is 1 hour ago\n const tempStartDate = new Date();\n tempStartDate.setTime((now - SECONDS_IN_1_HOUR) * 1000);\n options.beginTimestamp = tempStartDate.toISOString();\n // also override endTimestamp to now\n const tempEndDate = new Date();\n tempEndDate.setTime(now * 1000);\n options.endTimestamp = tempEndDate;\n printMessage(\n 'No timestamps specified, defaulting to logs from 1 hour ago',\n 'info'\n );\n }\n if (typeof options.endTimestamp === 'undefined' || !options.endTimestamp) {\n // no endTimestamp value specified, default is now\n options.endTimestamp = now * 1000;\n printMessage(\n 'No end timestamp specified, defaulting end timestamp to \"now\"',\n 'info'\n );\n }\n let beginTs = Date.parse(options.beginTimestamp) / 1000;\n if (Date.parse(options.endTimestamp) / 1000 < beginTs) {\n printMessage('End timestamp can not be before begin timestamp', 'error');\n return;\n }\n if (now - beginTs > LOG_TIME_WINDOW_MAX) {\n printMessage(\n 'Begin timestamp can not be more than 30 days in the past',\n 'error'\n );\n return;\n }\n let intermediateEndTs = 0;\n printMessage(\n `Fetching ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}]...`\n );\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n\n do {\n intermediateEndTs = beginTs + LOG_TIME_WINDOW_INCREMENT;\n await fetchLogs(\n command.opts().sources,\n new Date(beginTs * 1000).toISOString(),\n new Date(intermediateEndTs * 1000).toISOString(),\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n command.opts().searchString,\n null,\n config.getNoiseFilters(options.defaults)\n );\n beginTs = intermediateEndTs;\n } while (intermediateEndTs < Date.parse(options.endTimestamp) / 1000);\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,WAAW;AAC3C,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,MAAM,MAAM,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC,cAAc;EAAEC,SAAS;EAAEC;AAAa,CAAC,GAAGP,GAAG;AACvD,MAAM;EAAEQ,oBAAoB;EAAEC;AAAsB,CAAC,GAAGV,iBAAiB;AACzE,MAAM;EAAEW;AAAU,CAAC,GAAGZ,YAAY;AAElC,MAAMa,kBAAkB,GAAG,OAAO;AAClC,MAAMC,iBAAiB,GAAG,IAAI;AAC9B,MAAMC,mBAAmB,GAAGF,kBAAkB;AAC9C,MAAMG,yBAAyB,GAAGF,iBAAiB;AAEnD,MAAMG,OAAO,GAAG,IAAInB,OAAO,CAAC,kBAAkB,CAAC;AAC/CmB,OAAO,CACJC,WAAW,CACV;AACJ,wGAAwG,CACrG,CACAC,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CAChCC,kBAAkB,EAAE,CACpBC,WAAW,CAACjB,MAAM,CAACkB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|
20
20
|
Following values are possible (values on the same line are equivalent): \
|
|
21
21
|
\n0, SEVERE, FATAL, or ERROR\n1, WARNING, WARN or CONFIG\
|
|
22
22
|
\n2, INFO or INFORMATION\n3, DEBUG, FINE, FINER or FINEST\
|
|
23
|
-
\n4 or ALL').default('ERROR', `${resolveLevel('ERROR')}`)).addOption(new Option('-t, --transaction-id <txid>', 'Filter by transactionId')).addOption(new Option('-d, --defaults', 'Use default logging noise filters').default(false, `Use custom logging noise filters defined in $
|
|
23
|
+
\n4 or ALL').default('ERROR', `${resolveLevel('ERROR')}`)).addOption(new Option('-t, --transaction-id <txid>', 'Filter by transactionId')).addOption(new Option('-d, --defaults', 'Use default logging noise filters').default(false, `Use custom logging noise filters defined in $HOME/${config.FRODO_LOG_NOISEFILTER_FILENAME}`)).action(async (host, user, password, options, command) => {
|
|
24
24
|
let credsFromParameters = true;
|
|
25
25
|
state.default.session.setTenant(host);
|
|
26
26
|
state.default.session.setUsername(user);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-tail.js","names":["Command","Option","Authenticate","ConnectionProfile","Log","state","common","config","printMessage","provisionCreds","tailLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","verboseOption","debugOption","curlirizeOption","sourcesOptionM","default","
|
|
1
|
+
{"version":3,"file":"logs-tail.js","names":["Command","Option","Authenticate","ConnectionProfile","Log","state","common","config","printMessage","provisionCreds","tailLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","verboseOption","debugOption","curlirizeOption","sourcesOptionM","default","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","credsFromParameters","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","opts","sources","level","transactionId","getNoiseFilters","defaults","parse"],"sources":["cli/logging/logs-tail.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, tailLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo logs tail');\nprogram\n .description('Tail Identity Cloud logs.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(common.sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in $HOME/${config.FRODO_LOG_NOISEFILTER_FILENAME}`\n )\n )\n .action(async (host, user, password, options, command) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n printMessage(\n `Tailing ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}]...`\n );\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n await tailLogs(\n command.opts().sources,\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n null,\n config.getNoiseFilters(options.defaults)\n );\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,WAAW;AAC3C,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,MAAM,MAAM,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC,cAAc;EAAEC,QAAQ;EAAEC;AAAa,CAAC,GAAGP,GAAG;AACtD,MAAM;EAAEQ,oBAAoB;EAAEC;AAAsB,CAAC,GAAGV,iBAAiB;AACzE,MAAM;EAAEW;AAAU,CAAC,GAAGZ,YAAY;AAElC,MAAMa,OAAO,GAAG,IAAIf,OAAO,CAAC,iBAAiB,CAAC;AAC9Ce,OAAO,CACJC,WAAW,CAAC,2BAA2B,CAAC,CACxCC,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CA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,KAAK,CAACwB,OAAO,CAACS,OAAO,CAACgB,YAAY,CAACK,KAAK,CAACC,UAAU,CAAC;MACpDvD,KAAK,CAACwB,OAAO,CAACS,OAAO,CAACiB,eAAe,CAACI,KAAK,CAACE,cAAc,CAAC;IAC7D;EACF;EACArD,YAAY,CACT,qDACC4B,OAAO,CAAC0B,IAAI,EAAE,CAACC,OAChB,gBAAepD,YAAY,CAACyB,OAAO,CAAC0B,IAAI,EAAE,CAACE,KAAK,CAAE,MAAK,CACzD;EACD,IAAI3B,mBAAmB,EAAE,MAAMxB,qBAAqB,EAAE,CAAC,CAAC;EACxD,MAAMH,QAAQ,CACZ0B,OAAO,CAAC0B,IAAI,EAAE,CAACC,OAAO,EACtBpD,YAAY,CAACyB,OAAO,CAAC0B,IAAI,EAAE,CAACE,KAAK,CAAC,EAClC5B,OAAO,CAAC0B,IAAI,EAAE,CAACG,aAAa,EAC5B,IAAI,EACJ1D,MAAM,CAAC2D,eAAe,CAAC/B,OAAO,CAACgC,QAAQ,CAAC,CACzC;AACH,CAAC,CAAC;AAEJpD,OAAO,CAACqD,KAAK,EAAE"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/* eslint-disable no-await-in-loop */
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import fse from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import propertiesReader from 'properties-reader';
|
|
6
|
+
import replaceall from 'replaceall';
|
|
7
|
+
import { Idm, Utils, ValidationUtils } from '@rockcarver/frodo-lib';
|
|
8
|
+
import { createProgressIndicator, printMessage, stopProgressIndicator } from '../utils/Console';
|
|
9
|
+
import { getTypedFilename } from '../utils/ExportImportUtils';
|
|
10
|
+
const {
|
|
11
|
+
readFiles,
|
|
12
|
+
unSubstituteEnvParams
|
|
13
|
+
} = Utils;
|
|
14
|
+
const {
|
|
15
|
+
validateScriptHooks
|
|
16
|
+
} = ValidationUtils;
|
|
17
|
+
const {
|
|
18
|
+
getAllConfigEntities,
|
|
19
|
+
getConfigEntity,
|
|
20
|
+
putConfigEntity,
|
|
21
|
+
queryAllManagedObjectsByType
|
|
22
|
+
} = Idm;
|
|
23
|
+
/**
|
|
24
|
+
* List all IDM configuration objects
|
|
25
|
+
*/
|
|
26
|
+
export async function listAllConfigEntities() {
|
|
27
|
+
try {
|
|
28
|
+
const {
|
|
29
|
+
configurations
|
|
30
|
+
} = await getAllConfigEntities();
|
|
31
|
+
for (const configEntity of configurations) {
|
|
32
|
+
printMessage(`${configEntity._id}`, 'data');
|
|
33
|
+
}
|
|
34
|
+
} catch (getAllConfigEntitiesError) {
|
|
35
|
+
printMessage(getAllConfigEntitiesError, 'error');
|
|
36
|
+
printMessage(`Error getting config entities: ${getAllConfigEntitiesError}`, 'error');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Export an IDM configuration object.
|
|
42
|
+
* @param {String} id the desired configuration object
|
|
43
|
+
* @param {String} file optional export file
|
|
44
|
+
*/
|
|
45
|
+
export async function exportConfigEntity(id, file) {
|
|
46
|
+
let fileName = file;
|
|
47
|
+
if (!fileName) {
|
|
48
|
+
fileName = getTypedFilename(`${id}`, 'idm');
|
|
49
|
+
}
|
|
50
|
+
const configEntity = await getConfigEntity(id);
|
|
51
|
+
fs.writeFile(fileName, JSON.stringify(configEntity, null, 2), err => {
|
|
52
|
+
if (err) {
|
|
53
|
+
return printMessage(`ERROR - can't save ${id} export to file`, 'error');
|
|
54
|
+
}
|
|
55
|
+
return '';
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Export all IDM configuration objects into separate JSON files in a directory specified by <directory>
|
|
61
|
+
* @param {String} directory export directory
|
|
62
|
+
*/
|
|
63
|
+
export async function exportAllRawConfigEntities(directory) {
|
|
64
|
+
try {
|
|
65
|
+
const {
|
|
66
|
+
configurations
|
|
67
|
+
} = await getAllConfigEntities();
|
|
68
|
+
if (!fs.existsSync(directory)) {
|
|
69
|
+
fs.mkdirSync(directory);
|
|
70
|
+
}
|
|
71
|
+
createProgressIndicator('indeterminate', undefined, 'Exporting config objects...');
|
|
72
|
+
const entityPromises = [];
|
|
73
|
+
for (const configEntity of configurations) {
|
|
74
|
+
entityPromises.push(getConfigEntity(configEntity._id).catch(getConfigEntityError => {
|
|
75
|
+
var _getConfigEntityError, _getConfigEntityError2, _getConfigEntityError3, _getConfigEntityError4, _getConfigEntityError5, _getConfigEntityError6;
|
|
76
|
+
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.') &&
|
|
77
|
+
// https://bugster.forgerock.org/jira/browse/OPENIDM-18270
|
|
78
|
+
!(((_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.message) === 'No configuration exists for id org.apache.felix.fileinstall/openidm')) {
|
|
79
|
+
var _getConfigEntityError7;
|
|
80
|
+
printMessage((_getConfigEntityError7 = getConfigEntityError.response) === null || _getConfigEntityError7 === void 0 ? void 0 : _getConfigEntityError7.data, 'error');
|
|
81
|
+
printMessage(`Error getting config entity ${configEntity._id}: ${getConfigEntityError}`, 'error');
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
const results = await Promise.all(entityPromises);
|
|
86
|
+
for (const item of results) {
|
|
87
|
+
if (item != null) {
|
|
88
|
+
fse.outputFile(`${directory}/${item._id}.json`, JSON.stringify(item, null, 2), err => {
|
|
89
|
+
if (err) {
|
|
90
|
+
return printMessage(`ERROR - can't save config ${item._id} to file - ${err}`, 'error');
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
stopProgressIndicator('Exported config objects.', 'success');
|
|
96
|
+
} catch (getAllConfigEntitiesError) {
|
|
97
|
+
printMessage(getAllConfigEntitiesError, 'error');
|
|
98
|
+
printMessage(`Error getting config entities: ${getAllConfigEntitiesError}`, 'error');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Export all IDM configuration objects
|
|
104
|
+
* @param {String} directory export directory
|
|
105
|
+
* @param {String} entitiesFile JSON file that specifies the config entities to export/import
|
|
106
|
+
* @param {String} envFile File that defines environment specific variables for replacement during configuration export/import
|
|
107
|
+
*/
|
|
108
|
+
export async function exportAllConfigEntities(directory, entitiesFile, envFile) {
|
|
109
|
+
let entriesToExport = [];
|
|
110
|
+
// read list of entities to export
|
|
111
|
+
fs.readFile(entitiesFile, 'utf8', async (err, data) => {
|
|
112
|
+
if (err) throw err;
|
|
113
|
+
const entriesData = JSON.parse(data);
|
|
114
|
+
entriesToExport = entriesData.idm;
|
|
115
|
+
// console.log(`entriesToExport ${entriesToExport}`);
|
|
116
|
+
|
|
117
|
+
// read list of configs to parameterize for environment specific values
|
|
118
|
+
const envParams = propertiesReader(envFile);
|
|
119
|
+
try {
|
|
120
|
+
const {
|
|
121
|
+
configurations
|
|
122
|
+
} = await getAllConfigEntities();
|
|
123
|
+
// create export directory if not exist
|
|
124
|
+
if (!fs.existsSync(directory)) {
|
|
125
|
+
fs.mkdirSync(directory);
|
|
126
|
+
}
|
|
127
|
+
createProgressIndicator('indeterminate', undefined, 'Exporting config objects...');
|
|
128
|
+
const entityPromises = [];
|
|
129
|
+
for (const configEntity of configurations) {
|
|
130
|
+
if (entriesToExport.includes(configEntity._id)) {
|
|
131
|
+
entityPromises.push(getConfigEntity(configEntity._id));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const results = await Promise.all(entityPromises);
|
|
135
|
+
for (const item of results) {
|
|
136
|
+
if (item != null) {
|
|
137
|
+
let configEntityString = JSON.stringify(item, null, 2);
|
|
138
|
+
envParams.each((key, value) => {
|
|
139
|
+
configEntityString = replaceall(value, `\${${key}}`, configEntityString);
|
|
140
|
+
});
|
|
141
|
+
fse.outputFile(`${directory}/${item._id}.json`, configEntityString, error => {
|
|
142
|
+
if (err) {
|
|
143
|
+
return printMessage(`ERROR - can't save config ${item._id} to file - ${error}`, 'error');
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
stopProgressIndicator(null, 'success');
|
|
149
|
+
} catch (getAllConfigEntitiesError) {
|
|
150
|
+
printMessage(getAllConfigEntitiesError, 'error');
|
|
151
|
+
printMessage(`Error getting config entities: ${getAllConfigEntitiesError}`, 'error');
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Import an IDM configuration object.
|
|
158
|
+
* @param entityId the configuration object to import
|
|
159
|
+
* @param file optional file to import
|
|
160
|
+
*/
|
|
161
|
+
export async function importConfigEntity(entityId, file, validate) {
|
|
162
|
+
if (!file) {
|
|
163
|
+
file = getTypedFilename(entityId, 'idm');
|
|
164
|
+
}
|
|
165
|
+
const entityData = fs.readFileSync(path.resolve(process.cwd(), file), 'utf8');
|
|
166
|
+
const jsObject = JSON.parse(entityData);
|
|
167
|
+
const isValid = validateScriptHooks(jsObject);
|
|
168
|
+
if (validate && !isValid) {
|
|
169
|
+
printMessage('Invalid IDM configuration object', 'error');
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
await putConfigEntity(entityId, entityData);
|
|
174
|
+
} catch (putConfigEntityError) {
|
|
175
|
+
printMessage(putConfigEntityError, 'error');
|
|
176
|
+
printMessage(`Error: ${putConfigEntityError}`, 'error');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Import all IDM configuration objects from separate JSON files in a directory specified by <directory>
|
|
182
|
+
* @param baseDirectory export directory
|
|
183
|
+
* @param validate validate script hooks
|
|
184
|
+
*/
|
|
185
|
+
export async function importAllRawConfigEntities(baseDirectory, validate) {
|
|
186
|
+
if (!fs.existsSync(baseDirectory)) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const files = await readFiles(baseDirectory);
|
|
190
|
+
const jsonFiles = files.filter(({
|
|
191
|
+
path
|
|
192
|
+
}) => path.toLowerCase().endsWith('.json')).map(({
|
|
193
|
+
path,
|
|
194
|
+
content
|
|
195
|
+
}) => ({
|
|
196
|
+
// Remove .json extension
|
|
197
|
+
entityId: path.substring(0, path.length - 5),
|
|
198
|
+
content,
|
|
199
|
+
path
|
|
200
|
+
}));
|
|
201
|
+
let everyScriptValid = true;
|
|
202
|
+
for (const file of jsonFiles) {
|
|
203
|
+
const jsObject = JSON.parse(file.content);
|
|
204
|
+
const isScriptValid = validateScriptHooks(jsObject);
|
|
205
|
+
if (!isScriptValid) {
|
|
206
|
+
printMessage(`Invalid script hook in ${file.path}`, 'error');
|
|
207
|
+
everyScriptValid = false;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (validate && !everyScriptValid) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
createProgressIndicator('indeterminate', undefined, 'Importing config objects...');
|
|
214
|
+
const entityPromises = jsonFiles.map(file => {
|
|
215
|
+
return putConfigEntity(file.entityId, file.content);
|
|
216
|
+
});
|
|
217
|
+
const results = await Promise.allSettled(entityPromises);
|
|
218
|
+
const errors = results.filter(result => result.status === 'rejected');
|
|
219
|
+
if (errors.length > 0) {
|
|
220
|
+
printMessage(`Failed to import ${errors.length} config objects:`, 'error');
|
|
221
|
+
for (const error of errors) {
|
|
222
|
+
printMessage(`- ${error.reason}`, 'error');
|
|
223
|
+
}
|
|
224
|
+
stopProgressIndicator(`Failed to import ${errors.length} config objects`, 'error');
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
stopProgressIndicator(`Imported ${results.length} config objects`, 'success');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Import all IDM configuration objects
|
|
232
|
+
* @param baseDirectory import directory
|
|
233
|
+
* @param entitiesFile JSON file that specifies the config entities to export/import
|
|
234
|
+
* @param envFile File that defines environment specific variables for replacement during configuration export/import
|
|
235
|
+
* @param validate validate script hooks
|
|
236
|
+
*/
|
|
237
|
+
export async function importAllConfigEntities(baseDirectory, entitiesFile, envFile, validate) {
|
|
238
|
+
if (!fs.existsSync(baseDirectory)) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
const entriesToImport = JSON.parse(fs.readFileSync(entitiesFile, 'utf8')).idm;
|
|
242
|
+
const envReader = propertiesReader(envFile);
|
|
243
|
+
const files = await readFiles(baseDirectory);
|
|
244
|
+
const jsonFiles = files.filter(({
|
|
245
|
+
path
|
|
246
|
+
}) => path.toLowerCase().endsWith('.json')).map(({
|
|
247
|
+
content,
|
|
248
|
+
path
|
|
249
|
+
}) => ({
|
|
250
|
+
// Remove .json extension
|
|
251
|
+
entityId: path.substring(0, path.length - 5),
|
|
252
|
+
content,
|
|
253
|
+
path
|
|
254
|
+
}));
|
|
255
|
+
let everyScriptValid = true;
|
|
256
|
+
for (const file of jsonFiles) {
|
|
257
|
+
const jsObject = JSON.parse(file.content);
|
|
258
|
+
const isScriptValid = validateScriptHooks(jsObject);
|
|
259
|
+
if (!isScriptValid) {
|
|
260
|
+
printMessage(`Invalid script hook in ${file.path}`, 'error');
|
|
261
|
+
everyScriptValid = false;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (validate && !everyScriptValid) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
createProgressIndicator('indeterminate', undefined, 'Importing config objects...');
|
|
268
|
+
const entityPromises = jsonFiles.filter(({
|
|
269
|
+
entityId
|
|
270
|
+
}) => {
|
|
271
|
+
return entriesToImport.includes(entityId);
|
|
272
|
+
}).map(({
|
|
273
|
+
entityId,
|
|
274
|
+
content
|
|
275
|
+
}) => {
|
|
276
|
+
const unsubstituted = unSubstituteEnvParams(content, envReader);
|
|
277
|
+
return putConfigEntity(entityId, unsubstituted);
|
|
278
|
+
});
|
|
279
|
+
const results = await Promise.allSettled(entityPromises);
|
|
280
|
+
const errors = results.filter(result => result.status === 'rejected');
|
|
281
|
+
if (errors.length > 0) {
|
|
282
|
+
printMessage(`Failed to import ${errors.length} config objects:`, 'error');
|
|
283
|
+
for (const error of errors) {
|
|
284
|
+
printMessage(`- ${error.reason}`, 'error');
|
|
285
|
+
}
|
|
286
|
+
stopProgressIndicator(`Failed to import ${errors.length} config objects`, 'error');
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
stopProgressIndicator(`Imported ${results.length} config objects`, 'success');
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Count number of managed objects of a given type
|
|
294
|
+
* @param {String} type managed object type, e.g. alpha_user
|
|
295
|
+
*/
|
|
296
|
+
export async function countManagedObjects(type) {
|
|
297
|
+
let count = 0;
|
|
298
|
+
let result = {
|
|
299
|
+
result: [],
|
|
300
|
+
resultCount: 0,
|
|
301
|
+
pagedResultsCookie: null,
|
|
302
|
+
totalPagedResultsPolicy: 'NONE',
|
|
303
|
+
totalPagedResults: -1,
|
|
304
|
+
remainingPagedResults: -1
|
|
305
|
+
};
|
|
306
|
+
try {
|
|
307
|
+
do {
|
|
308
|
+
result = await queryAllManagedObjectsByType(type, [], result.pagedResultsCookie);
|
|
309
|
+
count += result.resultCount;
|
|
310
|
+
} while (result.pagedResultsCookie);
|
|
311
|
+
printMessage(`${type}: ${count}`);
|
|
312
|
+
} catch (error) {
|
|
313
|
+
printMessage(error.response.data, 'error');
|
|
314
|
+
printMessage(`Error querying managed objects by type: ${error}`, 'error');
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=IdmOps.js.map
|
|
@@ -0,0 +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","listAllConfigEntities","configurations","configEntity","_id","getAllConfigEntitiesError","exportConfigEntity","id","file","fileName","writeFile","JSON","stringify","err","exportAllRawConfigEntities","directory","existsSync","mkdirSync","undefined","entityPromises","push","catch","getConfigEntityError","response","status","data","message","results","Promise","all","item","outputFile","exportAllConfigEntities","entitiesFile","envFile","entriesToExport","readFile","entriesData","parse","idm","envParams","includes","configEntityString","each","key","value","error","importConfigEntity","entityId","validate","entityData","readFileSync","resolve","process","cwd","jsObject","isValid","putConfigEntityError","importAllRawConfigEntities","baseDirectory","files","jsonFiles","filter","toLowerCase","endsWith","map","content","substring","length","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} = Idm;\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;AACF,CAAC,GAAGb,GAAG;AACP;AACA;AACA;AACA,OAAO,eAAec,qBAAqB,GAAG;EAC5C,IAAI;IACF,MAAM;MAAEC;IAAe,CAAC,GAAG,MAAML,oBAAoB,EAAE;IACvD,KAAK,MAAMM,YAAY,IAAID,cAAc,EAAE;MACzCX,YAAY,CAAE,GAAEY,YAAY,CAACC,GAAI,EAAC,EAAE,MAAM,CAAC;IAC7C;EACF,CAAC,CAAC,OAAOC,yBAAyB,EAAE;IAClCd,YAAY,CAACc,yBAAyB,EAAE,OAAO,CAAC;IAChDd,YAAY,CACT,kCAAiCc,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AE,OAAO,CAAC;EAC3E;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockcarver/frodo-cli",
|
|
3
|
-
"version": "0.18.2-
|
|
3
|
+
"version": "0.18.2-13",
|
|
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": [
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
]
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@rockcarver/frodo-lib": "0.16.2-
|
|
91
|
+
"@rockcarver/frodo-lib": "0.16.2-14",
|
|
92
92
|
"cli-progress": "^3.11.2",
|
|
93
93
|
"cli-table3": "^0.6.3",
|
|
94
94
|
"colors": "^1.4.0",
|
|
@@ -96,8 +96,10 @@
|
|
|
96
96
|
"compare-versions": "^5.0.1",
|
|
97
97
|
"lodash": "^4.17.21",
|
|
98
98
|
"nanospinner": "^1.1.0",
|
|
99
|
-
"
|
|
99
|
+
"properties-reader": "^2.2.0",
|
|
100
|
+
"replaceall": "^0.1.6",
|
|
100
101
|
"slugify": "^1.6.5",
|
|
102
|
+
"uuid": "^9.0.0",
|
|
101
103
|
"yesno": "^0.4.0"
|
|
102
104
|
},
|
|
103
105
|
"devDependencies": {
|