tifflhl commented on a change in pull request #8959:
URL: https://github.com/apache/arrow/pull/8959#discussion_r546952806
##########
File path: python/pyarrow/_flight.pyx
##########
@@ -1150,6 +1156,38 @@ cdef class FlightClient(_Weakrefable):
self.client.get().Authenticate(deref(c_options),
move(handler)))
+ def authenticateBasicToken(self, username, password,
+ options: FlightCallOptions = None):
+ """Authenticate to the server with header token authentication.
+
+ Parameters
+ ----------
+ username : string
+ Username to authenticate with
+ password : string
+ Password to authenticate with
+ options : FlightCallOptions
+ Options for this call
+
+ Returns
+ -------
+ pair : pair[string, string]
+ A pair representing the FlightCallOptions header
+ entry of a bearer token.
+ """
+ cdef:
+ CResult[pair[c_string, c_string]] result
+ CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
+ c_string user = tobytes(username)
+ c_string pw = tobytes(password)
+
+ with nogil:
+ result = self.client.get().AuthenticateBasicToken(deref(c_options),
Review comment:
Based on how the C++ code was implemented , the Python wrapper can only
wrap the AuthenticateBasicToken method in the C++ client. Seems like we would
need to expand the C++ client implementation if we were to have C++/Python impl
match the Java client implementation. https://github.com/apache/arrow/pull/8724
-> C++ impl only exposed authenticateBasicToken.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]