Repository navigation
Backport #117429 to 26.3: Mask secrets in SHOW CREATE DATABASE of a Backup database - #122669
Conversation
…ackup database
|
Workflow [BackportPR], commit [23252a1] Summary: ✅ |
All 7 builds failed on `src/Parsers/FunctionSecretArgumentsFinder.cpp` with `isAlphaASCII`, `isAlphaNumericASCII` and `equalsCaseInsensitive` undeclared (the `std::all_of` error is a cascade of the second, used inside the lambda). On master those come from `<Common/StringUtils.h>`, which that file includes - but the include was added there by a different commit, not by #117429, so 26.3 never got it. 26.3 also has only the `(char, char)` overload of `equalsCaseInsensitive`, while the backported call site passes a `std::string_view`, so the overload is taken verbatim from master rather than rewriting the call sites to something 26.3 already has. The four existing `equalsCaseInsensitive` call sites on this branch all pass `char`, which `std::string_view` cannot be converted from, so none of them becomes ambiguous. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122669&sha=b297f764fdbb6ce824c8285dc637330b72c40f3e&name_0=BackportPR&name_1=Build%20%28amd_debug%29 Related: #122669 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
@PedroTadim the remaining reds here, and the same ones on #122674 (26.7), come from two master-only prerequisites that #117429's tests assume, not from the backported masking code. Measured on a local debug build of this head and on #122674's own
|
`04510_s3_explicit_url_named_secret_mask` asserts `BAD_ARGUMENTS` for
`AzureBlobStorage('DefaultEndpointsProtocol=...;AccountKey=...;', 'cont',
'blob', 'acct', 'key')`, a connection string written where the five-argument
shape requires a plain storage account URL. On master that arm never reaches
the SDK: `validatePlainStorageAccountURL` rejects it first. Without that
validator the SDK base64-decodes the account key instead and throws
`std::runtime_error`, which surfaces as `STD_EXCEPTION` (Code 1001).
The helper is transplanted verbatim from master and is called from the same
two sites: the five-argument form, and a named collection carrying explicit
credentials. The three-argument form is left unvalidated, as on master.
The failures this fixes:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122669&sha=dd96fc97dd7c07ee43e7a484c08090bae8485a01&name_0=BackportPR
Related: #117429
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`Azure::Core::Url` has no userinfo support, so the three-argument
destination `AzureBlobStorage('http://user:pass@host:port/acct', 'cont',
'blob')` is parsed with `user` as the host, and `std::stoi` then throws a
bare `std::invalid_argument`. On a thread-pool thread a non-`DB::Exception`
reaching `tryLogCurrentException` is a logical error, so a debug or sanitizer
build calls `abortOnFailedAssertion` and the server dies.
`validatePlainStorageAccountURL` does not cover this arm: master validates
the five-argument and named-collection forms only, so the three-argument one
still reaches the SDK and relies on this guard. 26.5, 26.7, 26.8 and master
already have it; 26.3 and 26.4 are the branches without it.
It is transplanted verbatim, so the helper and the three catch sites are
byte-identical to 26.7. With it in place the userinfo arm of
`04510_s3_explicit_url_named_secret_mask` passes here as it does there.
The failures this fixes:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122669&sha=dd96fc97dd7c07ee43e7a484c08090bae8485a01&name_0=BackportPR
Related: #117429
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
The last red here, Test-only fix on top of db46dd3, 3 lines in the Both commits in my earlier comment are obsolete now. #122674 (26.7) needs nothing for |
Master rejects a `.zip` blob path for an object-storage backup destination
before it builds a client, and that is what made both three-argument Azure
controls fail with `BAD_ARGUMENTS` there. 26.3 has no such rejection --
`hasSupportedZipExtension` reaches `registerBackupEngineAzureBlobStorage`
only on 26.7 and later -- so the destination is built, and the
connection-string control spent 4.3s resolving `a.blob.core.windows.net`
before failing with `STD_EXCEPTION`.
Drop that control. What it asserts, that a connection string hides its
AccountKey and nothing else, is already asserted by the named-collection
override control, which keeps `AccountName=visible_04510_acct` visible
beside the hidden key.
Keep the plain-url control, which is the only assertion that a locator
carrying no credential stays visible whole. On 26.3 it fails client-side
with `STD_EXCEPTION` ("Bearer token authentication is not permitted for non
TLS protected (https) endpoints"), reaching no network.
Verified against this PR's own amd_release binary: the test output now
matches the reference exactly.
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122669&sha=db46dd35373525298e5eecb9430e53c83d1607c1&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%201%2F2%29
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Original pull-request #117429
Cherry-pick pull-request #121965
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
26.3.37.3