[
https://issues.apache.org/jira/browse/RANGER-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606761#comment-17606761
]
Madhan Neethiraj commented on RANGER-3847:
------------------------------------------
[~ramackri] - you are right - incorrect input data should fail with error code
400 (Bad Request) instead of 404 (Not Found). I think this will require an
exception mapper, similar to the one in KMS:
*
[KMSExceptionProvider|https://github.com/apache/ranger/blob/master/kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSExceptionsProvider.java]
Further looking at the REST API in the description, I suggest removing
following APIs from REST interface, as these are meant to be used within Ranger
admin:
* {{POST /service/xaudit/trx_log}}
* {{PUT /service/xaudit/trx_log}}
* {{DELETE /service/xaudit/trx_log/\{id}}}
[~abhayk], [~rmani], [~velraman] - please review if you see any issues in
removing above REST APIs.
> [Ranger] : Http status & Error message is not correct for /xaudit/trx_log
> -------------------------------------------------------------------------
>
> Key: RANGER-3847
> URL: https://issues.apache.org/jira/browse/RANGER-3847
> Project: Ranger
> Issue Type: Bug
> Components: Ranger
> Reporter: Anupam Rai
> Priority: Minor
>
> [Ranger] : Http status & Error message is not correct for /xaudit/trx_log
> Request with bad request : Passing String values
> {code:java}
> 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"
> }' {code}
> Response : 404 Not Found
> Request with proper request : Passing int values
> {code:java}
> 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"
> }' {code}
> Response : ok
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)