kou commented on code in PR #35378:
URL: https://github.com/apache/arrow/pull/35378#discussion_r1181904921


##########
cpp/src/arrow/flight/server_auth.h:
##########
@@ -55,23 +57,68 @@ class ARROW_FLIGHT_EXPORT ServerAuthHandler {
   virtual ~ServerAuthHandler();
   /// \brief Authenticate the client on initial connection. The server
   /// can send and read responses from the client at any time.
-  virtual Status Authenticate(ServerAuthSender* outgoing, ServerAuthReader* 
incoming) = 0;
+  /// \param[in] context The call context.
+  /// \param[in] outgoing The writer for messages to the client.
+  /// \param[in] incoming The reader for messages from the client.
+  /// \return Status OK if this authentication is succeeded.
+  virtual Status Authenticate(const ServerCallContext& context,
+                              ServerAuthSender* outgoing, ServerAuthReader* 
incoming) {
+    // TODO: We can make this pure virtual function when we remove
+    // the duplicated version.
+    ARROW_SUPPRESS_DEPRECATION_WARNING
+    return Authenticate(outgoing, incoming);
+    ARROW_UNSUPPRESS_DEPRECATION_WARNING
+  }
+  /// \brief Authenticate the client on initial connection. The server
+  /// can send and read responses from the client at any time.
+  /// \param[in] outgoing The writer for messages to the client.
+  /// \param[in] incoming The reader for messages from the client.
+  /// \return Status OK if this authentication is succeeded.
+  /// \deprecated Deprecated in 13.0.0. Implement the Authentication()
+  /// with ServerCallContext version instead.
+  ARROW_DEPRECATED("Deprecated in 13.0.0. Use ServerCallContext overload 
instead.")
+  virtual Status Authenticate(ServerAuthSender* outgoing, ServerAuthReader* 
incoming) {
+    return Status::NotImplemented(typeid(this).name(),
+                                  "::Authenticate() isn't implemented");
+  }
+  /// \brief Validate a per-call client token.
+  /// \param[in] token The client token. May be the empty string if
+  /// the client does not provide a token.
+  /// \param[out] peer_identity The identity of the peer, if this
+  /// authentication method supports it.
+  /// \return Status OK if the token is valid, any other status if
+  /// validation failed
+  virtual Status IsValid(const ServerCallContext& context, const std::string& 
token,

Review Comment:
   Good catch!
   I forgot to add it...



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to