apurtell commented on a change in pull request #884: HBASE-23347 Allowable 
custom authentication methods for RPCs
URL: https://github.com/apache/hbase/pull/884#discussion_r360609939
 
 

 ##########
 File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcConnection.java
 ##########
 @@ -216,16 +152,16 @@ public void run(Timeout timeout) throws Exception {
     System.arraycopy(HConstants.RPC_HEADER, 0, preamble, 0, rpcHeaderLen);
     preamble[rpcHeaderLen] = HConstants.RPC_CURRENT_VERSION;
     synchronized (this) {
-      preamble[rpcHeaderLen + 1] = authMethod.code;
+      preamble[rpcHeaderLen + 1] = provider.getSaslAuthMethod().getCode();
     }
     return preamble;
   }
 
   protected ConnectionHeader getConnectionHeader() {
-    ConnectionHeader.Builder builder = ConnectionHeader.newBuilder();
+    final ConnectionHeader.Builder builder = ConnectionHeader.newBuilder();
     builder.setServiceName(remoteId.getServiceName());
-    UserInformation userInfoPB;
-    if ((userInfoPB = getUserInfo(remoteId.ticket.getUGI())) != null) {
+    final UserInformation userInfoPB  = 
provider.getUserInfo(remoteId.ticket.getUGI());
 
 Review comment:
   I've seen this relationship represented before as a chain "auth chain", peel 
the layers of auth, and chain the inner method to the outer one. Not advocating 
a change, elsewhere in this ecosystem we have this concept of proxy and "real" 
user both as attributes of the same thing, it's not surprising to see it here 
in HBase too. 

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


With regards,
Apache Git Services

Reply via email to