You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ab...@apache.org on 2021/04/09 13:53:12 UTC
[kudu] 03/03: [python] KUDU-1884 Make SASL protocol configurable
This is an automated email from the ASF dual-hosted git repository.
abukor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 308673dea705a3c4216e3e967b75eea70f39a850
Author: Attila Bukor <ab...@apache.org>
AuthorDate: Wed Apr 7 14:22:18 2021 +0200
[python] KUDU-1884 Make SASL protocol configurable
Similar to the C++ and Java clients in previous commits, this patch adds
support for configuring sasl_protocol_name in the Python client to match
the server-side Kerberos service principal name.
Change-Id: Iddff06c1a4cc2d07a9bbd08bf03d7c863aa6a645
Reviewed-on: http://gerrit.cloudera.org:8080/17281
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>
Reviewed-by: Grant Henke <gr...@apache.org>
---
python/kudu/client.pyx | 5 ++++-
python/kudu/libkudu_client.pxd | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/python/kudu/client.pyx b/python/kudu/client.pyx
index 8edf511..777ee99 100644
--- a/python/kudu/client.pyx
+++ b/python/kudu/client.pyx
@@ -281,7 +281,7 @@ cdef class Client:
"""
def __cinit__(self, addr_or_addrs, admin_timeout_ms=None,
- rpc_timeout_ms=None):
+ rpc_timeout_ms=None, sasl_protocol_name=None):
cdef:
string c_addr
vector[string] c_addrs
@@ -323,6 +323,9 @@ cdef class Client:
timeout = TimeDelta.from_millis(rpc_timeout_ms)
builder.default_rpc_timeout(timeout.delta)
+ if sasl_protocol_name is not None:
+ builder.sasl_protocol_name(sasl_protocol_name)
+
check_status(builder.Build(&self.client))
# A convenience
diff --git a/python/kudu/libkudu_client.pxd b/python/kudu/libkudu_client.pxd
index 54fc553..dc3b782 100644
--- a/python/kudu/libkudu_client.pxd
+++ b/python/kudu/libkudu_client.pxd
@@ -577,6 +577,8 @@ cdef extern from "kudu/client/client.h" namespace "kudu::client" nogil:
KuduClientBuilder& default_rpc_timeout(const MonoDelta& timeout)
+ KuduClientBuilder& sasl_protocol_name(const string& sasl_protocol_name)
+
Status Build(shared_ptr[KuduClient]* client)
cdef cppclass KuduTabletServer: