@rockcarver/frodo-cli 0.23.0 → 0.23.1-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
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.23.1-1] - 2023-03-23
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- \#213: More debug logging for connection profile lookup by a unique substring. Use --debug to see the additional output. This is not yet a solution for rockcarver/frodo-cli#213 but should help identify the root cause.
|
|
15
|
+
- \#216: More debug logging for the 2fa process and proper detection of unsupported webauthn factor.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Update to frodo-lib 0.18.9-0
|
|
20
|
+
|
|
21
|
+
## [0.23.1-0] - 2023-02-27
|
|
22
|
+
|
|
10
23
|
## [0.23.0] - 2023-02-17
|
|
11
24
|
|
|
12
25
|
### Added
|
|
@@ -1062,7 +1075,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1062
1075
|
- Fixed problem with adding connection profiles
|
|
1063
1076
|
- Miscellaneous bug fixes
|
|
1064
1077
|
|
|
1065
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.23.
|
|
1078
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.23.1-1...HEAD
|
|
1079
|
+
|
|
1080
|
+
[0.23.1-1]: https://github.com/rockcarver/frodo-cli/compare/v0.23.1-0...v0.23.1-1
|
|
1081
|
+
|
|
1082
|
+
[0.23.1-0]: https://github.com/rockcarver/frodo-cli/compare/v0.23.0...v0.23.1-0
|
|
1066
1083
|
|
|
1067
1084
|
[0.23.0]: https://github.com/rockcarver/frodo-cli/compare/v0.22.3...v0.23.0
|
|
1068
1085
|
|
|
@@ -74,7 +74,8 @@ Cannot be more than 30 days in the past. If not specified, logs from one hour ag
|
|
|
74
74
|
printMessage('No end timestamp specified, defaulting end timestamp to "now"', 'info');
|
|
75
75
|
}
|
|
76
76
|
let beginTs = Date.parse(options.beginTimestamp) / 1000;
|
|
77
|
-
|
|
77
|
+
const endTs = Date.parse(options.endTimestamp) / 1000;
|
|
78
|
+
if (endTs < beginTs) {
|
|
78
79
|
printMessage('End timestamp can not be before begin timestamp', 'error');
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
@@ -86,11 +87,15 @@ Cannot be more than 30 days in the past. If not specified, logs from one hour ag
|
|
|
86
87
|
printMessage(`Fetching ID Cloud logs from the following sources: ${command.opts().sources} and levels [${resolveLevel(command.opts().level)}] of ${conn.tenant}...`);
|
|
87
88
|
if (credsFromParameters) await saveConnectionProfile(host); // save new values if they were specified on CLI
|
|
88
89
|
|
|
90
|
+
let timeIncrement = LOG_TIME_WINDOW_INCREMENT;
|
|
91
|
+
if (endTs - beginTs > 30) {
|
|
92
|
+
timeIncrement = timeIncrement * 30;
|
|
93
|
+
}
|
|
89
94
|
do {
|
|
90
|
-
intermediateEndTs = beginTs +
|
|
95
|
+
intermediateEndTs = beginTs + timeIncrement;
|
|
91
96
|
await fetchLogs(command.opts().sources, new Date(beginTs * 1000).toISOString(), new Date(intermediateEndTs * 1000).toISOString(), resolveLevel(command.opts().level), command.opts().transactionId, command.opts().searchString, null, config.getNoiseFilters(options.defaults));
|
|
92
97
|
beginTs = intermediateEndTs;
|
|
93
|
-
} while (intermediateEndTs <
|
|
98
|
+
} while (intermediateEndTs < endTs);
|
|
94
99
|
}
|
|
95
100
|
});
|
|
96
101
|
program.parse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-fetch.js","names":["FrodoCommand","sourcesOptionM","Option","Authenticate","ConnectionProfile","Log","state","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","addOption","default","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","handleDefaultArgsAndOpts","credsFromParameters","conn","setHost","tenant","logApiKey","logApiSecret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","setUsername","setPassword","creds","api_key_id","api_key_secret","now","Date","nowString","toISOString","beginTimestamp","tempStartDate","setTime","tempEndDate","endTimestamp","beginTs","parse","intermediateEndTs","opts","sources","level","transactionId","searchString","getNoiseFilters","defaults"],"sources":["cli/logging/logs-fetch.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { sourcesOptionM } from './logs';\nimport { Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\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 = 1;\n\nconst program = new FrodoCommand('frodo logs fetch', ['realm', 'type']);\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 .addOption(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 command.handleDefaultArgsAndOpts(host, user, password, options, command);\n let credsFromParameters = true;\n const conn = await getConnectionProfile();\n if (conn) {\n state.setHost(conn.tenant);\n if (conn.logApiKey != null && conn.logApiSecret != null) {\n credsFromParameters = false;\n state.setLogApiKey(conn.logApiKey);\n state.setLogApiSecret(conn.logApiSecret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (!state.getUsername() && !state.getPassword()) {\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.setUsername(conn.username);\n state.setPassword(conn.password);\n }\n if (await getTokens(true)) {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n }\n }\n const now = Date.now() / 1000;\n const nowString = new Date(now * 1000).toISOString();\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 (\n typeof options.endTimestamp === 'undefined' ||\n !options.endTimestamp\n ) {\n // no endTimestamp value specified, default is now\n options.endTimestamp = nowString;\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(\n 'End timestamp can not be before begin timestamp',\n 'error'\n );\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)}] of ${\n conn.tenant\n }...`\n );\n if (credsFromParameters) await saveConnectionProfile(host); // 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 });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,cAAc,QAAQ,QAAQ;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,OAAO,KAAKC,MAAM,MAAM,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC,cAAc;EAAEC,SAAS;EAAEC;AAAa,CAAC,GAAGN,GAAG;AACvD,MAAM;EAAEO,oBAAoB;EAAEC;AAAs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GF,OAAO,GAAGtC,yBAAyB;MACvD,MAAMR,SAAS,CACbmB,OAAO,CAAC8B,IAAI,EAAE,CAACC,OAAO,EACtB,IAAIZ,IAAI,CAACQ,OAAO,GAAG,IAAI,CAAC,CAACN,WAAW,EAAE,EACtC,IAAIF,IAAI,CAACU,iBAAiB,GAAG,IAAI,CAAC,CAACR,WAAW,EAAE,EAChDvC,YAAY,CAACkB,OAAO,CAAC8B,IAAI,EAAE,CAACE,KAAK,CAAC,EAClChC,OAAO,CAAC8B,IAAI,EAAE,CAACG,aAAa,EAC5BjC,OAAO,CAAC8B,IAAI,EAAE,CAACI,YAAY,EAC3B,IAAI,EACJxD,MAAM,CAACyD,eAAe,CAACpC,OAAO,CAACqC,QAAQ,CAAC,CACzC;MACDT,OAAO,GAAGE,iBAAiB;IAC7B,CAAC,QAAQA,iBAAiB,GAAGV,IAAI,CAACS,KAAK,CAAC7B,OAAO,CAAC2B,YAAY,CAAC,GAAG,IAAI;EACtE;AACF,CAAC,CAAC;AAEJpC,OAAO,CAACsC,KAAK,EAAE"}
|
|
1
|
+
{"version":3,"file":"logs-fetch.js","names":["FrodoCommand","sourcesOptionM","Option","Authenticate","ConnectionProfile","Log","state","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","addOption","default","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","handleDefaultArgsAndOpts","credsFromParameters","conn","setHost","tenant","logApiKey","logApiSecret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","setUsername","setPassword","creds","api_key_id","api_key_secret","now","Date","nowString","toISOString","beginTimestamp","tempStartDate","setTime","tempEndDate","endTimestamp","beginTs","parse","endTs","intermediateEndTs","opts","sources","level","timeIncrement","transactionId","searchString","getNoiseFilters","defaults"],"sources":["cli/logging/logs-fetch.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { sourcesOptionM } from './logs';\nimport { Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\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 = 1;\n\nconst program = new FrodoCommand('frodo logs fetch', ['realm', 'type']);\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 .addOption(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 command.handleDefaultArgsAndOpts(host, user, password, options, command);\n let credsFromParameters = true;\n const conn = await getConnectionProfile();\n if (conn) {\n state.setHost(conn.tenant);\n if (conn.logApiKey != null && conn.logApiSecret != null) {\n credsFromParameters = false;\n state.setLogApiKey(conn.logApiKey);\n state.setLogApiSecret(conn.logApiSecret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (!state.getUsername() && !state.getPassword()) {\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.setUsername(conn.username);\n state.setPassword(conn.password);\n }\n if (await getTokens(true)) {\n const creds = await provisionCreds();\n state.setLogApiKey(creds.api_key_id);\n state.setLogApiSecret(creds.api_key_secret);\n }\n }\n const now = Date.now() / 1000;\n const nowString = new Date(now * 1000).toISOString();\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 (\n typeof options.endTimestamp === 'undefined' ||\n !options.endTimestamp\n ) {\n // no endTimestamp value specified, default is now\n options.endTimestamp = nowString;\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 const endTs = Date.parse(options.endTimestamp) / 1000;\n if (endTs < beginTs) {\n printMessage(\n 'End timestamp can not be before begin timestamp',\n 'error'\n );\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)}] of ${\n conn.tenant\n }...`\n );\n if (credsFromParameters) await saveConnectionProfile(host); // save new values if they were specified on CLI\n\n let timeIncrement = LOG_TIME_WINDOW_INCREMENT;\n if (endTs - beginTs > 30) {\n timeIncrement = timeIncrement * 30;\n }\n do {\n intermediateEndTs = beginTs + timeIncrement;\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 < endTs);\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,cAAc,QAAQ,QAAQ;AACvC,SAASC,MAAM,QAAQ,WAAW;AAClC,SACEC,YAAY,EACZC,iBAAiB,EACjBC,GAAG,EACHC,KAAK,QACA,uBAAuB;AAC9B,OAAO,KAAKC,MAAM,MAAM,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAM;EAAEC,cAAc;EAAEC,SAAS;EAAEC;AAAa,CAAC,GAAGN,GAAG;AACvD,MAAM;EAAEO,oBAAoB;EAAEC;AAAsB,CAAC,GAAGT,iBAAiB;AACzE,MAAM;EAAEU;AAAU,CAAC,GAAGX,YAAY;AAElC,MAAMY,kBAAkB,GAAG,OAAO;AAClC,MAAMC,iBAAiB,GAAG,IAAI;AAC9B,MAAMC,mBAAmB,GAAGF,kBAAkB;AAC9C,MAAMG,yBAAyB,GAAG,CAAC;AAEnC,MAAMC,OAAO,GAAG,IAAInB,YAAY,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACvEmB,OAAO,CACJC,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tC,IAAIF,IAAI,CAACW,iBAAiB,GAAG,IAAI,CAAC,CAACT,WAAW,EAAE,EAChDvC,YAAY,CAACkB,OAAO,CAAC+B,IAAI,EAAE,CAACE,KAAK,CAAC,EAClCjC,OAAO,CAAC+B,IAAI,EAAE,CAACI,aAAa,EAC5BnC,OAAO,CAAC+B,IAAI,EAAE,CAACK,YAAY,EAC3B,IAAI,EACJ1D,MAAM,CAAC2D,eAAe,CAACtC,OAAO,CAACuC,QAAQ,CAAC,CACzC;MACDX,OAAO,GAAGG,iBAAiB;IAC7B,CAAC,QAAQA,iBAAiB,GAAGD,KAAK;EACpC;AACF,CAAC,CAAC;AAEJvC,OAAO,CAACsC,KAAK,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockcarver/frodo-cli",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.1-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.18.
|
|
102
|
+
"@rockcarver/frodo-lib": "0.18.9-0",
|
|
103
103
|
"chokidar": "^3.5.3",
|
|
104
104
|
"cli-progress": "^3.11.2",
|
|
105
105
|
"cli-table3": "^0.6.3",
|