----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/74135/ -----------------------------------------------------------
(Updated Sept. 22, 2022, 4:45 a.m.) Review request for ranger, Abhay Kulkarni, Madhan Neethiraj, Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy. Bugs: RANGER-3847 https://issues.apache.org/jira/browse/RANGER-3847 Repository: ranger Description ------- In Ranger rest API if you pass an Invalid attribute type in the JSON request body, it throws a 404 error instead of 400 (Bad Request). It seems a bug where we need to handle the JsonMappingException by adding Exception Mapper globally to handle incorrect JSON format or Invalid attribute type in the JSON request body otherwise our Rest API will throw a 404 error instead of 400 error Diffs (updated) ----- security-admin/src/main/java/org/apache/ranger/common/RangerExceptionProvider.java PRE-CREATION Diff: https://reviews.apache.org/r/74135/diff/2/ Changes: https://reviews.apache.org/r/74135/diff/1-2/ Testing ------- Request with proper request : Passing int values curl --location --request POST 'https://----------------/service/xaudit/trx_log' \ --header 'Authorization: Basic XXXX=' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data-raw '{ "objectClassType" : "123456", "objectId" : "1234567" }' Response : ok Request with bad request : Passing String values curl --location --request POST 'https://---------/service/xaudit/trx_log' \ --header 'Authorization: Basic XXXXX==' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data-raw '{ "objectClassType" : "abcdef", "objectId" : "abcdef" }' Response : { "errorCode": "Bad Request", "error": "Can not construct instance of int from String value 'abcdef': not a valid Integer value\n at [Source: org.apache.catalina.connector.CoyoteInputStream@2c444edc; line: 1, column: 2] (through reference chain: org.apache.ranger.view.VXTrxLog[\"objectClassType\"])" } Thanks, Ramachandran Krishnan