Repository navigation
Conversation
…f the local copies `maskURIPassword.h` only had the in-place `bool maskURICredentials(std::string &)`, so every caller that needed a masked copy of a URL for a log line or an exception message (the raw string is still used for the request, the schema cache key or `collectRequestCredentials`) wrote its own copy-then-mask: `maskedURI` in ReadWriteBufferFromHTTP, `maskedURL` in MetadataStorageFromIndexPages (pointed out in review of ClickHouse#126184), WriteBufferFromHTTP, HTTPException::makeExceptionMessage and StorageURL's getLastFilePath. HTTPConnectionPool and AvroConfluentSchemaRegistry spelled out `maskURIUserinfo` + `maskPresignedURLParameters` instead, so they would miss anything added to `maskURICredentials` later. Add `[[nodiscard]] std::string maskURICredentials(std::string_view)` and use it at all seven places. A non-const `std::string` lvalue still binds the in-place overload (reference binding is an identity conversion, the conversion to `std::string_view` is user-defined), so the existing in-place callers are unchanged; const lvalues and rvalues get the copy. `[[nodiscard]]` turns a call that expects in-place masking of a const string into a build error. A `std::string` by-value parameter would be ambiguous with the in-place overload for every non-const lvalue, and a `Poco::URI` one would pull Poco into the header and could not serve `maskedURL`. Not converted because they mask differently: S3 `maskedURIString` and RemoteHostFilter (they undo `%3F` between the two steps) and SettingsSecrets. Behaviour-neutral: log and error text is identical to master. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings), plus my own cold review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261110-153900 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261110-145800 |
|
Workflow [PR], commit [a8c8fdf] Summary: ✅
AI ReviewSummaryPR #130533 adds a copy-returning Missing context / blind spots
Final Verdict✅ Approve |
|
cc @CheSema, could you review this and add the |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units27 translation units recompiled, 121 s compile time in total, 27 of them have a recent master baseline. |
Related: #126184
Related: #120407
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Follow-up to #126184 (comment):
maskedURLinMetadataStorageFromIndexPages.cppduplicatedmaskedURIinReadWriteBufferFromHTTP.cpp.src/Common/maskURIPassword.hgets[[nodiscard]] std::string maskURICredentials(std::string_view), the existing in-place masking applied to a copy. It replaces both helpers and five more places that copied a URL and masked the copy by hand:WriteBufferFromHTTP,HTTPException::makeExceptionMessage,StorageURL'sgetLastFilePath,HTTPConnectionPoolandAvroConfluentSchemaRegistry. The last two calledmaskURIUserinfoandmaskPresignedURLParametersdirectly, so they would have missed anything added tomaskURICredentialslater. Not converted, because they mask differently: S3maskedURIStringandRemoteHostFilter(they undo%3Fbetween the two steps) andSettingsSecrets(it also hides values no URI parser can read and a wider userinfo).A non-const
std::stringlvalue still resolves to the in-placebooloverload, so the in-place callers are unchanged; const lvalues and rvalues get the copy.[[nodiscard]]makes a call that expects in-place masking of a const string a build error.No behaviour change.
05212_http_uri_credentials_masked,05404_http_error_body_presigned_credentials_scrubbedand05315_avro_schema_registry_url_credentials_masked(50 randomized runs each) and the twotest_storage_urlindex page tests pass. With the new overload changed to return its input unmasked, all of them and the new gtest case fail. Theurl()log and error text is identical to master.Workflow [PR]
Sync PR [sync-upstream/pr/130533]