[Improvement-11293][dolphinscheduler-api] remove some variables that redundant in subclasses of AbstractAuthenticator (#11305)
* [fix-10729]The request's url given by the test case looks different from the controller layer. Some usages and parameter format errors * [fix-10729]The request's url given by the test case looks different from the controller layer. Some usages and parameter format errors * [fix-10729]The request's url given by the test case looks different from the controller layer. Some usages and parameter format errors * [fix-10729]The request's url given by the test case looks different from the controller layer. Some usages and parameter format errors * [fix-10729]fix the code smell * [fix-10729]decorate DataSourceControllerTest with public * [fix-10729]replace import * * [fix-10729] * [fix-10729] * [fix-10729] * [fix-10729]checkstyle * [Improvement][ExecutorServiceImpl] remove some unnecessary * [fix-11181]text check and word spell * Update dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java Co-authored-by: Eric Gao <ericgao.apache@gmail.com> * Update dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java Co-authored-by: Eric Gao <ericgao.apache@gmail.com> * Update ExecutorServiceImpl.java remove the error logging and update the comment * Update dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java Co-authored-by: Eric Gao <ericgao.apache@gmail.com> * [Improvement-10760][dolphinscheduler-api] Some variables are redundant * [Improvement-10760][dolphinscheduler-api] Some variables are redundant and fix checkstyle * [Improvement-10760][dolphinscheduler-api] Some variables are redundant and fix checkstyle * [Improvement-10760][dolphinscheduler-api] add import * [Improvement-10760][dolphinscheduler-api] remove not use * [Improvement-11293][dolphinscheduler-api] remove some variables that redundant in subclasses of AbstractAuthenticator * [Improvement-11293][dolphinscheduler-api] remove some variables that redundant in subclasses of AbstractAuthenticator Co-authored-by: fuchanghai <changhai.fu@marketingforce.com> Co-authored-by: Eric Gao <ericgao.apache@gmail.com>
This commit is contained in:
parent
c9cf8c7774
commit
8ded072f79
|
|
@ -41,7 +41,7 @@ public abstract class AbstractAuthenticator implements Authenticator {
|
|||
private static final Logger logger = LoggerFactory.getLogger(AbstractAuthenticator.class);
|
||||
|
||||
@Autowired
|
||||
private UsersService userService;
|
||||
protected UsersService userService;
|
||||
|
||||
@Autowired
|
||||
private SessionService sessionService;
|
||||
|
|
|
|||
|
|
@ -18,14 +18,12 @@
|
|||
package org.apache.dolphinscheduler.api.security.impl.ldap;
|
||||
|
||||
import org.apache.dolphinscheduler.api.security.impl.AbstractAuthenticator;
|
||||
import org.apache.dolphinscheduler.api.service.UsersService;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class LdapAuthenticator extends AbstractAuthenticator {
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
|
||||
@Autowired
|
||||
LdapService ldapService;
|
||||
|
||||
|
|
@ -35,9 +33,9 @@ public class LdapAuthenticator extends AbstractAuthenticator {
|
|||
String ldapEmail = ldapService.ldapLogin(userId, password);
|
||||
if (ldapEmail != null) {
|
||||
//check if user exist
|
||||
user = usersService.getUserByUserName(userId);
|
||||
user = userService.getUserByUserName(userId);
|
||||
if (user == null && ldapService.createIfUserNotExists()) {
|
||||
user = usersService.createUser(ldapService.getUserType(userId), userId, ldapEmail);
|
||||
user = userService.createUser(ldapService.getUserType(userId), userId, ldapEmail);
|
||||
}
|
||||
}
|
||||
return user;
|
||||
|
|
|
|||
|
|
@ -18,14 +18,9 @@
|
|||
package org.apache.dolphinscheduler.api.security.impl.pwd;
|
||||
|
||||
import org.apache.dolphinscheduler.api.security.impl.AbstractAuthenticator;
|
||||
import org.apache.dolphinscheduler.api.service.UsersService;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class PasswordAuthenticator extends AbstractAuthenticator {
|
||||
@Autowired
|
||||
private UsersService userService;
|
||||
|
||||
@Override
|
||||
public User login(String userId, String password, String extra) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue