Github user interma commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1250#discussion_r120274725
  
    --- Diff: 
ranger-plugin/service/src/main/java/org/apache/hawq/ranger/authorization/RangerHawqPluginResource.java
 ---
    @@ -45,8 +47,43 @@
         /**
          * Constructor. Creates a new instance of the resource that uses 
<code>RangerHawqAuthorizer</code>.
          */
    -    public RangerHawqPluginResource() {
    +    public RangerHawqPluginResource()
    +    {
    +        // set UserGroupInformation under kerberos authentication
    +        if (Utils.getAuth().equals("kerberos"))
    --- End diff --
    
    Yes, but I think use 
`org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod` is 
better:
    ```
      public static enum AuthenticationMethod {
        // currently we support only one auth per method, but eventually a 
        // subtype is needed to differentiate, ex. if digest is token or ldap
        SIMPLE(AuthMethod.SIMPLE,
            HadoopConfiguration.SIMPLE_CONFIG_NAME),
        KERBEROS(AuthMethod.KERBEROS,
            HadoopConfiguration.USER_KERBEROS_CONFIG_NAME),
        TOKEN(AuthMethod.TOKEN),
        CERTIFICATE(null),
        KERBEROS_SSL(null),
        PROXY(null);
    ```
    Let's refactor it in future, keep it as it is now. 


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to