ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhay Kulkarni <akulka...@hortonworks.com>
Subject Re: Review Request 68186: RANGER-2181 : Code Improvement To Follow Best Practices
Date Mon, 06 Aug 2018 20:16:19 GMT

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




agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceValidator.java
Line 40 (original), 42 (patched)
<https://reviews.apache.org/r/68186/#comment290024>

    Please consider the regular-expression string as follows.
    
    "^[a-zA-Z0-9_-][a-zA-Z0-9\s_-]{0,254}"
    
    This ensures that service name is not empty, it starts with one non-blank character and
is followed by at most 254 characters including blank characters.



agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceValidator.java
Lines 43 (patched)
<https://reviews.apache.org/r/68186/#comment290021>

    Do we really need a hash table here? It appears that there is only one regular expression
string to be compiled into Pattern. Is having a static Pattern sufficient for this validation?



agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceValidator.java
Lines 284 (patched)
<https://reviews.apache.org/r/68186/#comment290022>

    Please consider checking pattern for a null.



security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Lines 638 (patched)
<https://reviews.apache.org/r/68186/#comment290020>

    Is it allowed to have service-name consisting entirely of blank characters?



security-admin/src/main/webapp/scripts/models/RangerServiceDef.js
Line 60 (original), 60 (patched)
<https://reviews.apache.org/r/68186/#comment290023>

    Please change the message to show correct regular-expression string being used for validation.


- Abhay Kulkarni


On Aug. 6, 2018, 3:14 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68186/
> -----------------------------------------------------------
> 
> (Updated Aug. 6, 2018, 3:14 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj,
Mehul Parikh, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2181
>     https://issues.apache.org/jira/browse/RANGER-2181
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Code Improvement To Follow Best Practices.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/errors/ValidationErrorCode.java
41052dd 
>   agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceValidator.java
1893fb9 
>   agents-common/src/test/java/org/apache/ranger/plugin/model/validation/TestRangerServiceValidator.java
64ccb7d 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java c116ea2 
>   security-admin/src/main/webapp/scripts/models/RangerServiceDef.js 9945044 
>   security-admin/src/main/webapp/styles/xa.css db96ed2 
>   security-admin/src/main/webapp/templates/helpers/XAHelpers.js 8ace4d7 
> 
> 
> Diff: https://reviews.apache.org/r/68186/diff/2/
> 
> 
> Testing
> -------
> 
> 1. Tested Ranger Admin & Ranger KMS rest calls.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message