chore(logging): add logging quality audit - #543
Open
suculent wants to merge 2 commits into
Open
Conversation
Nightshift-Task: logging-audit Nightshift-Ref: https://github.com/marcus/nightshift
Second, deliberately narrow slice of the logging-quality audit targeting the auth-sensitive modules left untouched by the first pass. Log-only changes, no control-flow changes. - audit.js: _buildRecord missing-message -> console.warn; log()/fetch() failures -> console.error. - router.js: host-header-mismatch and blacklist-check-failed -> console.warn; failed API-key auth -> console.warn. - apikey.js: genuine error paths (save_apikeys, circuit-breaker, key generator, Redis-unavailable/get, revoke/list) -> console.error; stop logging cleartext json_keys blobs; redact attempted API-key values via Util.redactToken in log_invalid_key() and key_in_keys(). No stats-parser lines changed: none of these files emit the [OID:...] [EVENT] lines consumed by statistics.js, so no logger.warn() level was downgraded. Verified: npm run lint (only 3 pre-existing errors in untouched files remain), isolated UtilSpec + LoggingQualityAuditSpec (33 specs, 0 failures). Nightshift-Task: logging-audit Nightshift-Ref: https://github.com/marcus/nightshift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit report
Verification
Update: bounded auth-module fix slice (audit.js, router.js, apikey.js)
A second, deliberately narrow remediation slice covers the auth-sensitive
modules the first pass left untouched. Log-only changes, no control-flow
changes.
lib/thinx/audit.js:_buildRecordmissing-message →console.warn;log()insertion failure andfetch()failure →console.error.lib/router.js: host-header-mismatch and blacklist-check-failed →console.warn;failed API-key authentication →
console.warn.lib/thinx/apikey.js:save_apikeysset failure, circuit-breaker OPEN,key-generator errors, Redis-unavailable/
geterrors,revoke/listerror paths →
console.error.apikey.jsno longer logs the fulljson_keysblob (cleartext keys + hashes)in
create()/revoke(); the "saving first API key" debug line logs only the alias.log_invalid_key()andkey_in_keys()are redacted via
Util.redactToken().Stats-parser safety: none of these files emit the
[OID:...] [EVENT]linesconsumed by
statistics.js, so nologger.warn()level was changed or downgraded.Verification (this slice)
npm run lint— only the 3 pre-existing errors remain, all in files thisslice never touched (
lib/thinx/statistics.js×2,spec/jasmine/ZZ-WebSocketLifecycleSpec.js).UtilSpec+LoggingQualityAuditSpec(33 specs, 0 failures).