otterc commented on code in PR #2441:
URL: https://github.com/apache/celeborn/pull/2441#discussion_r1551888055
##########
common/src/main/scala/org/apache/celeborn/common/rpc/RpcEndpoint.scala:
##########
@@ -134,6 +136,21 @@ trait RpcEndpoint {
rpcEnv.stop(_self)
}
}
+
+ def checkAuth(context: RpcCallContext, appId: String): Unit = {
+ context match {
+ case remoteContext: RemoteNettyRpcCallContext =>
+ checkAuth(remoteContext.transportClient, appId)
+ case _ =>
+ // Do nothing if the context is not RemoteNettyRpcCallContext
+ }
+ }
+
+ private def checkAuth(client: TransportClient, appId: String): Unit = {
+ if (client.getClientId != null && !(client.getClientId == appId))
Review Comment:
Done
##########
common/src/main/scala/org/apache/celeborn/common/rpc/RpcEndpoint.scala:
##########
@@ -134,6 +136,21 @@ trait RpcEndpoint {
rpcEnv.stop(_self)
}
}
+
+ def checkAuth(context: RpcCallContext, appId: String): Unit = {
+ context match {
+ case remoteContext: RemoteNettyRpcCallContext =>
+ checkAuth(remoteContext.transportClient, appId)
+ case _ =>
+ // Do nothing if the context is not RemoteNettyRpcCallContext
+ }
+ }
+
+ private def checkAuth(client: TransportClient, appId: String): Unit = {
+ if (client.getClientId != null && !(client.getClientId == appId))
+ throw new SecurityException(
Review Comment:
Done.
--
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]