-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLICKHOUSE-3832: Add HTTP Basic authentification in replication protocol #2727
Conversation
dbms/programs/server/Server.cpp
Outdated
String password = config().getString("interserver_http_credentials.password", ""); | ||
|
||
if (user.empty()) | ||
throw Exception("Empty interserver_http_credentials user can't be empty"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error code
dbms/programs/server/Server.cpp
Outdated
@@ -230,6 +230,17 @@ int Server::main(const std::vector<std::string> & /*args*/) | |||
global_context->setInterserverIOAddress(this_host, port); | |||
} | |||
|
|||
if (config().has("interserver_http_credentials.user")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe config().has("interserver_http_credentials")
is better.
@@ -65,8 +92,18 @@ void InterserverIOHTTPHandler::handleRequest(Poco::Net::HTTPServerRequest & requ | |||
|
|||
try | |||
{ | |||
processQuery(request, response); | |||
LOG_INFO(log, "Done processing query"); | |||
if (auto [msg, success] = checkAuthentication(request); success) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg
is unused.
... or is it visible in else
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's visible inside else
branch.
… change check for interserver_http_credentials
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en