mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2026-10-28 16:18:23 +08:00
Secret masking for logging, `SHOW CREATE` and `EXPLAIN` lived in `src/Parsers/FunctionSecretArgumentsFinder.cpp`, a switch on the name of every table function, engine and backup engine that re-implemented their argument grammar by hand and drifted from it. Each registration now declares what is secret in its arguments with a `SecretArgumentsSpec`, a mandatory parameter of `TableFunctionFactory`, `StorageFactory`, `DatabaseFactory`, `BackupFactory` and `DictionarySourceFactory` (and an extra `FunctionFactory` overload for `encrypt`, `HMAC` and friends). Shapes the fields cannot express are `custom` callbacks living in the translation unit of the engine's argument parser. The spec also carries the engine `SETTINGS` to hide (replacing the `SETTINGS_TO_HIDE` includes in `ASTSetQuery`) and the dictionary `SOURCE` keys (replacing the hardcoded list in `ASTFunctionWithKeyValueArguments`). The parser keeps only `AbstractFunction`, the result type and the `ISecretArgumentsFinder` interface. `SecretArgumentsRegistry` implements it by looking the spec up in the factories and is installed by `server`, `local` and `format`; an unregistered engine has every argument hidden. The WebAssembly parser no longer carries the finder. The masking cases of `gtest_Parser.cpp` move to a stateless test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>