[jira] [Updated] (RANGER-2560) Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread wu.kehua (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

wu.kehua updated RANGER-2560:
-
Description: 
There is one problem in the method "init()" of class "RangerSolrAuthorizer".

Firstly, the code logic is to get the parameters "useProxyIP", "proxyIPHeader" 
and "solrAppName" from RangerConfiguration, as follows:
{code:java}
useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
proxyIPHeader);
// First get from the -D property
solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
// Override if required from Ranger properties
solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
solrAppName);
{code}
But after that, the code logic is to call "solrPlugin.init()" to parse the 
configuration file, as follows:
{code:java}
configuration.addResourcesForServiceType(serviceType); 
{code}
Due to the opposite logic, the values of the parameters "useProxyIP", 
"proxyIPHeader","solrAppName" and "solrAppName" are not available.

 

  was:
There is one problem in the method "init()" of class "RangerSolrAuthorizer".

Firstly, the code logic is to get the parameters "useProxyIP", 
"proxyIPHeader","solrAppName" and "solrAppName" from RangerConfiguration, as 
follows:
{code:java}
useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
proxyIPHeader);
// First get from the -D property
solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
// Override if required from Ranger properties
solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
solrAppName);
{code}
But after that, the code logic is to call "solrPlugin.init()" to parse the 
configuration file, as follows:
{code:java}
configuration.addResourcesForServiceType(serviceType); 
{code}
Due to the opposite logic, the values of the parameters "useProxyIP", 
"proxyIPHeader","solrAppName" and "solrAppName" are not available.

 


> Solve the problem of the order of the configuration items of the Solr plugin
> 
>
> Key: RANGER-2560
> URL: https://issues.apache.org/jira/browse/RANGER-2560
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: wu.kehua
>Assignee: wu.kehua
>Priority: Major
>  Labels: patch
> Fix For: 2.1.0
>
> Attachments: 
> 0001-RANGER-2560-Solve-the-problem-of-the-order-of-the-co.patch
>
>
> There is one problem in the method "init()" of class "RangerSolrAuthorizer".
> Firstly, the code logic is to get the parameters "useProxyIP", 
> "proxyIPHeader" and "solrAppName" from RangerConfiguration, as follows:
> {code:java}
> useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
> RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
> proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
> proxyIPHeader);
> // First get from the -D property
> solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
> // Override if required from Ranger properties
> solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
> solrAppName);
> {code}
> But after that, the code logic is to call "solrPlugin.init()" to parse the 
> configuration file, as follows:
> {code:java}
> configuration.addResourcesForServiceType(serviceType); 
> {code}
> Due to the opposite logic, the values of the parameters "useProxyIP", 
> "proxyIPHeader","solrAppName" and "solrAppName" are not available.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Re: Review Request 71260: RANGER-2512:RangerRolesRESTClient for serving user group roles to the plugins for evaluation

2019-09-05 Thread Ramesh Mani

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71260/
---

(Updated Sept. 5, 2019, 6 p.m.)


Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, 
Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, 
and Velmurugan Periasamy.


Changes
---

Review comments taken care


Bugs: RANGER-2512
https://issues.apache.org/jira/browse/RANGER-2512


Repository: ranger


Description
---

RANGER-2512:RangerRolesRESTClient for serving user group
 roles to the plugins for evaluation


Diffs (updated)
-

  
agents-common/src/main/java/org/apache/ranger/admin/client/AbstractRangerAdminClient.java
 6367235 
  
agents-common/src/main/java/org/apache/ranger/admin/client/RangerAdminClient.java
 b09a9be 
  
agents-common/src/main/java/org/apache/ranger/admin/client/RangerAdminRESTClient.java
 62d5776 
  
agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPluginInfo.java
 e3f9f15 
  
agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngine.java
 d201aa6 
  
agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineCache.java
 015ca09 
  
agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
 51cd658 
  
agents-common/src/main/java/org/apache/ranger/plugin/service/RangerAuthContext.java
 3d0f107 
  
agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
 8d89a18 
  
agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java 
0e52c31 
  
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTUtils.java 
310f69d 
  agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRoles.java 
PRE-CREATION 
  
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRolesProvider.java
 PRE-CREATION 
  
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRolesUtil.java 
PRE-CREATION 
  
