2022-09-19 00:02:09 +00:00
|
|
|
#pragma once
|
2022-09-19 14:19:21 +00:00
|
|
|
|
|
|
|
#include <Parsers/IAST_fwd.h>
|
2022-09-19 00:02:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2022-09-19 14:19:21 +00:00
|
|
|
/// Checks the type of a specified AST and returns true if it can contain a password.
|
|
|
|
bool canContainPassword(const IAST & ast);
|
|
|
|
|
2022-09-19 00:02:09 +00:00
|
|
|
/// Removes a password or its hash from a query if it's specified there or replaces it with some placeholder.
|
|
|
|
/// This function is used to prepare a query for storing in logs (we don't want logs to contain sensitive information).
|
|
|
|
/// The function changes only following types of queries:
|
|
|
|
/// CREATE/ALTER USER.
|
2022-09-19 14:19:21 +00:00
|
|
|
void wipePasswordFromQuery(ASTPtr ast);
|
2022-09-19 00:02:09 +00:00
|
|
|
|
|
|
|
}
|