@rockcarver/frodo-cli 0.24.5 → 0.24.6-1
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 +39 -1
- package/esm/cli/admin/admin-federation-export.js +42 -0
- package/esm/cli/admin/admin-federation-export.js.map +1 -0
- package/esm/cli/admin/admin-federation-import.js +45 -0
- package/esm/cli/admin/admin-federation-import.js.map +1 -0
- package/esm/cli/admin/admin-federation-list.js +28 -0
- package/esm/cli/admin/admin-federation-list.js.map +1 -0
- package/esm/cli/admin/admin-federation.js +13 -0
- package/esm/cli/admin/admin-federation.js.map +1 -0
- package/esm/cli/admin/admin.js +1 -0
- package/esm/cli/admin/admin.js.map +1 -1
- package/esm/cli/conn/conn-save.js +4 -2
- package/esm/cli/conn/conn-save.js.map +1 -1
- package/esm/ops/AdminFederationOps.js +172 -0
- package/esm/ops/AdminFederationOps.js.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.24.6-1] - 2023-06-22
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- \#251: Support for Identity Cloud admin federation configuration:
|
|
15
|
+
|
|
16
|
+
- `frodo admin federation` Manage admin federation configuration.
|
|
17
|
+
- `export` Export admin federation providers.
|
|
18
|
+
- `import` Import admin federation providers.
|
|
19
|
+
- `list` List admin federation providers.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
|
|
23
|
+
- List all configured admin federation providers:<br>
|
|
24
|
+
`frodo admin federation list <myTenant>`
|
|
25
|
+
|
|
26
|
+
`frodo admin federation list <myTenant> <username> <password>`
|
|
27
|
+
- Export all admin federation providers to a single file:<br>
|
|
28
|
+
`frodo admin federation export -a <myTenant>`
|
|
29
|
+
|
|
30
|
+
`frodo admin federation export -a <myTenant> <username> <password>`
|
|
31
|
+
- Import all admin federation providers from a single file:<br>
|
|
32
|
+
`frodo admin federation import -a -f allProviders.admin.federation.json <myTenant>`
|
|
33
|
+
|
|
34
|
+
`frodo admin federation import -a -f allProviders.admin.federation.json <myTenant> <username> <password>`<br>
|
|
35
|
+
|
|
36
|
+
**_Note_**: Only tenant admins can perform admin federation operations, service accounts do not have the required privileges. Therefore, the connection profile used must contain username and password or they must be provided through command arguments.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- Update to frodo-lib 1.0.1-0
|
|
41
|
+
|
|
42
|
+
## [0.24.6-0] - 2023-06-21
|
|
43
|
+
|
|
10
44
|
## [0.24.5] - 2023-05-31
|
|
11
45
|
|
|
12
46
|
### Added
|
|
@@ -1200,7 +1234,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1200
1234
|
- Fixed problem with adding connection profiles
|
|
1201
1235
|
- Miscellaneous bug fixes
|
|
1202
1236
|
|
|
1203
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.
|
|
1237
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.6-1...HEAD
|
|
1238
|
+
|
|
1239
|
+
[0.24.6-1]: https://github.com/rockcarver/frodo-cli/compare/v0.24.6-0...v0.24.6-1
|
|
1240
|
+
|
|
1241
|
+
[0.24.6-0]: https://github.com/rockcarver/frodo-cli/compare/v0.24.5...v0.24.6-0
|
|
1204
1242
|
|
|
1205
1243
|
[0.24.5]: https://github.com/rockcarver/frodo-cli/compare/v0.24.4...v0.24.5
|
|
1206
1244
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FrodoCommand } from '../FrodoCommand';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { Authenticate } from '@rockcarver/frodo-lib';
|
|
4
|
+
import { printMessage, verboseMessage } from '../../utils/Console';
|
|
5
|
+
import { exportAdminFederationProviderToFile, exportAdminFederationProvidersToFile, exportAdminFederationProvidersToFiles } from '../../ops/AdminFederationOps';
|
|
6
|
+
const {
|
|
7
|
+
getTokens
|
|
8
|
+
} = Authenticate;
|
|
9
|
+
const program = new FrodoCommand('frodo admin federation export', ['realm']);
|
|
10
|
+
program.description('Export admin federation providers.').addOption(new Option('-i, --idp-id <idp-id>', 'Id/name of a provider. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file [file]', 'Name of the file to write the exported provider(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the providers to a single file. Ignored with -t and -i.')).addOption(new Option('-A, --all-separate', 'Export all the providers as separate files <provider name>.admin.federation.json. Ignored with -t, -i, and -a.')).action(
|
|
11
|
+
// implement command logic inside action handler
|
|
12
|
+
async (host, user, password, options, command) => {
|
|
13
|
+
command.handleDefaultArgsAndOpts(host, user, password, options, command);
|
|
14
|
+
if (await getTokens(true)) {
|
|
15
|
+
// export by id/name
|
|
16
|
+
if (options.idpId) {
|
|
17
|
+
verboseMessage(`Exporting provider "${options.idpId}...`);
|
|
18
|
+
exportAdminFederationProviderToFile(options.idpId, options.file);
|
|
19
|
+
}
|
|
20
|
+
// --all -a
|
|
21
|
+
else if (options.all) {
|
|
22
|
+
verboseMessage('Exporting all providers to a single file...');
|
|
23
|
+
exportAdminFederationProvidersToFile(options.file);
|
|
24
|
+
}
|
|
25
|
+
// --all-separate -A
|
|
26
|
+
else if (options.allSeparate) {
|
|
27
|
+
verboseMessage('Exporting all providers to separate files...');
|
|
28
|
+
exportAdminFederationProvidersToFiles();
|
|
29
|
+
}
|
|
30
|
+
// unrecognized combination of options or no options
|
|
31
|
+
else {
|
|
32
|
+
printMessage('Unrecognized combination of options or no options...', 'error');
|
|
33
|
+
program.help();
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// end command logic inside action handler
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
program.parse();
|
|
42
|
+
//# sourceMappingURL=admin-federation-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-federation-export.js","names":["FrodoCommand","Option","Authenticate","printMessage","verboseMessage","exportAdminFederationProviderToFile","exportAdminFederationProvidersToFile","exportAdminFederationProvidersToFiles","getTokens","program","description","addOption","action","host","user","password","options","command","handleDefaultArgsAndOpts","idpId","file","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/admin/admin-federation-export.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate } from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport {\n exportAdminFederationProviderToFile,\n exportAdminFederationProvidersToFile,\n exportAdminFederationProvidersToFiles,\n} from '../../ops/AdminFederationOps';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo admin federation export', ['realm']);\n\nprogram\n .description('Export admin federation providers.')\n .addOption(\n new Option(\n '-i, --idp-id <idp-id>',\n 'Id/name of a provider. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the file to write the exported provider(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the providers to a single file. Ignored with -t and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the providers as separate files <provider name>.admin.federation.json. Ignored with -t, -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n if (await getTokens(true)) {\n // export by id/name\n if (options.idpId) {\n verboseMessage(`Exporting provider \"${options.idpId}...`);\n exportAdminFederationProviderToFile(options.idpId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all providers to a single file...');\n exportAdminFederationProvidersToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all providers to separate files...');\n exportAdminFederationProvidersToFiles();\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 process.exitCode = 1;\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SACEC,mCAAmC,EACnCC,oCAAoC,EACpCC,qCAAqC,QAChC,8BAA8B;AAErC,MAAM;EAAEC;AAAU,CAAC,GAAGN,YAAY;AAElC,MAAMO,OAAO,GAAG,IAAIT,YAAY,CAAC,+BAA+B,EAAE,CAAC,OAAO,CAAC,CAAC;AAE5ES,OAAO,CACJC,WAAW,CAAC,oCAAoC,CAAC,CACjDC,SAAS,CACR,IAAIV,MAAM,CACR,uBAAuB,EACvB,6DACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,mBAAmB,EACnB,yEACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,WAAW,EACX,oEACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,oBAAoB,EACpB,gHACF,CACF,CAAC,CACAW,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EAChDA,OAAO,CAACC,wBAAwB,CAACL,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,CAAC;EACxE,IAAI,MAAMT,SAAS,CAAC,IAAI,CAAC,EAAE;IACzB;IACA,IAAIQ,OAAO,CAACG,KAAK,EAAE;MACjBf,cAAc,CAAE,uBAAsBY,OAAO,CAACG,KAAM,KAAI,CAAC;MACzDd,mCAAmC,CAACW,OAAO,CAACG,KAAK,EAAEH,OAAO,CAACI,IAAI,CAAC;IAClE;IACA;IAAA,KACK,IAAIJ,OAAO,CAACK,GAAG,EAAE;MACpBjB,cAAc,CAAC,6CAA6C,CAAC;MAC7DE,oCAAoC,CAACU,OAAO,CAACI,IAAI,CAAC;IACpD;IACA;IAAA,KACK,IAAIJ,OAAO,CAACM,WAAW,EAAE;MAC5BlB,cAAc,CAAC,8CAA8C,CAAC;MAC9DG,qCAAqC,CAAC,CAAC;IACzC;IACA;IAAA,KACK;MACHJ,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;MACDM,OAAO,CAACc,IAAI,CAAC,CAAC;MACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF;AACF;AACA;AACF,CAAC;;AAEHhB,OAAO,CAACiB,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { FrodoCommand } from '../FrodoCommand';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
4
|
+
import { printMessage, verboseMessage } from '../../utils/Console';
|
|
5
|
+
import { importAdminFederationProviderFromFile, importAdminFederationProvidersFromFile, importAdminFederationProvidersFromFiles, importFirstAdminFederationProviderFromFile } from '../../ops/AdminFederationOps';
|
|
6
|
+
const {
|
|
7
|
+
getTokens
|
|
8
|
+
} = Authenticate;
|
|
9
|
+
const program = new FrodoCommand('frodo admin federation import', ['realm']);
|
|
10
|
+
program.description('Import admin federation providers.').addOption(new Option('-i, --idp-id <id>', 'Provider id. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to import the provider(s) from.')).addOption(new Option('-a, --all', 'Import all the providers from single file. Ignored with -t or -i.')).addOption(new Option('-A, --all-separate', 'Import all the providers from separate files (*.admin.federation.json) in the current directory. Ignored with -t or -i or -a.')).action(
|
|
11
|
+
// implement command logic inside action handler
|
|
12
|
+
async (host, user, password, options, command) => {
|
|
13
|
+
command.handleDefaultArgsAndOpts(host, user, password, options, command);
|
|
14
|
+
// import by id
|
|
15
|
+
if (options.file && options.idpId && (await getTokens(true))) {
|
|
16
|
+
verboseMessage(`Importing provider "${options.idpId}" into realm "${state.getRealm()}"...`);
|
|
17
|
+
importAdminFederationProviderFromFile(options.idpId, options.file);
|
|
18
|
+
}
|
|
19
|
+
// --all -a
|
|
20
|
+
else if (options.all && options.file && (await getTokens(true))) {
|
|
21
|
+
verboseMessage(`Importing all providers from a single file (${options.file})...`);
|
|
22
|
+
importAdminFederationProvidersFromFile(options.file);
|
|
23
|
+
}
|
|
24
|
+
// --all-separate -A
|
|
25
|
+
else if (options.allSeparate && !options.file && (await getTokens(true))) {
|
|
26
|
+
verboseMessage('Importing all providers from separate files in current directory...');
|
|
27
|
+
importAdminFederationProvidersFromFiles();
|
|
28
|
+
}
|
|
29
|
+
// import first provider from file
|
|
30
|
+
else if (options.file && (await getTokens(true))) {
|
|
31
|
+
verboseMessage(`Importing first provider from file "${options.file}" into realm "${state.getRealm()}"...`);
|
|
32
|
+
importFirstAdminFederationProviderFromFile(options.file);
|
|
33
|
+
}
|
|
34
|
+
// unrecognized combination of options or no options
|
|
35
|
+
else {
|
|
36
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
37
|
+
program.help();
|
|
38
|
+
process.exitCode = 1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// end command logic inside action handler
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
program.parse();
|
|
45
|
+
//# sourceMappingURL=admin-federation-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-federation-import.js","names":["FrodoCommand","Option","Authenticate","state","printMessage","verboseMessage","importAdminFederationProviderFromFile","importAdminFederationProvidersFromFile","importAdminFederationProvidersFromFiles","importFirstAdminFederationProviderFromFile","getTokens","program","description","addOption","action","host","user","password","options","command","handleDefaultArgsAndOpts","file","idpId","getRealm","all","allSeparate","help","process","exitCode","parse"],"sources":["cli/admin/admin-federation-import.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport {\n importAdminFederationProviderFromFile,\n importAdminFederationProvidersFromFile,\n importAdminFederationProvidersFromFiles,\n importFirstAdminFederationProviderFromFile,\n} from '../../ops/AdminFederationOps';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo admin federation import', ['realm']);\n\nprogram\n .description('Import admin federation providers.')\n .addOption(\n new Option(\n '-i, --idp-id <id>',\n 'Provider id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import the provider(s) from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the providers from single file. Ignored with -t or -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the providers from separate files (*.admin.federation.json) in the current directory. Ignored with -t or -i or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n // import by id\n if (options.file && options.idpId && (await getTokens(true))) {\n verboseMessage(\n `Importing provider \"${\n options.idpId\n }\" into realm \"${state.getRealm()}\"...`\n );\n importAdminFederationProviderFromFile(options.idpId, options.file);\n }\n // --all -a\n else if (options.all && options.file && (await getTokens(true))) {\n verboseMessage(\n `Importing all providers from a single file (${options.file})...`\n );\n importAdminFederationProvidersFromFile(options.file);\n }\n // --all-separate -A\n else if (\n options.allSeparate &&\n !options.file &&\n (await getTokens(true))\n ) {\n verboseMessage(\n 'Importing all providers from separate files in current directory...'\n );\n importAdminFederationProvidersFromFiles();\n }\n // import first provider from file\n else if (options.file && (await getTokens(true))) {\n verboseMessage(\n `Importing first provider from file \"${\n options.file\n }\" into realm \"${state.getRealm()}\"...`\n );\n importFirstAdminFederationProviderFromFile(options.file);\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1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K,IAAIH,OAAO,CAACM,GAAG,IAAIN,OAAO,CAACG,IAAI,KAAK,MAAMX,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE;IAC/DL,cAAc,CACX,+CAA8Ca,OAAO,CAACG,IAAK,MAC9D,CAAC;IACDd,sCAAsC,CAACW,OAAO,CAACG,IAAI,CAAC;EACtD;EACA;EAAA,KACK,IACHH,OAAO,CAACO,WAAW,IACnB,CAACP,OAAO,CAACG,IAAI,KACZ,MAAMX,SAAS,CAAC,IAAI,CAAC,CAAC,EACvB;IACAL,cAAc,CACZ,qEACF,CAAC;IACDG,uCAAuC,CAAC,CAAC;EAC3C;EACA;EAAA,KACK,IAAIU,OAAO,CAACG,IAAI,KAAK,MAAMX,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE;IAChDL,cAAc,CACX,uCACCa,OAAO,CAACG,IACT,iBAAgBlB,KAAK,CAACoB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACDd,0CAA0C,CAACS,OAAO,CAACG,IAAI,CAAC;EAC1D;EACA;EAAA,KACK;IACHjB,YAAY,CAAC,sDAAsD,CAAC;IACpEO,OAAO,CAACe,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHjB,OAAO,CAACkB,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FrodoCommand } from '../FrodoCommand';
|
|
2
|
+
import { Authenticate } from '@rockcarver/frodo-lib';
|
|
3
|
+
import { verboseMessage } from '../../utils/Console';
|
|
4
|
+
import { listAdminFederationProviders } from '../../ops/AdminFederationOps';
|
|
5
|
+
const {
|
|
6
|
+
getTokens
|
|
7
|
+
} = Authenticate;
|
|
8
|
+
const program = new FrodoCommand('frodo admin federation list', ['realm']);
|
|
9
|
+
program.description('List admin federation providers.')
|
|
10
|
+
// .addOption(
|
|
11
|
+
// new Option('-l, --long', 'Long with all fields.').default(false, 'false')
|
|
12
|
+
// )
|
|
13
|
+
.action(
|
|
14
|
+
// implement command logic inside action handler
|
|
15
|
+
async (host, user, password, options, command) => {
|
|
16
|
+
command.handleDefaultArgsAndOpts(host, user, password, options, command);
|
|
17
|
+
if (await getTokens(true)) {
|
|
18
|
+
verboseMessage(`Listing admin federation providers...`);
|
|
19
|
+
listAdminFederationProviders();
|
|
20
|
+
} else {
|
|
21
|
+
process.exitCode = 1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// end command logic inside action handler
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
program.parse();
|
|
28
|
+
//# sourceMappingURL=admin-federation-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-federation-list.js","names":["FrodoCommand","Authenticate","verboseMessage","listAdminFederationProviders","getTokens","program","description","action","host","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["cli/admin/admin-federation-list.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Authenticate } from '@rockcarver/frodo-lib';\nimport { verboseMessage } from '../../utils/Console';\nimport { listAdminFederationProviders } from '../../ops/AdminFederationOps';\n\nconst { getTokens } = Authenticate;\n\nconst program = new FrodoCommand('frodo admin federation list', ['realm']);\n\nprogram\n .description('List admin federation providers.')\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, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n if (await getTokens(true)) {\n verboseMessage(`Listing admin federation providers...`);\n listAdminFederationProviders();\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,4BAA4B,QAAQ,8BAA8B;AAE3E,MAAM;EAAEC;AAAU,CAAC,GAAGH,YAAY;AAElC,MAAMI,OAAO,GAAG,IAAIL,YAAY,CAAC,6BAA6B,EAAE,CAAC,OAAO,CAAC,CAAC;AAE1EK,OAAO,CACJC,WAAW,CAAC,kCAAkC;AAC/C;AACA;AACA;AAAA,CACCC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EAChDA,OAAO,CAACC,wBAAwB,CAACL,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,CAAC;EACxE,IAAI,MAAMR,SAAS,CAAC,IAAI,CAAC,EAAE;IACzBF,cAAc,CAAE,uCAAsC,CAAC;IACvDC,4BAA4B,CAAC,CAAC;EAChC,CAAC,MAAM;IACLW,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHV,OAAO,CAACW,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FrodoStubCommand } from '../FrodoCommand';
|
|
2
|
+
const program = new FrodoStubCommand('frodo admin federation');
|
|
3
|
+
program.description('Manages admin federation configuration.');
|
|
4
|
+
|
|
5
|
+
// program.command('delete', 'Delete admin federation provider.');
|
|
6
|
+
|
|
7
|
+
// program.command('describe', 'Describe admin federation provider.');
|
|
8
|
+
|
|
9
|
+
program.command('export', 'Export admin federation providers.');
|
|
10
|
+
program.command('import', 'Import admin federation providers.');
|
|
11
|
+
program.command('list', 'List admin federation providers.');
|
|
12
|
+
program.parse();
|
|
13
|
+
//# sourceMappingURL=admin-federation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-federation.js","names":["FrodoStubCommand","program","description","command","parse"],"sources":["cli/admin/admin-federation.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\n\nconst program = new FrodoStubCommand('frodo admin federation');\n\nprogram.description('Manages admin federation configuration.');\n\n// program.command('delete', 'Delete admin federation provider.');\n\n// program.command('describe', 'Describe admin federation provider.');\n\nprogram.command('export', 'Export admin federation providers.');\n\nprogram.command('import', 'Import admin federation providers.');\n\nprogram.command('list', 'List admin federation providers.');\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAElD,MAAMC,OAAO,GAAG,IAAID,gBAAgB,CAAC,wBAAwB,CAAC;AAE9DC,OAAO,CAACC,WAAW,CAAC,yCAAyC,CAAC;;AAE9D;;AAEA;;AAEAD,OAAO,CAACE,OAAO,CAAC,QAAQ,EAAE,oCAAoC,CAAC;AAE/DF,OAAO,CAACE,OAAO,CAAC,QAAQ,EAAE,oCAAoC,CAAC;AAE/DF,OAAO,CAACE,OAAO,CAAC,MAAM,EAAE,kCAAkC,CAAC;AAE3DF,OAAO,CAACG,KAAK,CAAC,CAAC"}
|
package/esm/cli/admin/admin.js
CHANGED
|
@@ -4,6 +4,7 @@ import { fileURLToPath } from 'url';
|
|
|
4
4
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
5
|
export default function setup() {
|
|
6
6
|
const program = new FrodoStubCommand('admin').description('Platform admin tasks.').executableDir(__dirname);
|
|
7
|
+
program.command('federation', 'Manage admin federation configuration.');
|
|
7
8
|
program.command('create-oauth2-client-with-admin-privileges', 'Create an oauth2 client with admin privileges.');
|
|
8
9
|
program.command('get-access-token', 'Get an access token using client credentials grant type.');
|
|
9
10
|
program.command('list-oauth2-clients-with-admin-privileges', 'List oauth2 clients with admin privileges.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","names":["FrodoStubCommand","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["cli/admin/admin.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('admin')\n .description('Platform admin tasks.')\n .executableDir(__dirname);\n\n program.command(\n 'create-oauth2-client-with-admin-privileges',\n 'Create an oauth2 client with admin privileges.'\n );\n\n program.command(\n 'get-access-token',\n 'Get an access token using client credentials grant type.'\n );\n\n program.command(\n 'list-oauth2-clients-with-admin-privileges',\n 'List oauth2 clients with admin privileges.'\n );\n\n program.command(\n 'grant-oauth2-client-admin-privileges',\n 'Grant an oauth2 client admin privileges.'\n );\n\n program.command(\n 'revoke-oauth2-client-admin-privileges',\n 'Revoke admin privileges from an oauth2 client.'\n );\n\n program.command(\n 'list-oauth2-clients-with-custom-privileges',\n 'List oauth2 clients with custom privileges.'\n );\n\n program.command(\n 'list-static-user-mappings',\n 'List all subjects of static user mappings that are not oauth2 clients.'\n );\n\n program.command(\n 'remove-static-user-mapping',\n \"Remove a subject's static user mapping.\"\n );\n\n program.command(\n 'add-autoid-static-user-mapping',\n 'Add AutoId static user mapping to enable dashboards and other AutoId-based functionality.'\n );\n\n program.command(\n 'hide-generic-extension-attributes',\n 'Hide generic extension attributes.'\n );\n\n program.command(\n 'show-generic-extension-attributes',\n 'Show generic extension attributes.'\n );\n\n program.command('repair-org-model', 'Repair org model.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIT,gBAAgB,CAAC,OAAO,CAAC,CAC1CU,WAAW,CAAC,uBAAuB,CAAC,CACpCC,aAAa,CAACR,SAAS,CAAC;EAE3BM,OAAO,CAACG,OAAO,CACb,4CAA4C,EAC5C,gDACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,kBAAkB,EAClB,0DACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,2CAA2C,EAC3C,4CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,sCAAsC,EACtC,0CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,uCAAuC,EACvC,gDACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,4CAA4C,EAC5C,6CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,2BAA2B,EAC3B,wEACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,4BAA4B,EAC5B,yCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,gCAAgC,EAChC,2FACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,mCAAmC,EACnC,oCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,mCAAmC,EACnC,oCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;EAExD,OAAOH,OAAO;AAChB"}
|
|
1
|
+
{"version":3,"file":"admin.js","names":["FrodoStubCommand","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["cli/admin/admin.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('admin')\n .description('Platform admin tasks.')\n .executableDir(__dirname);\n\n program.command('federation', 'Manage admin federation configuration.');\n\n program.command(\n 'create-oauth2-client-with-admin-privileges',\n 'Create an oauth2 client with admin privileges.'\n );\n\n program.command(\n 'get-access-token',\n 'Get an access token using client credentials grant type.'\n );\n\n program.command(\n 'list-oauth2-clients-with-admin-privileges',\n 'List oauth2 clients with admin privileges.'\n );\n\n program.command(\n 'grant-oauth2-client-admin-privileges',\n 'Grant an oauth2 client admin privileges.'\n );\n\n program.command(\n 'revoke-oauth2-client-admin-privileges',\n 'Revoke admin privileges from an oauth2 client.'\n );\n\n program.command(\n 'list-oauth2-clients-with-custom-privileges',\n 'List oauth2 clients with custom privileges.'\n );\n\n program.command(\n 'list-static-user-mappings',\n 'List all subjects of static user mappings that are not oauth2 clients.'\n );\n\n program.command(\n 'remove-static-user-mapping',\n \"Remove a subject's static user mapping.\"\n );\n\n program.command(\n 'add-autoid-static-user-mapping',\n 'Add AutoId static user mapping to enable dashboards and other AutoId-based functionality.'\n );\n\n program.command(\n 'hide-generic-extension-attributes',\n 'Hide generic extension attributes.'\n );\n\n program.command(\n 'show-generic-extension-attributes',\n 'Show generic extension attributes.'\n );\n\n program.command('repair-org-model', 'Repair org model.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIT,gBAAgB,CAAC,OAAO,CAAC,CAC1CU,WAAW,CAAC,uBAAuB,CAAC,CACpCC,aAAa,CAACR,SAAS,CAAC;EAE3BM,OAAO,CAACG,OAAO,CAAC,YAAY,EAAE,wCAAwC,CAAC;EAEvEH,OAAO,CAACG,OAAO,CACb,4CAA4C,EAC5C,gDACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,kBAAkB,EAClB,0DACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,2CAA2C,EAC3C,4CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,sCAAsC,EACtC,0CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,uCAAuC,EACvC,gDACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,4CAA4C,EAC5C,6CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,2BAA2B,EAC3B,wEACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,4BAA4B,EAC5B,yCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,gCAAgC,EAChC,2FACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,mCAAmC,EACnC,oCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,mCAAmC,EACnC,oCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;EAExD,OAAOH,OAAO;AAChB"}
|
|
@@ -27,7 +27,9 @@ async (host, user, password, options, command) => {
|
|
|
27
27
|
if (options.authenticationHeaderOverrides) {
|
|
28
28
|
state.setAuthenticationHeaderOverrides(JSON.parse(options.authenticationHeaderOverrides));
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const needSa = options.sa && !state.getServiceAccountId() && !state.getServiceAccountJwk();
|
|
31
|
+
const needLogApiKey = options.logApi && !state.getLogApiKey() && !state.getLogApiSecret() && needSa;
|
|
32
|
+
const forceLoginAsUser = needSa || needLogApiKey;
|
|
31
33
|
if (options.validate && (await getTokens(forceLoginAsUser)) || !options.validate) {
|
|
32
34
|
verboseMessage(`Saving connection profile for tenant ${state.getHost()}...`);
|
|
33
35
|
// if cloud deployment add service account
|
|
@@ -60,7 +62,7 @@ async (host, user, password, options, command) => {
|
|
|
60
62
|
// if cloud deployment add log api key and secret
|
|
61
63
|
verboseMessage(options);
|
|
62
64
|
verboseMessage(state);
|
|
63
|
-
if (options.validate && state.getDeploymentType() === constants.CLOUD_DEPLOYMENT_TYPE_KEY &&
|
|
65
|
+
if (options.validate && state.getDeploymentType() === constants.CLOUD_DEPLOYMENT_TYPE_KEY && needLogApiKey) {
|
|
64
66
|
// validate and add existing log api key and secret
|
|
65
67
|
if (options.logApiKey && options.logApiSecret) {
|
|
66
68
|
verboseMessage(`Validating and adding log api key and secret...`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conn-save.js","names":["FrodoCommand","Option","Authenticate","ConnectionProfile","ServiceAccount","state","constants","verboseMessage","printMessage","addExistingServiceAccount","provisionCreds","getTokens","saveConnectionProfile","addNewServiceAccount","isServiceAccountsFeatureAvailable","program","alias","description","addOption","action","host","user","password","options","command","handleDefaultArgsAndOpts","setLogApiKey","logApiKey","setLogApiSecret","logApiSecret","authenticationService","setAuthenticationService","authenticationHeaderOverrides","setAuthenticationHeaderOverrides","JSON","parse","forceLoginAsUser","sa","getLogApiKey","getLogApiSecret","validate","getHost","getDeploymentType","CLOUD_DEPLOYMENT_TYPE_KEY","saId","saJwkFile","getServiceAccountId","name","_id","error","_error$response","_error$response2","_error$response2$data","response","data","message","process","exitCode","logApi","creds","api_key_id","api_key_secret","_error$response3","_error$response4","_error$response4$data"],"sources":["cli/conn/conn-save.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n ServiceAccount,\n state,\n constants,\n} from '@rockcarver/frodo-lib';\nimport { verboseMessage, printMessage } from '../../utils/Console';\nimport { addExistingServiceAccount } from '../../ops/ConnectionProfileOps.js';\nimport { provisionCreds } from '../../ops/LogOps';\n\nconst { getTokens } = Authenticate;\nconst { saveConnectionProfile, addNewServiceAccount } = ConnectionProfile;\nconst { isServiceAccountsFeatureAvailable } = ServiceAccount;\n\nconst program = new FrodoCommand('frodo conn save', ['realm']);\n\nprogram\n .alias('add')\n .description('Save connection profiles.')\n .addOption(\n new Option(\n '--sa-id <uuid>',\n \"Service account's uuid. If specified, must also include --sa-jwk-file. Ignored with --no-sa.\"\n )\n )\n .addOption(\n new Option(\n '--sa-jwk-file <file>',\n \"File containing the service account's java web key (jwk). Jwk must contain private key! If specified, must also include --sa-id. Ignored with --no-sa.\"\n )\n )\n .addOption(new Option('--no-sa', 'Do not create and add service account.'))\n .addOption(\n new Option(\n '--log-api-key [key]',\n 'Log API key. If specified, must also include --log-api-secret. Ignored with --no-log-api.'\n )\n )\n .addOption(\n new Option(\n '--log-api-secret [secret]',\n 'Log API secret. If specified, must also include --log-api-key. Ignored with --no-log-api.'\n )\n )\n .addOption(\n new Option('--no-log-api', 'Do not create and add log API key and secret.')\n )\n .addOption(new Option('--no-validate', 'Do not validate connection.'))\n .addOption(\n new Option(\n '--authentication-service [service]',\n 'Name of the authentication service/tree to use.'\n )\n )\n .addOption(\n new Option(\n '--authentication-header-overrides [headers]',\n 'Map of headers: {\"host\":\"am.example.com:8081\"}.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n state.setLogApiKey(options.logApiKey);\n state.setLogApiSecret(options.logApiSecret);\n if (options.authenticationService) {\n state.setAuthenticationService(options.authenticationService);\n }\n if (options.authenticationHeaderOverrides) {\n state.setAuthenticationHeaderOverrides(\n JSON.parse(options.authenticationHeaderOverrides)\n );\n }\n const forceLoginAsUser =\n !options.sa ||\n (state.getLogApiKey() && state.getLogApiSecret() ? false : true);\n if (\n (options.validate && (await getTokens(forceLoginAsUser))) ||\n !options.validate\n ) {\n verboseMessage(\n `Saving connection profile for tenant ${state.getHost()}...`\n );\n // if cloud deployment add service account\n if (\n options.validate &&\n state.getDeploymentType() === constants.CLOUD_DEPLOYMENT_TYPE_KEY &&\n options.sa &&\n (await isServiceAccountsFeatureAvailable())\n ) {\n // validate and add existing service account\n if (options.saId && options.saJwkFile) {\n verboseMessage(`Validating and adding service account...`);\n if (\n await addExistingServiceAccount(\n options.saId,\n options.saJwkFile,\n options.validate\n )\n ) {\n printMessage(\n `Validated and added service account with id ${options.saId} to profile.`\n );\n }\n }\n // add new service account if none already exists in the profile\n else if (!state.getServiceAccountId()) {\n try {\n verboseMessage(`Creating service account...`);\n const sa = await addNewServiceAccount();\n printMessage(\n `Created and added service account ${sa.name} with id ${sa._id} to profile.`\n );\n } catch (error) {\n printMessage(error.response?.data, 'error');\n printMessage(\n `Error creating service account: ${error.response?.data?.message}`,\n 'error'\n );\n process.exitCode = 1;\n }\n }\n }\n // add existing service account without validation\n else if (\n !options.validate &&\n options.saId &&\n options.saJwkFile &&\n options.sa\n ) {\n addExistingServiceAccount(\n options.saId,\n options.saJwkFile,\n options.validate\n );\n }\n // if cloud deployment add log api key and secret\n verboseMessage(options);\n verboseMessage(state);\n if (\n options.validate &&\n state.getDeploymentType() === constants.CLOUD_DEPLOYMENT_TYPE_KEY &&\n options.logApi\n ) {\n // validate and add existing log api key and secret\n if (options.logApiKey && options.logApiSecret) {\n verboseMessage(`Validating and adding log api key and secret...`);\n if (\n await addExistingServiceAccount(\n options.logApiKey,\n options.logApiSecret,\n options.validate\n )\n ) {\n printMessage(\n `Added log API key ${options.logApiKey} to profile.`\n );\n }\n }\n // add new log api key and secret if none already exists in the profile\n else if (!state.getLogApiKey()) {\n try {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n printMessage(\n `Created log API key ${creds.api_key_id} and secret.`\n );\n } catch (error) {\n printMessage(error.response?.data, 'error');\n printMessage(\n `Error creating log API key and secret: ${error.response?.data?.message}`,\n 'error'\n );\n process.exitCode = 1;\n }\n }\n }\n // add existing log api key and secret without validation\n // storing log API key and secret in the connection profile is happening default, therefore no code required here\n if (await saveConnectionProfile(host)) {\n printMessage(`Saved connection profile ${state.getHost()}`);\n } else {\n process.exitCode = 1;\n }\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SACEC,YAAY,EACZC,iBAAiB,EACjBC,cAAc,EACdC,KAAK,EACLC,SAAS,QACJ,uBAAuB;AAC9B,SAASC,cAAc,EAAEC,YAAY,QAAQ,qBAAqB;AAClE,SAASC,yBAAyB,QAAQ,mCAAmC;AAC7E,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,MAAM;EAAEC;AAAU,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,CACT,qBAAoBe,OAAO,CAACI,SAAU,cACzC,CAAC;QACH;MACF;MACA;MAAA,KACK,IAAI,CAACtB,KAAK,CAACiC,YAAY,CAAC,CAAC,EAAE;QAC9B,IAAI;UACF,MAAMqB,KAAK,GAAG,MAAMjD,cAAc,CAAC,CAAC;UACpCL,KAAK,CAACqB,YAAY,CAACiC,KAAK,CAACC,UAAU,CAAC;UACpCvD,KAAK,CAACuB,eAAe,CAAC+B,KAAK,CAACE,cAAc,CAAC;UAC3CrD,YAAY,CACT,uBAAsBmD,KAAK,CAACC,UAAW,cAC1C,CAAC;QACH,CAAC,CAAC,OAAOX,KAAK,EAAE;UAAA,IAAAa,gBAAA,EAAAC,gBAAA,EAAAC,qBAAA;UACdxD,YAAY,EAAAsD,gBAAA,GAACb,KAAK,CAACI,QAAQ,cAAAS,gBAAA,uBAAdA,gBAAA,CAAgBR,IAAI,EAAE,OAAO,CAAC;UAC3C9C,YAAY,CACT,0CAAuC,CAAAuD,gBAAA,GAAEd,KAAK,CAACI,QAAQ,cAAAU,gBAAA,wBAAAC,qBAAA,GAAdD,gBAAA,CAAgBT,IAAI,cAAAU,qBAAA,uBAApBA,qBAAA,CAAsBT,OAAQ,EAAC,EACzE,OACF,CAAC;UACDC,OAAO,CAACC,QAAQ,GAAG,CAAC;QACtB;MACF;IACF;IACA;IACA;IACA,IAAI,MAAM7C,qBAAqB,CAACQ,IAAI,CAAC,EAAE;MACrCZ,YAAY,CAAE,4BAA2BH,KAAK,CAACoC,OAAO,CAAC,CAAE,EAAC,CAAC;IAC7D,CAAC,MAAM;MACLe,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEH1C,OAAO,CAACoB,KAAK,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"conn-save.js","names":["FrodoCommand","Option","Authenticate","ConnectionProfile","ServiceAccount","state","constants","verboseMessage","printMessage","addExistingServiceAccount","provisionCreds","getTokens","saveConnectionProfile","addNewServiceAccount","isServiceAccountsFeatureAvailable","program","alias","description","addOption","action","host","user","password","options","command","handleDefaultArgsAndOpts","setLogApiKey","logApiKey","setLogApiSecret","logApiSecret","authenticationService","setAuthenticationService","authenticationHeaderOverrides","setAuthenticationHeaderOverrides","JSON","parse","needSa","sa","getServiceAccountId","getServiceAccountJwk","needLogApiKey","logApi","getLogApiKey","getLogApiSecret","forceLoginAsUser","validate","getHost","getDeploymentType","CLOUD_DEPLOYMENT_TYPE_KEY","saId","saJwkFile","name","_id","error","_error$response","_error$response2","_error$response2$data","response","data","message","process","exitCode","creds","api_key_id","api_key_secret","_error$response3","_error$response4","_error$response4$data"],"sources":["cli/conn/conn-save.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n ServiceAccount,\n state,\n constants,\n} from '@rockcarver/frodo-lib';\nimport { verboseMessage, printMessage } from '../../utils/Console';\nimport { addExistingServiceAccount } from '../../ops/ConnectionProfileOps.js';\nimport { provisionCreds } from '../../ops/LogOps';\n\nconst { getTokens } = Authenticate;\nconst { saveConnectionProfile, addNewServiceAccount } = ConnectionProfile;\nconst { isServiceAccountsFeatureAvailable } = ServiceAccount;\n\nconst program = new FrodoCommand('frodo conn save', ['realm']);\n\nprogram\n .alias('add')\n .description('Save connection profiles.')\n .addOption(\n new Option(\n '--sa-id <uuid>',\n \"Service account's uuid. If specified, must also include --sa-jwk-file. Ignored with --no-sa.\"\n )\n )\n .addOption(\n new Option(\n '--sa-jwk-file <file>',\n \"File containing the service account's java web key (jwk). Jwk must contain private key! If specified, must also include --sa-id. Ignored with --no-sa.\"\n )\n )\n .addOption(new Option('--no-sa', 'Do not create and add service account.'))\n .addOption(\n new Option(\n '--log-api-key [key]',\n 'Log API key. If specified, must also include --log-api-secret. Ignored with --no-log-api.'\n )\n )\n .addOption(\n new Option(\n '--log-api-secret [secret]',\n 'Log API secret. If specified, must also include --log-api-key. Ignored with --no-log-api.'\n )\n )\n .addOption(\n new Option('--no-log-api', 'Do not create and add log API key and secret.')\n )\n .addOption(new Option('--no-validate', 'Do not validate connection.'))\n .addOption(\n new Option(\n '--authentication-service [service]',\n 'Name of the authentication service/tree to use.'\n )\n )\n .addOption(\n new Option(\n '--authentication-header-overrides [headers]',\n 'Map of headers: {\"host\":\"am.example.com:8081\"}.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n state.setLogApiKey(options.logApiKey);\n state.setLogApiSecret(options.logApiSecret);\n if (options.authenticationService) {\n state.setAuthenticationService(options.authenticationService);\n }\n if (options.authenticationHeaderOverrides) {\n state.setAuthenticationHeaderOverrides(\n JSON.parse(options.authenticationHeaderOverrides)\n );\n }\n const needSa =\n options.sa &&\n !state.getServiceAccountId() &&\n !state.getServiceAccountJwk();\n const needLogApiKey =\n options.logApi &&\n !state.getLogApiKey() &&\n !state.getLogApiSecret() &&\n needSa;\n const forceLoginAsUser = needSa || needLogApiKey;\n if (\n (options.validate && (await getTokens(forceLoginAsUser))) ||\n !options.validate\n ) {\n verboseMessage(\n `Saving connection profile for tenant ${state.getHost()}...`\n );\n // if cloud deployment add service account\n if (\n options.validate &&\n state.getDeploymentType() === constants.CLOUD_DEPLOYMENT_TYPE_KEY &&\n options.sa &&\n (await isServiceAccountsFeatureAvailable())\n ) {\n // validate and add existing service account\n if (options.saId && options.saJwkFile) {\n verboseMessage(`Validating and adding service account...`);\n if (\n await addExistingServiceAccount(\n options.saId,\n options.saJwkFile,\n options.validate\n )\n ) {\n printMessage(\n `Validated and added service account with id ${options.saId} to profile.`\n );\n }\n }\n // add new service account if none already exists in the profile\n else if (!state.getServiceAccountId()) {\n try {\n verboseMessage(`Creating service account...`);\n const sa = await addNewServiceAccount();\n printMessage(\n `Created and added service account ${sa.name} with id ${sa._id} to profile.`\n );\n } catch (error) {\n printMessage(error.response?.data, 'error');\n printMessage(\n `Error creating service account: ${error.response?.data?.message}`,\n 'error'\n );\n process.exitCode = 1;\n }\n }\n }\n // add existing service account without validation\n else if (\n !options.validate &&\n options.saId &&\n options.saJwkFile &&\n options.sa\n ) {\n addExistingServiceAccount(\n options.saId,\n options.saJwkFile,\n options.validate\n );\n }\n // if cloud deployment add log api key and secret\n verboseMessage(options);\n verboseMessage(state);\n if (\n options.validate &&\n state.getDeploymentType() === constants.CLOUD_DEPLOYMENT_TYPE_KEY &&\n needLogApiKey\n ) {\n // validate and add existing log api key and secret\n if (options.logApiKey && options.logApiSecret) {\n verboseMessage(`Validating and adding log api key and secret...`);\n if (\n await addExistingServiceAccount(\n options.logApiKey,\n options.logApiSecret,\n options.validate\n )\n ) {\n printMessage(\n `Added log API key ${options.logApiKey} to profile.`\n );\n }\n }\n // add new log api key and secret if none already exists in the profile\n else if (!state.getLogApiKey()) {\n try {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n printMessage(\n `Created log API key ${creds.api_key_id} and secret.`\n );\n } catch (error) {\n printMessage(error.response?.data, 'error');\n printMessage(\n `Error creating log API key and secret: ${error.response?.data?.message}`,\n 'error'\n );\n process.exitCode = 1;\n }\n }\n }\n // add existing log api key and secret without validation\n // storing log API key and secret in the connection profile is happening default, therefore no code required here\n if (await saveConnectionProfile(host)) {\n printMessage(`Saved connection profile ${state.getHost()}`);\n } else {\n process.exitCode = 1;\n }\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SACEC,YAAY,EACZC,iBAAiB,EACjBC,cAAc,EACdC,KAAK,EACLC,SAAS,QACJ,uBAAuB;AAC9B,SAASC,cAAc,EAAEC,YAAY,QAAQ,qBAAqB;AAClE,SAASC,yBAAyB,QAAQ,mCAAmC;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ACC,QAAQ,GAAG,CAAC;IACtB;EACF,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEH9C,OAAO,CAACoB,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { AdminFederation } from '@rockcarver/frodo-lib';
|
|
3
|
+
import { createProgressBar, failSpinner, printMessage, showSpinner, stopProgressBar, succeedSpinner, updateProgressBar } from '../utils/Console';
|
|
4
|
+
import { getTypedFilename, saveJsonToFile } from '../utils/ExportImportUtils';
|
|
5
|
+
const {
|
|
6
|
+
getAdminFederationProviders,
|
|
7
|
+
exportAdminFederationProvider,
|
|
8
|
+
exportAdminFederationProviders,
|
|
9
|
+
importAdminFederationProvider,
|
|
10
|
+
importFirstAdminFederationProvider,
|
|
11
|
+
importAdminFederationProviders
|
|
12
|
+
} = AdminFederation;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* List providers
|
|
16
|
+
*/
|
|
17
|
+
export async function listAdminFederationProviders() {
|
|
18
|
+
try {
|
|
19
|
+
const providers = await getAdminFederationProviders();
|
|
20
|
+
providers.sort((a, b) => a._id.localeCompare(b._id));
|
|
21
|
+
providers.forEach(socialIdentityProvider => {
|
|
22
|
+
printMessage(`${socialIdentityProvider._id}`, 'data');
|
|
23
|
+
});
|
|
24
|
+
} catch (err) {
|
|
25
|
+
printMessage(`listAdminFederationProviders ERROR: ${err.message}`, 'error');
|
|
26
|
+
printMessage(err, 'error');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Export provider by id
|
|
32
|
+
* @param {string} providerId provider id/name
|
|
33
|
+
* @param {string} file optional export file name
|
|
34
|
+
*/
|
|
35
|
+
export async function exportAdminFederationProviderToFile(providerId, file = '') {
|
|
36
|
+
let fileName = file;
|
|
37
|
+
if (!fileName) {
|
|
38
|
+
fileName = getTypedFilename(providerId, 'admin.federation');
|
|
39
|
+
}
|
|
40
|
+
createProgressBar(1, `Exporting ${providerId}`);
|
|
41
|
+
try {
|
|
42
|
+
updateProgressBar(`Writing file ${fileName}`);
|
|
43
|
+
const fileData = await exportAdminFederationProvider(providerId);
|
|
44
|
+
saveJsonToFile(fileData, fileName);
|
|
45
|
+
stopProgressBar(`Exported ${providerId['brightCyan']} to ${fileName['brightCyan']}.`);
|
|
46
|
+
} catch (err) {
|
|
47
|
+
stopProgressBar(`${err}`);
|
|
48
|
+
printMessage(`${err}`, 'error');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Export all providers
|
|
54
|
+
* @param {string} file optional export file name
|
|
55
|
+
*/
|
|
56
|
+
export async function exportAdminFederationProvidersToFile(file = '') {
|
|
57
|
+
let fileName = file;
|
|
58
|
+
if (!fileName) {
|
|
59
|
+
fileName = getTypedFilename(`allProviders`, 'admin.federation');
|
|
60
|
+
}
|
|
61
|
+
const fileData = await exportAdminFederationProviders();
|
|
62
|
+
saveJsonToFile(fileData, fileName);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Export all providers to individual files
|
|
67
|
+
*/
|
|
68
|
+
export async function exportAdminFederationProvidersToFiles() {
|
|
69
|
+
const allIdpsData = await getAdminFederationProviders();
|
|
70
|
+
// printMessage(allIdpsData, 'data');
|
|
71
|
+
createProgressBar(allIdpsData.length, 'Exporting providers');
|
|
72
|
+
for (const idpData of allIdpsData) {
|
|
73
|
+
updateProgressBar(`Writing provider ${idpData._id}`);
|
|
74
|
+
const fileName = getTypedFilename(idpData._id, 'admin.federation');
|
|
75
|
+
const fileData = await exportAdminFederationProvider(idpData._id);
|
|
76
|
+
saveJsonToFile(fileData, fileName);
|
|
77
|
+
}
|
|
78
|
+
stopProgressBar(`${allIdpsData.length} providers exported.`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Import provider by id/name
|
|
83
|
+
* @param {string} providerId provider id/name
|
|
84
|
+
* @param {string} file import file name
|
|
85
|
+
* @returns {Promise<boolean>} true if provider was imported successfully, false otherwise
|
|
86
|
+
*/
|
|
87
|
+
export async function importAdminFederationProviderFromFile(providerId, file) {
|
|
88
|
+
let outcome = false;
|
|
89
|
+
showSpinner(`Importing provider ${providerId} from ${file}...`);
|
|
90
|
+
fs.readFile(file, 'utf8', async (err, data) => {
|
|
91
|
+
if (err) throw err;
|
|
92
|
+
try {
|
|
93
|
+
const fileData = JSON.parse(data);
|
|
94
|
+
await importAdminFederationProvider(providerId, fileData);
|
|
95
|
+
succeedSpinner(`Successfully imported provider ${providerId} from ${file}.`);
|
|
96
|
+
outcome = true;
|
|
97
|
+
} catch (error) {
|
|
98
|
+
var _error$response;
|
|
99
|
+
failSpinner(`Error importing provider ${providerId} from ${file}.`);
|
|
100
|
+
printMessage(((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data) || error, 'error');
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return outcome;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Import first provider from file
|
|
108
|
+
* @param {String} file import file name
|
|
109
|
+
* @returns {Promise<boolean>} true if first provider was imported successfully, false otherwise
|
|
110
|
+
*/
|
|
111
|
+
export async function importFirstAdminFederationProviderFromFile(file) {
|
|
112
|
+
let outcome = false;
|
|
113
|
+
showSpinner(`Importing first provider from ${file}...`);
|
|
114
|
+
fs.readFile(file, 'utf8', async (err, data) => {
|
|
115
|
+
if (err) throw err;
|
|
116
|
+
try {
|
|
117
|
+
const fileData = JSON.parse(data);
|
|
118
|
+
await importFirstAdminFederationProvider(fileData);
|
|
119
|
+
succeedSpinner(`Successfully imported first provider from ${file}.`);
|
|
120
|
+
outcome = true;
|
|
121
|
+
} catch (error) {
|
|
122
|
+
var _error$response2;
|
|
123
|
+
failSpinner(`Error importing first provider from ${file}.`);
|
|
124
|
+
printMessage(((_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data) || error, 'error');
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return outcome;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Import all providers from file
|
|
132
|
+
* @param {string} file import file name
|
|
133
|
+
* @returns {Promise<boolean>} true if all providers were imported successfully, false otherwise
|
|
134
|
+
*/
|
|
135
|
+
export async function importAdminFederationProvidersFromFile(file) {
|
|
136
|
+
let outcome = false;
|
|
137
|
+
showSpinner(`Importing providers from ${file}...`);
|
|
138
|
+
fs.readFile(file, 'utf8', async (err, data) => {
|
|
139
|
+
if (err) throw err;
|
|
140
|
+
try {
|
|
141
|
+
const fileData = JSON.parse(data);
|
|
142
|
+
await importAdminFederationProviders(fileData);
|
|
143
|
+
succeedSpinner(`Successfully imported providers from ${file}.`);
|
|
144
|
+
outcome = true;
|
|
145
|
+
} catch (error) {
|
|
146
|
+
var _error$response3;
|
|
147
|
+
failSpinner(`Error importing providers from ${file}.`);
|
|
148
|
+
printMessage(((_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data) || error, 'error');
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return outcome;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Import providers from *.idp.json files in current working directory
|
|
156
|
+
*/
|
|
157
|
+
export async function importAdminFederationProvidersFromFiles() {
|
|
158
|
+
const names = fs.readdirSync('.');
|
|
159
|
+
const jsonFiles = names.filter(name => name.toLowerCase().endsWith('.admin.federation.json'));
|
|
160
|
+
createProgressBar(jsonFiles.length, 'Importing providers...');
|
|
161
|
+
let total = 0;
|
|
162
|
+
for (const file of jsonFiles) {
|
|
163
|
+
const data = fs.readFileSync(file, 'utf8');
|
|
164
|
+
const fileData = JSON.parse(data);
|
|
165
|
+
const count = Object.keys(fileData.idp).length;
|
|
166
|
+
total += count;
|
|
167
|
+
await importAdminFederationProviders(fileData);
|
|
168
|
+
updateProgressBar(`Imported ${count} provider(s) from ${file}`);
|
|
169
|
+
}
|
|
170
|
+
stopProgressBar(`Finished importing ${total} provider(s) from ${jsonFiles.length} file(s).`);
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=AdminFederationOps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminFederationOps.js","names":["fs","AdminFederation","createProgressBar","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","getTypedFilename","saveJsonToFile","getAdminFederationProviders","exportAdminFederationProvider","exportAdminFederationProviders","importAdminFederationProvider","importFirstAdminFederationProvider","importAdminFederationProviders","listAdminFederationProviders","providers","sort","a","b","_id","localeCompare","forEach","socialIdentityProvider","err","message","exportAdminFederationProviderToFile","providerId","file","fileName","fileData","exportAdminFederationProvidersToFile","exportAdminFederationProvidersToFiles","allIdpsData","length","idpData","importAdminFederationProviderFromFile","outcome","readFile","data","JSON","parse","error","_error$response","response","importFirstAdminFederationProviderFromFile","_error$response2","importAdminFederationProvidersFromFile","_error$response3","importAdminFederationProvidersFromFiles","names","readdirSync","jsonFiles","filter","name","toLowerCase","endsWith","total","readFileSync","count","Object","keys","idp"],"sources":["ops/AdminFederationOps.ts"],"sourcesContent":["import fs from 'fs';\nimport { AdminFederation } from '@rockcarver/frodo-lib';\nimport {\n createProgressBar,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport { getTypedFilename, saveJsonToFile } from '../utils/ExportImportUtils';\n\nconst {\n getAdminFederationProviders,\n exportAdminFederationProvider,\n exportAdminFederationProviders,\n importAdminFederationProvider,\n importFirstAdminFederationProvider,\n importAdminFederationProviders,\n} = AdminFederation;\n\n/**\n * List providers\n */\nexport async function listAdminFederationProviders() {\n try {\n const providers = await getAdminFederationProviders();\n providers.sort((a, b) => a._id.localeCompare(b._id));\n providers.forEach((socialIdentityProvider) => {\n printMessage(`${socialIdentityProvider._id}`, 'data');\n });\n } catch (err) {\n printMessage(`listAdminFederationProviders ERROR: ${err.message}`, 'error');\n printMessage(err, 'error');\n }\n}\n\n/**\n * Export provider by id\n * @param {string} providerId provider id/name\n * @param {string} file optional export file name\n */\nexport async function exportAdminFederationProviderToFile(\n providerId: string,\n file = ''\n) {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(providerId, 'admin.federation');\n }\n createProgressBar(1, `Exporting ${providerId}`);\n try {\n updateProgressBar(`Writing file ${fileName}`);\n const fileData = await exportAdminFederationProvider(providerId);\n saveJsonToFile(fileData, fileName);\n stopProgressBar(\n `Exported ${providerId['brightCyan']} to ${fileName['brightCyan']}.`\n );\n } catch (err) {\n stopProgressBar(`${err}`);\n printMessage(`${err}`, 'error');\n }\n}\n\n/**\n * Export all providers\n * @param {string} file optional export file name\n */\nexport async function exportAdminFederationProvidersToFile(file = '') {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(`allProviders`, 'admin.federation');\n }\n const fileData = await exportAdminFederationProviders();\n saveJsonToFile(fileData, fileName);\n}\n\n/**\n * Export all providers to individual files\n */\nexport async function exportAdminFederationProvidersToFiles() {\n const allIdpsData = await getAdminFederationProviders();\n // printMessage(allIdpsData, 'data');\n createProgressBar(allIdpsData.length, 'Exporting providers');\n for (const idpData of allIdpsData) {\n updateProgressBar(`Writing provider ${idpData._id}`);\n const fileName = getTypedFilename(idpData._id, 'admin.federation');\n const fileData = await exportAdminFederationProvider(idpData._id);\n saveJsonToFile(fileData, fileName);\n }\n stopProgressBar(`${allIdpsData.length} providers exported.`);\n}\n\n/**\n * Import provider by id/name\n * @param {string} providerId provider id/name\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if provider was imported successfully, false otherwise\n */\nexport async function importAdminFederationProviderFromFile(\n providerId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing provider ${providerId} from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importAdminFederationProvider(providerId, fileData);\n succeedSpinner(\n `Successfully imported provider ${providerId} from ${file}.`\n );\n outcome = true;\n } catch (error) {\n failSpinner(`Error importing provider ${providerId} from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import first provider from file\n * @param {String} file import file name\n * @returns {Promise<boolean>} true if first provider was imported successfully, false otherwise\n */\nexport async function importFirstAdminFederationProviderFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing first provider from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importFirstAdminFederationProvider(fileData);\n succeedSpinner(`Successfully imported first provider from ${file}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error importing first provider from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import all providers from file\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if all providers were imported successfully, false otherwise\n */\nexport async function importAdminFederationProvidersFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing providers from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importAdminFederationProviders(fileData);\n succeedSpinner(`Successfully imported providers from ${file}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error importing providers from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import providers from *.idp.json files in current working directory\n */\nexport async function importAdminFederationProvidersFromFiles() {\n const names = fs.readdirSync('.');\n const jsonFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.admin.federation.json')\n );\n\n createProgressBar(jsonFiles.length, 'Importing providers...');\n let total = 0;\n for (const file of jsonFiles) {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n const count = Object.keys(fileData.idp).length;\n total += count;\n await importAdminFederationProviders(fileData);\n updateProgressBar(`Imported ${count} provider(s) from ${file}`);\n }\n stopProgressBar(\n `Finished importing ${total} provider(s) from ${jsonFiles.length} file(s).`\n );\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SACEC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,iBAAiB,QACZ,kBAAkB;AACzB,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,4BAA4B;AAE7E,MAAM;EACJC,2BAA2B;EAC3BC,6BAA6B;EAC7BC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,kCAAkC;EAClCC;AACF,CAAC,GAAGf,eAAe;;AAEnB;AACA;AACA;AACA,OAAO,eAAegB,4BAA4BA,CAAA,EAAG;EACnD,IAAI;IACF,MAAMC,SAAS,GAAG,MAAMP,2BAA2B,CAAC,CAAC;IACrDO,SAAS,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,GAAG,CAACC,aAAa,CAACF,CAAC,CAACC,GAAG,CAAC,CAAC;IACpDJ,SAAS,CAACM,OAAO,CAAEC,sBAAsB,IAAK;MAC5CrB,YAAY,CAAE,GAAEqB,sBAAsB,CAACH,GAAI,EAAC,EAAE,MAAM,CAAC;IACvD,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOI,GAAG,EAAE;IACZtB,YAAY,CAAE,uCAAsCsB,GAAG,CAACC,OAAQ,EAAC,EAAE,OAAO,CAAC;IAC3EvB,YAAY,CAACsB,GAAG,EAAE,OAAO,CAAC;EAC5B;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeE,mCAAmCA,CACvDC,UAAkB,EAClBC,IAAI,GAAG,EAAE,EACT;EACA,IAAIC,QAAQ,GAAGD,IAAI;EACnB,IAAI,CAACC,QAAQ,EAAE;IACbA,QAAQ,GAAGtB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,uBAAdA,gBAAA,CAAgBT,IAAI,KAAIG,KAAK,EAAE,OAAO,CAAC;IACtD;EACF,CAAC,CAAC;EACF,OAAOL,OAAO;AAChB;;AAEA;AACA;AACA;AACA,OAAO,eAAeY,uCAAuCA,CAAA,EAAG;EAC9D,MAAMC,KAAK,GAAGpD,EAAE,CAACqD,WAAW,CAAC,GAAG,CAAC;EACjC,MAAMC,SAAS,GAAGF,KAAK,CAACG,MAAM,CAAEC,IAAI,IAClCA,IAAI,CAACC,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,wBAAwB,CACtD,CAAC;EAEDxD,iBAAiB,CAACoD,SAAS,CAAClB,MAAM,EAAE,wBAAwB,CAAC;EAC7D,IAAIuB,KAAK,GAAG,CAAC;EACb,KAAK,MAAM7B,IAAI,IAAIwB,SAAS,EAAE;IAC5B,MAAMb,IAAI,GAAGzC,EAAE,CAAC4D,YAAY,CAAC9B,IAAI,EAAE,MAAM,CAAC;IAC1C,MAAME,QAAQ,GAAGU,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC;IACjC,MAAMoB,KAAK,GAAGC,MAAM,CAACC,IAAI,CAAC/B,QAAQ,CAACgC,GAAG,CAAC,CAAC5B,MAAM;IAC9CuB,KAAK,IAAIE,KAAK;IACd,MAAM7C,8BAA8B,CAACgB,QAAQ,CAAC;IAC9CxB,iBAAiB,CAAE,YAAWqD,KAAM,qBAAoB/B,IAAK,EAAC,CAAC;EACjE;EACAxB,eAAe,CACZ,sBAAqBqD,KAAM,qBAAoBL,SAAS,CAAClB,MAAO,WACnE,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockcarver/frodo-cli",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.6-1",
|
|
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": [
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@rockcarver/frodo-lib": "0.
|
|
102
|
+
"@rockcarver/frodo-lib": "1.0.1-0",
|
|
103
103
|
"chokidar": "^3.5.3",
|
|
104
104
|
"cli-progress": "^3.11.2",
|
|
105
105
|
"cli-table3": "^0.6.3",
|