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

Review request for ranger, Gautam Borad and Madhan Neethiraj.


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


Repository: ranger


Description
-------

Service-def validation checks
- Resources can’t be empty
- A resource definition's names (case-insesitive) and id must be unique.
- Resource graph is valid, i.e. parent values on various levels don’t lead to a 
graph with cycles.  Within a hierarchy the level should be unique.
- Configs collection can be empty, however, if present they should have 
distinct id and names (case-insesitive).
- Type of a config should be among the valid types.
- If type is enum then sub-type should one of the enums, and default value, if 
present should be valid for that enum.
- Policy condition def are optional, however, if specified the id and names 
(case-insesitive) should be distinct.
- policy condition def must specify an evaluator.
- Delete is an idempotent operation.  Validation was complaining if delete is 
performed on non-existing resource.  This has been fixed, too.


Diffs
-----

  
agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerPolicyValidator.java
 7f0318f 
  
agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceDefHelper.java
 6381dfe 
  
agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceDefValidator.java
 0ef7ff9 
  
agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceValidator.java
 2019284 
  
agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerValidator.java
 bc4c7f1 
  
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerObjectFactory.java
 72f0fd5 
  agents-common/src/main/resources/service-defs/ranger-servicedef-kafka.json 
8dc29fe 
  agents-common/src/main/resources/service-defs/ranger-servicedef-kms.json 
b1f6d45 
  
agents-common/src/test/java/org/apache/ranger/plugin/model/validation/TestRangerPolicyValidator.java
 d55cdc5 
  
agents-common/src/test/java/org/apache/ranger/plugin/model/validation/TestRangerServiceDefHelper.java
 a004f84 
  
agents-common/src/test/java/org/apache/ranger/plugin/model/validation/TestRangerServiceDefValidator.java
 1409d2c 
  
agents-common/src/test/java/org/apache/ranger/plugin/model/validation/TestRangerValidator.java
 46f488e 
  
agents-common/src/test/java/org/apache/ranger/plugin/model/validation/ValidationTestUtils.java
 bc4b2c5 
  agents-common/src/test/resources/log4j.properties 12e172b 

Diff: https://reviews.apache.org/r/33960/diff/


Testing
-------

1. Existing tests were updated a few new were added.
2. Each of the above checks were excercised against rest api
3. Each of the service defs in the system can be created and updated against 
new server.  (A few that that ran afoul with the new checks were updated).


Thanks,

Alok Lal

Reply via email to