agents-common/src/main/java/org/apache/ranger/plugin/util/ServicePolicies.java 
8c63434 
  
agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
 7180675 
  
knox-agent/src/main/java/org/apache/ranger/admin/client/RangerAdminJersey2RESTClient.java
 f57012e 
  security-admin/src/main/java/org/apache/ranger/biz/AssetMgr.java 63959c9 
  security-admin/src/main/java/org/apache/ranger/biz/RoleDBStore.java 28b2c11 
  security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 
fc4b40d 
  security-admin/src/main/java/org/apache/ranger/common/RangerRoleCache.java 
PRE-CREATION 
  security-admin/src/main/java/org/apache/ranger/db/XXGlobalStateDao.java 
f6b9e1a 
  security-admin/src/main/java/org/apache/ranger/rest/RoleREST.java 25fb085 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 3d44315 


Diff: https://reviews.apache.org/r/71260/diff/5/

Changes: https://reviews.apache.org/r/71260/diff/4-5/


Testing
---

- Testing done in Local Vm for
 1) Role cache file creation along with Policy file.
 2) Role based authorization happening based on the user / group role in the 
plugin.
 3) Ranger Admin now has role version and based on the roles are to be fetched 
to the plugin.
 4) RoleREST
curl -u user:password -H "Accept: application/json" -H "Content-Type: 
application/json" -X GET "http://`hostname 
-f`:6080/service/roles/secure/download/cm_hive?lastKnownRoleVersion=-1"


Thanks,

Ramesh Mani



Re: Review Request 71432: Configure Kerberos for Hive Ranger Client via HS2 configuration

2019-09-05 Thread Denys Kuzmenko via Review Board


> On Sept. 5, 2019, 3:42 p.m., Don Bosco Durai wrote:
> > hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
> > Lines 147 (patched)
> > 
> >
> > What happens if the cluster is already Kerberos enabled?

Before the change, when the cluster was already Kerberos enabled, 
MiscUtil.getUGILoginUser() delegated request to 
UserGroupInformation.getLoginUser() as ugiLoginUser was never set.
After the change it should start using ugiLoginUser.

public static UserGroupInformation getUGILoginUser()
UserGroupInformation ret = ugiLoginUser;
if (ret == null) {
ret = UserGroupInformation.getLoginUser()
}
...
}

public ServicePolicies getServicePoliciesIfUpdated(...) {
UserGroupInformation user = MiscUtil.getUGILoginUser();
boolean isSecureMode = user != null && 
UserGroupInformation.isSecurityEnabled();

if (isSecureMode) {
  PrivilegedAction action = new 
PrivilegedAction() {
public ClientResponse run() {
  WebResource secureWebResource = 
RangerAdminRESTClient.this.createWebResource("/service/plugins/secure/ ...);
  return (ClientResponse)secureWebResource.accept(new 
String[]{"application/json"}).get(ClientResponse.class);
}
  };
  ...
}


- Denys


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71432/#review217591
---


On Sept. 5, 2019, 12:13 p.m., Denys Kuzmenko wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71432/
> ---
> 
> (Updated Sept. 5, 2019, 12:13 p.m.)
> 
> 
> Review request for ranger and Ramesh Mani.
> 
> 
> Bugs: RANGER-2557
> https://issues.apache.org/jira/browse/RANGER-2557
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> In Hive we would like to have possibility to enable Kerberos partially (i.e 
> only Ranger, Atlas and HMS).
> However, since hadoop security is a global flag there are many places that 
> need to be commented out to avoid the UGI cluster wide configuration.
> 
> 
> Diffs
> -
> 
>   agents-audit/src/main/java/org/apache/ranger/audit/provider/MiscUtil.java 
> b7315a922 
>   
> hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
>  bb015c595 
> 
> 
> Diff: https://reviews.apache.org/r/71432/diff/1/
> 
> 
> Testing
> ---
> 
> On local cluster.
> 
> 
> Thanks,
> 
> Denys Kuzmenko
> 
>



[jira] [Updated] (RANGER-2560) Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread wu.kehua (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

wu.kehua updated RANGER-2560:
-
Description: 
There is one problem in the method "init()" of class "RangerSolrAuthorizer".

Firstly, the code logic is to get the parameters "useProxyIP", 
"proxyIPHeader","solrAppName" and "solrAppName" from RangerConfiguration, as 
follows:
{code:java}
useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
proxyIPHeader);
// First get from the -D property
solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
// Override if required from Ranger properties
solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
solrAppName);
{code}
But after that, the code logic is to call "solrPlugin.init()" to parse the 
configuration file, as follows:
{code:java}
configuration.addResourcesForServiceType(serviceType); 
{code}
Due to the opposite logic, the values of the parameters "useProxyIP", 
"proxyIPHeader","solrAppName" and "solrAppName" are not available.

 

  was:
There is one problem in the method "init()" of class "RangerSolrAuthorizer".

Firstly, the code logic is to get the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
follows:
{code:java}
useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
proxyIPHeader);
// First get from the -D property
solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
// Override if required from Ranger properties
solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
solrAppName);
{code}
But after that, the code logic is to call "solrPlugin.init()" to parse the 
configuration file, as follows:
{code:java}
configuration.addResourcesForServiceType(serviceType); 
{code}
Due to the opposite logic, the values of the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" are not available.

 


> Solve the problem of the order of the configuration items of the Solr plugin
> 
>
> Key: RANGER-2560
> URL: https://issues.apache.org/jira/browse/RANGER-2560
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: wu.kehua
>Assignee: wu.kehua
>Priority: Major
>  Labels: patch
> Fix For: 2.1.0
>
> Attachments: 
> 0001-RANGER-2560-Solve-the-problem-of-the-order-of-the-co.patch
>
>
> There is one problem in the method "init()" of class "RangerSolrAuthorizer".
> Firstly, the code logic is to get the parameters "useProxyIP", 
> "proxyIPHeader","solrAppName" and "solrAppName" from RangerConfiguration, as 
> follows:
> {code:java}
> useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
> RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
> proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
> proxyIPHeader);
> // First get from the -D property
> solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
> // Override if required from Ranger properties
> solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
> solrAppName);
> {code}
> But after that, the code logic is to call "solrPlugin.init()" to parse the 
> configuration file, as follows:
> {code:java}
> configuration.addResourcesForServiceType(serviceType); 
> {code}
> Due to the opposite logic, the values of the parameters "useProxyIP", 
> "proxyIPHeader","solrAppName" and "solrAppName" are not available.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Re: Review Request 71438: RANGER-2560 Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread Don Bosco Durai

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71438/#review217590
---


Ship it!




Ship It!

- Don Bosco Durai


On Sept. 5, 2019, 12:12 p.m., Kehua Wu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71438/
> ---
> 
> (Updated Sept. 5, 2019, 12:12 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, 
> Nitin Galave, pengjianhua, Pradeep Agrawal, Ramesh Mani, Selvamohan 
> Neethiraj, Sailaja Polavarapu, sam  rome, Venkat Ranganathan, Velmurugan 
> Periasamy, Qiang Zhang, and Barna Zsombor Klara.
> 
> 
> Bugs: RANGER-2560
> https://issues.apache.org/jira/browse/RANGER-2560
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> There is one problem in the method "init()" of class "RangerSolrAuthorizer".
> 
> Firstly, the code logic is to get the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
> follows:
> 
> useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
> RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
> proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
> proxyIPHeader);
> // First get from the -D property
> solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
> // Override if required from Ranger properties
> solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
> solrAppName);
> But after that, the code logic is to call "solrPlugin.init()" to parse the 
> configuration file, as follows:
> 
> configuration.addResourcesForServiceType(serviceType); 
> Due to the opposite logic, the values of the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" are not available.
> 
> 
> Diffs
> -
> 
>   
> plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
>  f87e531 
> 
> 
> Diff: https://reviews.apache.org/r/71438/diff/1/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Kehua Wu
> 
>



[jira] [Updated] (RANGER-2560) Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread wu.kehua (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

wu.kehua updated RANGER-2560:
-
External issue URL:   (was: https://reviews.apache.org/r/71438/)

> Solve the problem of the order of the configuration items of the Solr plugin
> 
>
> Key: RANGER-2560
> URL: https://issues.apache.org/jira/browse/RANGER-2560
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: wu.kehua
>Assignee: wu.kehua
>Priority: Major
>  Labels: patch
> Fix For: 2.1.0
>
> Attachments: 
> 0001-RANGER-2560-Solve-the-problem-of-the-order-of-the-co.patch
>
>
> There is one problem in the method "init()" of class "RangerSolrAuthorizer".
> Firstly, the code logic is to get the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
> follows:
> {code:java}
> useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
> RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
> proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
> proxyIPHeader);
> // First get from the -D property
> solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
> // Override if required from Ranger properties
> solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
> solrAppName);
> {code}
> But after that, the code logic is to call "solrPlugin.init()" to parse the 
> configuration file, as follows:
> {code:java}
> configuration.addResourcesForServiceType(serviceType); 
> {code}
> Due to the opposite logic, the values of the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" are not available.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Review Request 71432: Configure Kerberos for Hive Ranger Client via HS2 configuration

2019-09-05 Thread Denys Kuzmenko via Review Board

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71432/
---

Review request for ranger and Ramesh Mani.


Bugs: RANGER-2557
https://issues.apache.org/jira/browse/RANGER-2557


Repository: ranger


Description
---

In Hive we would like to have possibility to enable Kerberos partially (i.e 
only Ranger, Atlas and HMS).
However, since hadoop security is a global flag there are many places that need 
to be commented out to avoid the UGI cluster wide configuration.


Diffs
-

  agents-audit/src/main/java/org/apache/ranger/audit/provider/MiscUtil.java 
b7315a922 
  
hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
 bb015c595 


Diff: https://reviews.apache.org/r/71432/diff/1/


Testing
---

On local cluster.


Thanks,

Denys Kuzmenko



[jira] [Updated] (RANGER-2560) Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread wu.kehua (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

wu.kehua updated RANGER-2560:
-
External issue URL: https://reviews.apache.org/r/71438/

> Solve the problem of the order of the configuration items of the Solr plugin
> 
>
> Key: RANGER-2560
> URL: https://issues.apache.org/jira/browse/RANGER-2560
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: wu.kehua
>Assignee: wu.kehua
>Priority: Major
>  Labels: patch
> Fix For: 2.1.0
>
> Attachments: 
> 0001-RANGER-2560-Solve-the-problem-of-the-order-of-the-co.patch
>
>
> There is one problem in the method "init()" of class "RangerSolrAuthorizer".
> Firstly, the code logic is to get the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
> follows:
> {code:java}
> useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
> RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
> proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
> proxyIPHeader);
> // First get from the -D property
> solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
> // Override if required from Ranger properties
> solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
> solrAppName);
> {code}
> But after that, the code logic is to call "solrPlugin.init()" to parse the 
> configuration file, as follows:
> {code:java}
> configuration.addResourcesForServiceType(serviceType); 
> {code}
> Due to the opposite logic, the values of the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" are not available.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Review Request 71438: RANGER-2560 Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread Kehua Wu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71438/
---

Review request for ranger, Ankita Sinha, Don Bosco Durai, Colm O hEigeartaigh, 
Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Nitin Galave, 
pengjianhua, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja 
Polavarapu, sam  rome, Venkat Ranganathan, Velmurugan Periasamy, Qiang Zhang, 
and Barna Zsombor Klara.


Bugs: RANGER-2560
https://issues.apache.org/jira/browse/RANGER-2560


Repository: ranger


Description
---

There is one problem in the method "init()" of class "RangerSolrAuthorizer".

Firstly, the code logic is to get the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
follows:

useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
proxyIPHeader);
// First get from the -D property
solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
// Override if required from Ranger properties
solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
solrAppName);
But after that, the code logic is to call "solrPlugin.init()" to parse the 
configuration file, as follows:

configuration.addResourcesForServiceType(serviceType); 
Due to the opposite logic, the values of the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" are not available.


Diffs
-

  
plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
 f87e531 


Diff: https://reviews.apache.org/r/71438/diff/1/


Testing
---


Thanks,

Kehua Wu



[jira] [Updated] (RANGER-2560) Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread wu.kehua (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

wu.kehua updated RANGER-2560:
-
Attachment: 0001-RANGER-2560-Solve-the-problem-of-the-order-of-the-co.patch

> Solve the problem of the order of the configuration items of the Solr plugin
> 
>
> Key: RANGER-2560
> URL: https://issues.apache.org/jira/browse/RANGER-2560
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: wu.kehua
>Assignee: wu.kehua
>Priority: Major
>  Labels: patch
> Fix For: 2.1.0
>
> Attachments: 
> 0001-RANGER-2560-Solve-the-problem-of-the-order-of-the-co.patch
>
>
> There is one problem in the method "init()" of class "RangerSolrAuthorizer".
> Firstly, the code logic is to get the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
> follows:
> {code:java}
> useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
> RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
> proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
> proxyIPHeader);
> // First get from the -D property
> solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
> // Override if required from Ranger properties
> solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
> solrAppName);
> {code}
> But after that, the code logic is to call "solrPlugin.init()" to parse the 
> configuration file, as follows:
> {code:java}
> configuration.addResourcesForServiceType(serviceType); 
> {code}
> Due to the opposite logic, the values of the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" are not available.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Created] (RANGER-2560) Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread wu.kehua (Jira)
wu.kehua created RANGER-2560:


 Summary: Solve the problem of the order of the configuration items 
of the Solr plugin
 Key: RANGER-2560
 URL: https://issues.apache.org/jira/browse/RANGER-2560
 Project: Ranger
  Issue Type: Bug
  Components: Ranger
Reporter: wu.kehua
Assignee: wu.kehua
 Fix For: 2.1.0


There is one problem in the method "init()" of class "RangerSolrAuthorizer".

Firstly, the code logic is to get the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
follows:

 
{code:java}
useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
proxyIPHeader);
// First get from the -D property
solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
// Override if required from Ranger properties
solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
solrAppName);
{code}
But after that, the code logic is to call "solrPlugin.init()" to parse the 
configuration file, as follows:

 
{code:java}
configuration.addResourcesForServiceType(serviceType); 
{code}
Due to the opposite logic, the values of the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" are not available.

 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Updated] (RANGER-2560) Solve the problem of the order of the configuration items of the Solr plugin

2019-09-05 Thread wu.kehua (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-2560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

wu.kehua updated RANGER-2560:
-
Description: 
There is one problem in the method "init()" of class "RangerSolrAuthorizer".

Firstly, the code logic is to get the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
follows:
{code:java}
useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
proxyIPHeader);
// First get from the -D property
solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
// Override if required from Ranger properties
solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
solrAppName);
{code}
But after that, the code logic is to call "solrPlugin.init()" to parse the 
configuration file, as follows:
{code:java}
configuration.addResourcesForServiceType(serviceType); 
{code}
Due to the opposite logic, the values of the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" are not available.

 

  was:
There is one problem in the method "init()" of class "RangerSolrAuthorizer".

Firstly, the code logic is to get the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
follows:

 
{code:java}
useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
proxyIPHeader);
// First get from the -D property
solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
// Override if required from Ranger properties
solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
solrAppName);
{code}
But after that, the code logic is to call "solrPlugin.init()" to parse the 
configuration file, as follows:

 
{code:java}
configuration.addResourcesForServiceType(serviceType); 
{code}
Due to the opposite logic, the values of the parameters "useProxyIP", 
"useProxyIP","solrAppName" and "solrAppName" are not available.

 


> Solve the problem of the order of the configuration items of the Solr plugin
> 
>
> Key: RANGER-2560
> URL: https://issues.apache.org/jira/browse/RANGER-2560
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: wu.kehua
>Assignee: wu.kehua
>Priority: Major
>  Labels: patch
> Fix For: 2.1.0
>
>
> There is one problem in the method "init()" of class "RangerSolrAuthorizer".
> Firstly, the code logic is to get the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" from RangerConfiguration, as 
> follows:
> {code:java}
> useProxyIP = RangerConfiguration.getInstance().getBoolean(useProxyIP = 
> RangerConfiguration.getInstance().getBoolean( PROP_USE_PROXY_IP, useProxyIP);
> proxyIPHeader = RangerConfiguration.getInstance().get( PROP_PROXY_IP_HEADER, 
> proxyIPHeader);
> // First get from the -D property
> solrAppName = System.getProperty("solr.kerberos.jaas.appname", solrAppName);
> // Override if required from Ranger properties
> solrAppName = RangerConfiguration.getInstance().get( PROP_SOLR_APP_NAME, 
> solrAppName);
> {code}
> But after that, the code logic is to call "solrPlugin.init()" to parse the 
> configuration file, as follows:
> {code:java}
> configuration.addResourcesForServiceType(serviceType); 
> {code}
> Due to the opposite logic, the values of the parameters "useProxyIP", 
> "useProxyIP","solrAppName" and "solrAppName" are not available.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)