Search before asking
What happened
The API calls to createUser and registerUser were not validated for duplicate username.
|
public Result createUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
|
@RequestParam(value = "userName") String userName, |
|
@RequestParam(value = "userPassword") String userPassword, |
|
@RequestParam(value = "tenantId") int tenantId, |
|
@RequestParam(value = "queue", required = false, defaultValue = "") String queue, |
|
@RequestParam(value = "email") String email, |
|
@RequestParam(value = "phone", required = false) String phone, |
|
@RequestParam(value = "state", required = false) int state) throws Exception { |
|
Map<String, Object> result = |
|
usersService.createUser(loginUser, userName, userPassword, email, tenantId, phone, queue, state); |
|
return returnDataList(result); |
|
} |
|
public Result<Object> registerUser(@RequestParam(value = "userName") String userName, |
|
@RequestParam(value = "userPassword") String userPassword, |
|
@RequestParam(value = "repeatPassword") String repeatPassword, |
|
@RequestParam(value = "email") String email) throws Exception { |
|
userName = ParameterUtils.handleEscapes(userName); |
|
userPassword = ParameterUtils.handleEscapes(userPassword); |
|
repeatPassword = ParameterUtils.handleEscapes(repeatPassword); |
|
email = ParameterUtils.handleEscapes(email); |
|
Map<String, Object> result = usersService.registerUser(userName, userPassword, repeatPassword, email); |
|
return returnDataList(result); |
should refer to the verifyUserName for verification
|
public Result verifyUserName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
|
@RequestParam(value = "userName") String userName) { |
|
return usersService.verifyUserName(userName); |
What you expected to happen
validated for duplicate username when creating or registering a user.
How to reproduce
This is verified by repeatedly calling the API with the same parameters.
Anything else
No response
Version
dev
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
The API calls to
createUserandregisterUserwere not validated for duplicate username.dolphinscheduler/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java
Lines 106 to 117 in c0d7763
dolphinscheduler/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java
Lines 565 to 574 in c0d7763
should refer to the
verifyUserNamefor verificationdolphinscheduler/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java
Lines 494 to 496 in c0d7763
What you expected to happen
validated for duplicate username when creating or registering a user.
How to reproduce
This is verified by repeatedly calling the API with the same parameters.
Anything else
No response
Version
dev
Are you willing to submit PR?
Code of Conduct