Add Chromium console streaming to the debugger - #164
Conversation
📊 PR Size: size/XLTotal changes: 1981 lines (11 files) Top files changed:
...and 1 more files Size calculated as additions + deletions. Labels: XS (<10), S (<50), M (<250), L (<1000), XL (1000+) |
clholgat
left a comment
There was a problem hiding this comment.
Review of console streaming. The bounds, backpressure (128 events / 512KB, drain listener removed on close), teardown across abort/close/pagehide/target-replacement, and getter/deep-recursion handling all look solid, and multi-arg redaction is correctly double-applied (per-fragment + whole-message), so console.log('Authorization:', token) is covered. One redaction-coverage gap inline, plus one low note below.
Note: please carry this feedback into the squashed PR when the stack is collapsed.
- 🟢 Low —
formatChromiumConsoleEventreturns null for empty formatted output, so zero-arg / empty-string console calls (console.log(),console.log('')) are silently dropped from the stream. Developers see nothing for intentional blank/separator logs. Consider emitting an empty entry instead of dropping.
| return [substituted, ...formatted.slice(nextArgument)].join(' '); | ||
| } | ||
|
|
||
| function redactConsoleText(text: string): string { |
There was a problem hiding this comment.
🟠 Med — redactConsoleText only matches sk-/sess- prefixes, bearer …, and key-labeled values (authorization/cookie/*token/api_key/password/secret/etc). It misses common unlabeled high-entropy credential formats.
Failure scenario: a bare console.log(jwt) or console.log(githubToken) where the value is a JWT (eyJ…), AWS AKIA…, GitHub ghp_…, Google AIza…, or Slack xox… token — with no adjacent key name — is streamed and rendered verbatim in the panel, defeating the stated "redacts credential-shaped content" guarantee. Impact is limited to the local loopback debugger UI, but matters for shared/screenshotted panels.
Suggested fix: add standalone token-shape patterns (eyJ[\w-]+\.[\w-]+\.[\w-]+, ghp_[\w]{36}, AKIA[0-9A-Z]{16}, AIza[\w-]{35}, xox[baprs]-[\w-]+) to the redactor as defense-in-depth alongside the label-based rules.
Description
Streams Chromium console events into the debugger with bounded formatting, lifecycle cancellation, and secret redaction.
Type of Change
Testing
bazel test //...)Testing Details
npm testpassed 436/436; the CLI production build passed.//src/valdi_modules/src/valdi/web_renderer:testpassed.bazel query //...passed.Checklist
Related Issues
Relates to #154
Additional Context
Stack 11/22. Stacked on #163 (
bjd/debugger-storage-provider). Review this PR as the single incremental commitda506903against that base; do not merge it before its parent.