[
https://issues.apache.org/jira/browse/RANGER-5187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mahesh Bandal updated RANGER-5187:
----------------------------------
Description:
Steps
1.Create a user and copy the payload
{code}{ "id": 8, "createDate": "2025-02-14T15:21:17Z", "updateDate":
"2025-04-07T13:34:03Z", "owner": "Admin", "updatedBy": "Admin", "name":
"systest", "firstName": "systest", "lastName": "Guest", "password": "*****",
"description": "systest change3", "groupIdList": [], "groupNameList": [],
"status": 1, "isVisible": 1, "userSource": 0, "userRoleList": [ "ROLE_USER" ]
}{code}
2.remove the id from the payload
{code}{ "createDate": "2025-02-14T15:21:17Z", "updateDate":
"2025-04-07T13:34:03Z", "owner": "Admin", "updatedBy": "Admin", "name":
"systest", "firstName": "systest", "lastName": "Guest", "password": "*****",
"description": "systest change3", "groupIdList": [], "groupNameList": [],
"status": 1, "isVisible": 1, "userSource": 0, "userRoleList": [ "ROLE_USER" ]
}{code}
3.Now hit PUT request using curl command.
{code}curl -v -X PUT 'http://localhost:6080/service/xusers/secure/users/8' -u
'admin:Admin123' -H 'Content-Type: application/json' -d '{ "createDate":
"2025-02-14T15:21:17Z", "updateDate": "2025-04-07T13:34:03Z", "owner": "Admin",
"updatedBy": "Admin", "name": "systest", "firstName": "systest", "lastName":
"Guest", "password": "*****", "description": "systest change2", "groupIdList":
[], "groupNameList": [], "status": 1, "isVisible": 1, "userSource": 0,
"userRoleList": [ "ROLE_USER" ] }'{code}
The status code we get is 404 but it should be 400
This is a regression introduced by RANGER-4851
> Getting 404 instead of 400 when we try to edit user without id
> --------------------------------------------------------------
>
> Key: RANGER-5187
> URL: https://issues.apache.org/jira/browse/RANGER-5187
> Project: Ranger
> Issue Type: Bug
> Components: Ranger
> Affects Versions: 3.0.0
> Reporter: Mahesh Bandal
> Assignee: Mahesh Bandal
> Priority: Major
>
> Steps
> 1.Create a user and copy the payload
> {code}{ "id": 8, "createDate": "2025-02-14T15:21:17Z", "updateDate":
> "2025-04-07T13:34:03Z", "owner": "Admin", "updatedBy": "Admin", "name":
> "systest", "firstName": "systest", "lastName": "Guest", "password": "*****",
> "description": "systest change3", "groupIdList": [], "groupNameList": [],
> "status": 1, "isVisible": 1, "userSource": 0, "userRoleList": [ "ROLE_USER" ]
> }{code}
> 2.remove the id from the payload
> {code}{ "createDate": "2025-02-14T15:21:17Z", "updateDate":
> "2025-04-07T13:34:03Z", "owner": "Admin", "updatedBy": "Admin", "name":
> "systest", "firstName": "systest", "lastName": "Guest", "password": "*****",
> "description": "systest change3", "groupIdList": [], "groupNameList": [],
> "status": 1, "isVisible": 1, "userSource": 0, "userRoleList": [ "ROLE_USER" ]
> }{code}
> 3.Now hit PUT request using curl command.
> {code}curl -v -X PUT 'http://localhost:6080/service/xusers/secure/users/8' -u
> 'admin:Admin123' -H 'Content-Type: application/json' -d '{ "createDate":
> "2025-02-14T15:21:17Z", "updateDate": "2025-04-07T13:34:03Z", "owner":
> "Admin", "updatedBy": "Admin", "name": "systest", "firstName": "systest",
> "lastName": "Guest", "password": "*****", "description": "systest change2",
> "groupIdList": [], "groupNameList": [], "status": 1, "isVisible": 1,
> "userSource": 0, "userRoleList": [ "ROLE_USER" ] }'{code}
> The status code we get is 404 but it should be 400
> This is a regression introduced by RANGER-4851
--
This message was sent by Atlassian Jira
(v8.20.10#820010)