[ 
https://issues.apache.org/jira/browse/RANGER-5724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18102048#comment-18102048
 ] 

Sanket Shelar commented on RANGER-5724:
---------------------------------------

Merged in master - 
https://github.com/apache/ranger/commit/59bf21d969d6bd75b1ad3c382bc87fdfac5759d3

> Grant API returns 200 OK for null payload
> -----------------------------------------
>
>                 Key: RANGER-5724
>                 URL: https://issues.apache.org/jira/browse/RANGER-5724
>             Project: Ranger
>          Issue Type: Bug
>          Components: Ranger
>    Affects Versions: 3.0.0
>            Reporter: Sanket Shelar
>            Assignee: Sanket Shelar
>            Priority: Minor
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When invoking the Grant API with a null request payload, the API returns 200 
> OK, whereas it should return a Bad Request (400) with an appropriate 
> validation error.
> *Endpoints:*
> POST /service/plugins/services/grant/\{service}
> POST /service/plugins/secure/services/grant/\{service}
> *Steps to Reproduce:*
>  # Execute the following curl command without a request body:
>  
> curl -iku admin:rangerR0cks! -X POST 
> 'http://localhost:6080/service/plugins/services/grant/cm_hive'
>  
>  # Repeat the same test for:
> POST /service/plugins/secure/services/grant/cm_hive
>  
>  # Observe the HTTP response status.
>  
> *Actual Result:*
>  * Both APIs return *200 OK* even when the request payload is null.
> *Expected Result:*
>  * API should return {*}400 Bad Request{*}.
>  * Proper validation error message should be returned indicating 
> missing/invalid request payload.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to