You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Ramesh Mani <rm...@hortonworks.com> on 2019/06/28 22:44:26 UTC

Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

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

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


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


Repository: ranger


Description
-------

RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource


Diffs
-----

  agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
  agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
  agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
  security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
  security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
  security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
  security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
  security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
  security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 


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


Testing
-------

- Verified in LOCAL VM for Patch file upgrade 
- Verified URL policies for HIVE Request.


Thanks,

Ramesh Mani


Re: Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70973/#review216236
-----------------------------------------------------------




agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java
Lines 45 (patched)
<https://reviews.apache.org/r/70973/#comment303363>

    Consider replacing hardcoded initial value, '/', with DEFAULT_PATH_SEPARATOR_CHAR.



agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java
Lines 66 (patched)
<https://reviews.apache.org/r/70973/#comment303364>

    Please remove this blankline.



agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java
Lines 101 (patched)
<https://reviews.apache.org/r/70973/#comment303365>

    This would result in default matcher, which doesn't handle schema prefix in URLs. I guess an instance of Case[in/Sensitive]URL[Wildcard]Matcher would be needed here. Please review.


- Madhan Neethiraj


On June 28, 2019, 10:44 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70973/
> -----------------------------------------------------------
> 
> (Updated June 28, 2019, 10:44 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2480
>     https://issues.apache.org/jira/browse/RANGER-2480
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
>   agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
>   agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
>   security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
>   security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
>   security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
>   security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
>   security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70973/diff/1/
> 
> 
> Testing
> -------
> 
> - Verified in LOCAL VM for Patch file upgrade 
> - Verified URL policies for HIVE Request.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

Posted by Ramesh Mani <rm...@hortonworks.com>.

> On June 29, 2019, 12:05 a.m., Abhay Kulkarni wrote:
> > agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java
> > Lines 201 (patched)
> > <https://reviews.apache.org/r/70973/diff/1/?file=2152867#file2152867line201>
> >
> >     Please ensure that the pathToCheck starts with string in 'ret'. If it does then return substring following 'ret' string. In that case getPath() function is not needed.

we need to have this getPatch method, so the subsequently when we do split and build the elements for resurvice matching we will have "scheme://" added to that list. This I verified and work as expected.


- Ramesh


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


On June 30, 2019, 10:09 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70973/
> -----------------------------------------------------------
> 
> (Updated June 30, 2019, 10:09 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2480
>     https://issues.apache.org/jira/browse/RANGER-2480
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
>   agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
>   agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
>   security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
>   security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
>   security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
>   security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
>   security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70973/diff/2/
> 
> 
> Testing
> -------
> 
> - Verified in LOCAL VM for Patch file upgrade 
> - Verified URL policies for HIVE Request.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70973/#review216237
-----------------------------------------------------------




agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java
Lines 151 (patched)
<https://reviews.apache.org/r/70973/#comment303368>

    If getScheme() returns null, consider returning false.



agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java
Lines 196 (patched)
<https://reviews.apache.org/r/70973/#comment303369>

    Consider renaming this as getPathWithoutScheme()



agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java
Lines 199 (patched)
<https://reviews.apache.org/r/70973/#comment303366>

    Please consider stripping whitespace from pathToCheck before substring operation.



agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java
Lines 201 (patched)
<https://reviews.apache.org/r/70973/#comment303367>

    Please ensure that the pathToCheck starts with string in 'ret'. If it does then return substring following 'ret' string. In that case getPath() function is not needed.


- Abhay Kulkarni


On June 28, 2019, 10:44 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70973/
> -----------------------------------------------------------
> 
> (Updated June 28, 2019, 10:44 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2480
>     https://issues.apache.org/jira/browse/RANGER-2480
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
>   agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
>   agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
>   security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
>   security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
>   security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
>   security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
>   security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70973/diff/1/
> 
> 
> Testing
> -------
> 
> - Verified in LOCAL VM for Patch file upgrade 
> - Verified URL policies for HIVE Request.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70973/#review216318
-----------------------------------------------------------


Ship it!




Ship It!

- Abhay Kulkarni


On July 2, 2019, 6:57 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70973/
> -----------------------------------------------------------
> 
> (Updated July 2, 2019, 6:57 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2480
>     https://issues.apache.org/jira/browse/RANGER-2480
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
>   agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
>   agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
>   security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
>   security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
>   security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
>   security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
>   security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70973/diff/4/
> 
> 
> Testing
> -------
> 
> - Verified in LOCAL VM for Patch file upgrade 
> - Verified URL policies for HIVE Request.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70973/
-----------------------------------------------------------

(Updated July 2, 2019, 6:57 p.m.)


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


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


Repository: ranger


Description
-------

RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
  agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
  agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
  security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
  security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
  security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
  security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
  security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
  security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 


Diff: https://reviews.apache.org/r/70973/diff/4/

Changes: https://reviews.apache.org/r/70973/diff/3-4/


Testing
-------

- Verified in LOCAL VM for Patch file upgrade 
- Verified URL policies for HIVE Request.


Thanks,

Ramesh Mani


Re: Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70973/
-----------------------------------------------------------

(Updated July 2, 2019, 6:48 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 commnets fixed


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


Repository: ranger


Description
-------

RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
  agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
  agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
  security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
  security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
  security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
  security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
  security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
  security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 


Diff: https://reviews.apache.org/r/70973/diff/3/

Changes: https://reviews.apache.org/r/70973/diff/2-3/


Testing
-------

- Verified in LOCAL VM for Patch file upgrade 
- Verified URL policies for HIVE Request.


Thanks,

Ramesh Mani


Re: Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70973/#review216263
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On June 30, 2019, 10:09 p.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70973/
> -----------------------------------------------------------
> 
> (Updated June 30, 2019, 10:09 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2480
>     https://issues.apache.org/jira/browse/RANGER-2480
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
>   agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
>   agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
>   security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
>   security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
>   security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
>   security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
>   security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70973/diff/2/
> 
> 
> Testing
> -------
> 
> - Verified in LOCAL VM for Patch file upgrade 
> - Verified URL policies for HIVE Request.
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>


Re: Review Request 70973: RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70973/
-----------------------------------------------------------

(Updated June 30, 2019, 10:09 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
-------

Fixed review comments


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


Repository: ranger


Description
-------

RANGER-2480:Hive URL Policy doesn't match if recursive flag is on for the url resource


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcher.java PRE-CREATION 
  agents-common/src/main/resources/service-defs/ranger-servicedef-hive.json 370ff56 
  agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/RangerURLResourceMatcherTest.java PRE-CREATION 
  security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 7aa9b3f 
  security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 100ee9e 
  security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql eac6a75 
  security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b836ff1 
  security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql cca959a 
  security-admin/src/main/java/org/apache/ranger/patch/PatchForHiveServiceDefUpdate_J10030.java PRE-CREATION 


Diff: https://reviews.apache.org/r/70973/diff/2/

Changes: https://reviews.apache.org/r/70973/diff/1-2/


Testing
-------

- Verified in LOCAL VM for Patch file upgrade 
- Verified URL policies for HIVE Request.


Thanks,

Ramesh Mani