-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73554/
-----------------------------------------------------------
Review request for ranger, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh,
Ramesh Mani, and Velmurugan Periasamy.
Bugs: RANGER-3384
https://issues.apache.org/jira/browse/RANGER-3384
Repository: ranger
Description
-------
Add input validation to metric GET api.
Currently this API is not doing any sort of input validation. The input is
passed as is to service layer.
Diffs
-----
security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
a50a1f645
security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
7d26b0a8a
security-admin/src/test/java/org/apache/ranger/biz/TestServiceDBStore.java
c4e7de271
security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java
582dcbc46
Diff: https://reviews.apache.org/r/73554/diff/1/
Testing
-------
## In-valid cases
01. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API"
02. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/"
03. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/metric"
04. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json"
"$BASE_ADMIN_URL/$BASE_API/$METRIC_API/user-group"
05. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/audit"
06. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/service"
07. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/policie"
08. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json"
"$BASE_ADMIN_URL/$BASE_API/$METRIC_API/databases"
09. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/metric"
10. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json"
"$BASE_ADMIN_URL/$BASE_API/$METRIC_API/contextenricher"
11. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json"
"$BASE_ADMIN_URL/$BASE_API/$METRIC_API/denycondition"
## Valid cases
1. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json"
"$BASE_ADMIN_URL/$BASE_API/$METRIC_API/usergroup"
2. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/audits"
3. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/services"
4. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/policies"
5. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json" "$BASE_ADMIN_URL/$BASE_API/$METRIC_API/database"
6. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json"
"$BASE_ADMIN_URL/$BASE_API/$METRIC_API/contextenrichers"
7. curl -ik -u admin:admin123 -X GET -H "Accept:application/json" -H
"Content-Type:application/json"
"$BASE_ADMIN_URL/$BASE_API/$METRIC_API/denyconditions"
## Maven Build
mvn clean compile package install -U
Thanks,
Kishor Gollapalliwar