accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <...@git.apache.org>
Subject [GitHub] accumulo pull request #273: ACCUMULO-4665 Use UGI with real Kerberos credent...
Date Mon, 26 Jun 2017 20:35:54 GMT
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/273#discussion_r124113747
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java ---
    @@ -282,21 +283,39 @@ public static TTransport createClientTransport(HostAndPort address,
int timeout,
             try {
               // Log in via UGI, ensures we have logged in with our KRB credentials
               final UserGroupInformation currentUser = UserGroupInformation.getCurrentUser();
    +          final UserGroupInformation userForRpc;
    +          if (AuthenticationMethod.PROXY == currentUser.getAuthenticationMethod()) {
    +            // A "proxy" user is when the real (Kerberos) credentials are for a user
    +            // other than the one we're acting as. When we make an RPC though, we need
to make sure
    +            // that the current user is the user that has some credentials.
    +            if (currentUser.getRealUser() != null) {
    +              userForRpc = currentUser.getRealUser();
    +              log.trace("{} is a proxy user, using real user instead {}", currentUser,
userForRpc);
    +            } else {
    +              // The current user has no credentials, let it fail naturally at the RPC
layer (no ticket)
    +              // We know this won't work, but we can't do anything else
    +              log.warn("The current user is a proxy user but there is no underlying real
user (RPCs will fail): {}", currentUser);
    --- End diff --
    
    Mostly, because it is a "best guess". This code is essentially reverting strict assertions
because I thought I knew how things were going to work in practice.
    
    I should update the comment to be a little less strongly worded.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message