zhongjiajie commented on code in PR #10451:
URL: https://github.com/apache/dolphinscheduler/pull/10451#discussion_r899712941
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/security/impl/ldap/LdapAuthenticator.java:
##########
@@ -37,7 +38,10 @@ public User login(String userId, String password, String
extra) {
//check if user exist
user = usersService.getUserByUserName(userId);
if (user == null) {
- user =
usersService.createUser(ldapService.getUserType(userId), userId, ldapEmail);
+ LdapUserNotExistActionType type =
ldapService.getLdapUserNotExistAction();
+ if(type == LdapUserNotExistActionType.CREATE){
+ user =
usersService.createUser(ldapService.getUserType(userId), userId, ldapEmail);
+ }
Review Comment:
NIT, Since we only check whether ldap action is created now, maybe we can
add a function named `createIfUserNotExists` in `ladService` and we here can
use
```suggestion
if(ldapService.createIfUserNotExists()){
user =
usersService.createUser(ldapService.getUserType(userId), userId, ldapEmail);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]