fix(VideoManager): redact stream URLs in diagnostics - #14727
fix(VideoManager): redact stream URLs in diagnostics#14727alireza787b wants to merge 10 commits into
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (10.16%) 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% 33.30% +7.83%
==========================================
Files 769 919 +150
Lines 65912 83005 +17093
Branches 30495 38354 +7859
==========================================
+ Hits 16788 27642 +10854
+ Misses 37285 36618 -667
- Partials 11839 18745 +6906
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 617 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, 75 failed, 7 skipped. Test Resultslinux-coverage-integration: 40 passed, 0 skipped Code Coverage
Artifact Sizes
Updated: 2026-08-10 05:39:42 UTC • Commit: 4e50c5a • Triggered by: Android |
|
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(); |
| /// 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); |
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;5600andcamera.local:5600useful; andThe helper is used by VideoSettings, VideoManager, VehicleCameraControl, the GStreamer source factory, and GstVideoReceiver. QGC-generated pipeline DOT files now retain topology, caps, media types, and states while omitting element property values, which can contain source credentials. 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 exact head
8e06c53cc545bd43528ddab8d8082580d664b7ee:git diff --check.The same cases are split into five focused slots in a dedicated no-I/O
QGCNetworkRedactionTestregistered asUnit/Utilities, so QGC's normal CI executes them.GStreamerTestcovers the DOT-property boundary. Exact-head QGC CI is complete: Linux x64/arm64 release builds, unit and integration tests, ASan/UBSan, coverage thresholds, Windows, macOS, iOS, Android, Docker, custom-plugin, and CodeQL checks passed. Linux evidence: run 30598293911.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 separate 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).