Skip to content

Commit

Permalink
[fix](auth)fix simple auth check and default username (apache#35620)
Browse files Browse the repository at this point in the history
fix simple auth check and default username
we should set simple auth to valid by default, and check whether to set
the default username in loginWithUGI
  • Loading branch information
wsjz authored and dataroaring committed May 31, 2024
1 parent b93a175 commit 81fc589
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private static UserGroupInformation loginWithUGI(AuthenticationConfig config) {
String hadoopUserName = ((SimpleAuthenticationConfig) config).getUsername();
if (hadoopUserName == null) {
hadoopUserName = "hadoop";
((SimpleAuthenticationConfig) config).setUsername(hadoopUserName);
LOG.debug(AuthenticationConfig.HADOOP_USER_NAME + " is unset, use default user: hadoop");
}
ugi = UserGroupInformation.createRemoteUser(hadoopUserName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
package org.apache.doris.common.security.authentication;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
public class SimpleAuthenticationConfig extends AuthenticationConfig {
private String username;

@Override
public boolean isValid() {
return StringUtils.isNotEmpty(username);
return true;
}
}

0 comments on commit 81fc589

Please sign in to comment.