fix(VideoManager): redact stream URLs in diagnostics - #14727
fix(VideoManager): redact stream URLs in diagnostics#14727alireza787b wants to merge 11 commits into
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (18.56%) is below the target coverage (30.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #14727 +/- ##
==========================================
+ Coverage 25.47% 34.56% +9.09%
==========================================
Files 769 945 +176
Lines 65912 85733 +19821
Branches 30495 39538 +9043
==========================================
+ Hits 16788 29633 +12845
+ Misses 37285 36377 -908
- Partials 11839 19723 +7884
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 654 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 2 passed, 76 failed, 7 skipped. Test Resultslinux-coverage-integration: 52 passed, 0 skipped Code CoverageCoverage: 70.7% No baseline available for comparison Artifact Sizes
Updated: 2026-09-03 04:45:08 UTC • Commit: c8ffeaf • Triggered by: Linux |
|
Coverage clarification for exact head |
|
Review comments: Design / debuggability1. Over-redaction will hurt video debugging — the biggest concern. The helper strips path, query, and fragment, not just credentials. The RTSP path is the stream identity, not a secret in the common case: the #1 RTSP failure mode is a wrong mount point ( 2. Concrete regression: 3. VideoSettings changes remove the URL entirely. In the VideoSettings.cc hunks, "Testing configuration for UDP Stream:" loses its value completely. A UDP URL is Missed coverage4. src/Camera/VehicleCameraControl.cc lines 1820 and 1832 log raw 5. DOT pipeline dumps still leak credentials. Helper implementation6. Silent query/fragment removal is asymmetric with path handling. Path redaction leaves a visible 7. Dead-store no-op in the helper: Log severity8. GstVideoReceiver9. Tests10. Single monolithic test slot. QGCNetworkHelperTest follows one-slot-per-behavior; the new 11. Missing test cases: empty string, bare SummaryComments 1–3 are the substantive objections (path/query stripping, |
|
Most of the code review is relevant with my main concern being redacting urls to the point of making remote debugging impossible or less useful. |
fd4a35f to
2d149ee
Compare
|
Thanks for the detailed review. I addressed the substantive points in
I left the optional cached redacted-URI suggestion out to avoid adding synchronized state for disabled debug categories; it can remain a separate optimization if profiling ever justifies it. The rebased exact-head workflows are running now. |
|
Small follow-up at |
|
Exact-head CI caught one consistency gap from the severity change: the existing negative UDP/TCP source-factory tests still ignored these diagnostics as |
Follow-up Review (Claude Fable, on behalf of @DonLakeFlyer)Reviewed head Status of prior review itemsThe rework genuinely addressed most of the earlier round: path preserved (item 1), VideoSettings logs the redacted value (3), VehicleCameraControl covered (4), DOT dumps redacted (5), visible Remaining issues1.
2. 3. The developer opt-in DOT path lost 4. Leftover include in QGCNetworkHelperTest.cc. The diff adds 5. Pre-commit reported "Failed (non-blocking)" with "0 passed, 0 failed, 0 skipped" in the build-results comment — the hook run appears not to have executed at all rather than passing. Worth a re-run before merge given the amount of touched formatting-sensitive code. 6. Minor, helper semantics: for a URL with a present-but-empty query ( 7. Tests are good overall — five focused slots, SummaryThe rework resolved the substantive objections from the first round except one: item 1 is a real, verified remaining regression for |
|
@alireza787b Can you take a look at latest review? |
|
Addressed the follow-up review in 4e50c5a.
The changed lines pass the exact clang-format hook in diff mode and a focused Qt URL-behavior probe. The push has started a fresh CI and pre-commit run. |
|
So I was considering this for 5.1 but I think it is too invasive this late in the game to go into 5.1. Also would like bake time on it to make sure it doesn't degrade remote debugging capability. |
There was a problem hiding this comment.
Pull request overview
Centralizes video URL redaction to prevent credentials and secrets appearing in diagnostics.
Changes:
- Adds and tests URL-redaction utilities.
- Applies redaction across video settings, management, camera, and GStreamer logs.
- Restricts diagnostic DOT graph details and adjusts invalid-URI severity.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Utilities/Network/QGCNetworkHelper.h |
Declares URL-redaction APIs. |
src/Utilities/Network/QGCNetworkHelper.cc |
Implements URL sanitization. |
src/Settings/VideoSettings.cc |
Redacts configured stream logs. |
src/VideoManager/VideoManager.cc |
Redacts receiver URI diagnostics. |
src/Camera/VehicleCameraControl.cc |
Redacts stream transition logs. |
src/VideoManager/VideoReceiver/GStreamer/GstVideoReceiver.h |
Declares receiver redaction helper. |
src/VideoManager/VideoReceiver/GStreamer/GstVideoReceiver.cc |
Redacts receiver lifecycle logs. |
src/VideoManager/VideoReceiver/GStreamer/GstSourceFactory.cc |
Redacts URI warnings and lowers severity. |
src/VideoManager/VideoReceiver/GStreamer/GStreamerHelpers.h |
Defines safe DOT graph flags. |
src/VideoManager/VideoReceiver/GStreamer/GStreamerHelpers.cc |
Uses restricted DOT details. |
src/VideoManager/VideoReceiver/GStreamer/README.md |
Documents safe graph output. |
test/Utilities/Network/QGCNetworkRedactionTest.h |
Declares redaction tests. |
test/Utilities/Network/QGCNetworkRedactionTest.cc |
Tests URL sanitization behavior. |
test/Utilities/Network/CMakeLists.txt |
Registers redaction tests. |
test/VideoManager/GStreamer/GStreamerTest.h |
Declares DOT safety test. |
test/VideoManager/GStreamer/GStreamerTest.cc |
Tests property omission. |
test/VideoManager/GStreamer/SourceFactory/GStreamerSourceFactoryTest.cc |
Updates expected warning levels. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| static const QRegularExpression pattern(QStringLiteral(R"(^[^/@?#\s]+:\d{1,5}$)")); | ||
| return pattern.match(value).hasMatch(); |
There was a problem hiding this comment.
Fixed in 65c2209. The shortcut now parses a strict authority, rejects userinfo/path/query/fragment, accepts only a valid IP address or DNS hostname, and enforces ports 1-65535. Regression coverage now includes credential-shaped malformed input, bracketed IPv6, and out-of-range ports.
| /// Automatic field-report graphs omit element properties because source properties can contain credentials. | ||
| inline constexpr GstDebugGraphDetails kDiagnosticDotGraphDetails = static_cast<GstDebugGraphDetails>( | ||
| GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE | GST_DEBUG_GRAPH_SHOW_CAPS_DETAILS | GST_DEBUG_GRAPH_SHOW_STATES); |
There was a problem hiding this comment.
I kept the two dump paths deliberately separate. Automatic CacheLocation snapshots use the restricted detail mask and omit element properties. Native GST_DEBUG_DUMP_DOT_DIR dumps are an explicit developer opt-in and retain SHOW_ALL, matching the earlier maintainer request to preserve full local diagnostic detail. 65c2209 updates the README to state that these opt-in native dumps can contain credentials and must be treated as sensitive, removing the previous blanket guarantee.
65c2209 to
c8ffeaf
Compare
Description
Several QGC-owned video diagnostics can expose URL credentials or query and fragment secrets. This change centralizes a logging-safe URL representation while preserving the connection details needed for field debugging.
The helper:
REDACTED;REDACTEDmarker;The helper is used by VideoSettings, VideoManager, VehicleCameraControl, the GStreamer source factory, and GstVideoReceiver. Automatic QGC CacheLocation pipeline snapshots retain topology, caps, media types, and states while omitting element property values that can contain source credentials. Native dumps explicitly enabled through
GST_DEBUG_DUMP_DOT_DIRretain GStreamer's fullSHOW_ALLdetail for local debugging and are documented as sensitive. Bad operator-entered stream URLs are reported as warnings rather than critical failures.This does not change stream configuration, receiver lifecycle, or video transport behavior.
Type of Change
Testing
Local checks on current head
c8ffeaf59337c8828f7a36c921ff8ac1d9ba66e5:git diff --checkpassed for the review follow-up.The same cases are covered by the dedicated no-I/O
QGCNetworkRedactionTestregistered asUnit/Utilities;GStreamerTestcovers the automatic DOT-property boundary. Fresh exact-head CI is running after the review follow-up. The previous exact head completed QGC's Linux x64/arm64, unit/integration, sanitizer, coverage, Windows, macOS, iOS, Android, Docker, custom-plugin, and CodeQL checks.Platforms Tested
Flight Stacks Tested
Not applicable; this change does not enter a vehicle command path.
Screenshots
Not applicable; there is no UI change.
Checklist
Related Issues
This is the first focused replacement for draft #13594. The HTTP MJPEG and WebSocket JPEG transports remain independent in #14730 and #14731.
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).