Skip to content

Commit

Permalink
feat: support meta_server connect to kerberos zookeeper which KDC con…
Browse files Browse the repository at this point in the history
…figuration "rdns = false"
  • Loading branch information
GehaFearless committed Jan 19, 2024
1 parent 1951952 commit a9a496c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/zookeeper/zookeeper_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <utility>

#include "runtime/app_model.h"
#include "runtime/rpc/rpc_address.h"
#include "utils/flags.h"
#include "utils/fmt_logging.h"
#include "zookeeper/proto.h"
Expand All @@ -43,6 +44,10 @@ DSN_DEFINE_string(security,
zookeeper_kerberos_service_name,
"zookeeper",
"zookeeper kerberos service name");
DSN_DEFINE_string(security,
zookeeper_sasl_service_fqdn,
"",
"The fqdn of sasl server name which one connect to zookeeper service");
} // namespace security
} // namespace dsn

Expand Down Expand Up @@ -161,6 +166,11 @@ int zookeeper_session::attach(void *callback_owner, const state_callback &cb)
zoo_sasl_params_t sasl_params = {0};
sasl_params.service = dsn::security::FLAGS_zookeeper_kerberos_service_name;
sasl_params.mechlist = "GSSAPI";
rpc_address addr;
CHECK(addr.from_string_ipv4(dsn::security::FLAGS_zookeeper_sasl_service_fqdn),
"zookeeper_sasl_service_fqdn {} is invalid",
dsn::security::FLAGS_zookeeper_sasl_service_fqdn);
sasl_params.host = dsn::security::FLAGS_zookeeper_sasl_service_fqdn;
_handle = zookeeper_init_sasl(FLAGS_hosts_list,
global_watcher,
FLAGS_timeout_ms,
Expand Down

0 comments on commit a9a496c

Please sign in to comment.