abbccdda commented on a change in pull request #9103:
URL: https://github.com/apache/kafka/pull/9103#discussion_r511012913



##########
File path: core/src/main/scala/kafka/network/SocketServer.scala
##########
@@ -1005,6 +1013,36 @@ private[kafka] class Processor(val id: Int,
     selector.clearCompletedReceives()
   }
 
+  private def parseEnvelopeRequest(receive: NetworkReceive,
+                                   nowNanos: Long,
+                                   connectionId: String,
+                                   context: RequestContext,
+                                   principalSerde: 
Option[KafkaPrincipalSerde]) = {
+    val envelopeRequest = 
context.parseRequest(receive.payload).request.asInstanceOf[EnvelopeRequest]
+
+    val originalHeader = RequestHeader.parse(envelopeRequest.requestData)
+    // Leave the principal null here is ok since we will fail the request 
during Kafka API handling.
+    val originalPrincipal = if (principalSerde.isDefined)
+      principalSerde.get.deserialize(envelopeRequest.principalData)
+    else
+      null
+
+    // The forwarding broker and the active controller should have the same 
DNS resolution, and we need
+    // to have the original client address for authentication purpose.
+    val originalClientAddress = 
InetAddress.getByName(envelopeRequest.clientHostName)

Review comment:
       So the proposal is simply for saving the unnecessary dns translation? 
Not sure if representing as bytes would also serve the security purpose as well.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to