@rockcarver/frodo-cli 0.19.3 → 0.19.4
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
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.19.4] - 2023-01-09
|
|
11
|
+
|
|
10
12
|
## [0.19.3] - 2023-01-07
|
|
11
13
|
|
|
12
14
|
## [0.19.3-3] - 2023-01-07
|
|
@@ -841,7 +843,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
841
843
|
- Fixed problem with adding connection profiles
|
|
842
844
|
- Miscellaneous bug fixes
|
|
843
845
|
|
|
844
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.19.
|
|
846
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.19.4...HEAD
|
|
847
|
+
|
|
848
|
+
[0.19.4]: https://github.com/rockcarver/frodo-cli/compare/v0.19.3...v0.19.4
|
|
845
849
|
|
|
846
850
|
[0.19.3]: https://github.com/rockcarver/frodo-cli/compare/v0.19.3-3...v0.19.3
|
|
847
851
|
|
|
@@ -28,7 +28,7 @@ async (host, user, password, key, secret, options, command) => {
|
|
|
28
28
|
state.setAuthenticationHeaderOverrides(JSON.parse(options.authenticationHeaderOverrides));
|
|
29
29
|
}
|
|
30
30
|
if (options.validate && (await getTokens()) || !options.validate) {
|
|
31
|
-
verboseMessage(`Saving connection profile for tenant ${state.
|
|
31
|
+
verboseMessage(`Saving connection profile for tenant ${state.getHost()}...`);
|
|
32
32
|
// if cloud deployment add service account
|
|
33
33
|
if (options.validate && state.getDeploymentType() === constants.CLOUD_DEPLOYMENT_TYPE_KEY && options.sa && (await isServiceAccountsFeatureAvailable())) {
|
|
34
34
|
// validate and add existing service account
|
|
@@ -57,7 +57,7 @@ async (host, user, password, key, secret, options, command) => {
|
|
|
57
57
|
addExistingServiceAccount(options.saId, options.saJwkFile, options.validate);
|
|
58
58
|
}
|
|
59
59
|
if (await saveConnectionProfile(host)) {
|
|
60
|
-
printMessage(`Saved connection profile ${state.
|
|
60
|
+
printMessage(`Saved connection profile ${state.getHost()}`);
|
|
61
61
|
} else {
|
|
62
62
|
process.exitCode = 1;
|
|
63
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conn-save.js","names":["FrodoCommand","Option","apiKeyArgument","apiSecretArgument","Authenticate","ConnectionProfile","ServiceAccount","state","constants","verboseMessage","printMessage","addExistingServiceAccount","getTokens","saveConnectionProfile","addNewServiceAccount","isServiceAccountsFeatureAvailable","program","alias","description","addArgument","addOption","action","host","user","password","key","secret","options","command","handleDefaultArgsAndOpts","setLogApiKey","setLogApiSecret","authenticationService","setAuthenticationService","authenticationHeaderOverrides","setAuthenticationHeaderOverrides","JSON","parse","validate","
|
|
1
|
+
{"version":3,"file":"conn-save.js","names":["FrodoCommand","Option","apiKeyArgument","apiSecretArgument","Authenticate","ConnectionProfile","ServiceAccount","state","constants","verboseMessage","printMessage","addExistingServiceAccount","getTokens","saveConnectionProfile","addNewServiceAccount","isServiceAccountsFeatureAvailable","program","alias","description","addArgument","addOption","action","host","user","password","key","secret","options","command","handleDefaultArgsAndOpts","setLogApiKey","setLogApiSecret","authenticationService","setAuthenticationService","authenticationHeaderOverrides","setAuthenticationHeaderOverrides","JSON","parse","validate","getHost","getDeploymentType","CLOUD_DEPLOYMENT_TYPE_KEY","sa","saId","saJwkFile","getServiceAccountId","name","_id","error","response","data","message","process","exitCode"],"sources":["cli/conn/conn-save.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { apiKeyArgument, apiSecretArgument } from './conn';\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';\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 .addArgument(apiKeyArgument)\n .addArgument(apiSecretArgument)\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 add service account.'))\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, key, secret, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n user,\n password,\n key,\n secret,\n options,\n command\n );\n state.setLogApiKey(key);\n state.setLogApiSecret(secret);\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 if ((options.validate && (await getTokens())) || !options.validate) {\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 (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,SAASC,cAAc,EAAEC,iBAAiB,QAAQ,QAAQ;AAC1D,SACEC,YAAY,EACZC,iBAAiB,EACjBC,cAAc,EACdC,KAAK,EACLC,SAAS,QACJ,uBAAuB;AAC9B,SAASC,cAAc,EAAEC,YAAY,QAAQ,qBAAqB;AAClE,SAASC,yBAAyB,QAAQ,mCAAmC;AAE7E,MAAM;EAAEC;AAAU,CAAC,GAAGR,YAAY;AAClC,MAAM;EAAES,qBAAqB;EAAEC;AAAqB,CAAC,GAAGT,iBAAiB;AACzE,MAAM;EAAEU;AAAkC,CAAC,GAAGT,cAAc;AAE5D,MAAMU,OAAO,GAAG,IAAIhB,YAAY,CAAC,iBAAiB,EAAE,CAAC,OAAO,CAAC,CAAC;AAE9DgB,OAAO,CACJC,KAAK,CAAC,KAAK,CAAC,CACZC,WAAW,CAAC,2BAA2B,CAAC,CACxCC,WAAW,CAACjB,cAAc,CAA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AAQ,CACjB;IACH;IACA,IAAI,MAAMzB,qBAAqB,CAACS,IAAI,CAAC,EAAE;MACrCZ,YAAY,CAAE,4BAA2BH,KAAK,CAACgC,OAAO,EAAG,EAAC,CAAC;IAC7D,CAAC,MAAM;MACLa,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AAAA,CACD;;AAEHrC,OAAO,CAACqB,KAAK,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockcarver/frodo-cli",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.4",
|
|
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": [
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
]
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@rockcarver/frodo-lib": "0.17.
|
|
103
|
+
"@rockcarver/frodo-lib": "0.17.6",
|
|
104
104
|
"cli-progress": "^3.11.2",
|
|
105
105
|
"cli-table3": "^0.6.3",
|
|
106
106
|
"colors": "^1.4.0",
|