Hide secrets inside query in client command (in top/ps)#79507
Hide secrets inside query in client command (in top/ps)#79507aaaengel wants to merge 7 commits intoClickHouse:masterfrom
Conversation
| static const SecretRule rules[] = { | ||
| {"s3"sv, {1, 2}}, | ||
| {"s3Cluster"sv, {2, 3}}, | ||
| {"remote"sv, {4}}, |
There was a problem hiding this comment.
For remote/remoteSecure we can have two options -
ClickHouse/src/TableFunctions/TableFunctionRemote.cpp
Lines 103 to 104 in c588f9f
I guess it is OK to simply hide both
| bool isIdentChar(char c); | ||
| char * mask(char * begin, char * end); | ||
| void shrederSecretInQuery(char* query); |
There was a problem hiding this comment.
This functions used only internally, we don't need to expose them, let's declare them either static on .cpp and remove from .h
| for (const auto & r : rules) | ||
| if (ident == r.func) | ||
| { | ||
| secret = r.secret_pos; | ||
| break; | ||
| } |
There was a problem hiding this comment.
| for (const auto & r : rules) | |
| if (ident == r.func) | |
| { | |
| secret = r.secret_pos; | |
| break; | |
| } | |
| for (const auto & r : rules) | |
| { | |
| if (ident == r.func) | |
| { | |
| secret = r.secret_pos; | |
| break; | |
| } | |
| } |
| return begin; | ||
| } | ||
|
|
||
| void shrederSecretInQuery(char * query) |
There was a problem hiding this comment.
I guess it does not worth to use Lexer here, so OK
|
|
||
| bool in_quote = false; | ||
| size_t arg_idx = 0; | ||
| char * quote_beg = nullptr; |
There was a problem hiding this comment.
Please do not abuse abbrevs for variable names, i.e. no need to use beg over begin (maybe I missed something as well)
|
Dear @azat, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
|
Dear @azat, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Changelog category:
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Hide secrets inside query in client command (in
top/ps) fors3,s3Cluster,remote,remoteSecure,mysql,postgresql,mongodbfunctions.Documentation entry for user-facing changes
After ps appear as
Closes #65549