Rename LoginType to AuthType
Better matches with the configuration file name, which is what a developer coming from an administrator's point of view would think. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -312,7 +312,7 @@ public class Gerrit implements EntryPoint {
|
||||
addLink(menuRight, C.menuSettings(), Link.SETTINGS);
|
||||
menuRight.add(anchor(C.menuSignOut(), "logout"));
|
||||
} else {
|
||||
switch (getConfig().getLoginType()) {
|
||||
switch (getConfig().getAuthType()) {
|
||||
case HTTP:
|
||||
case HTTP_LDAP:
|
||||
break;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class SignInDialog extends AutoCenterDialogBox {
|
||||
public SignInDialog(final Mode signInMode, final String errorMsg) {
|
||||
super(/* auto hide */true, /* modal */true);
|
||||
|
||||
switch (Gerrit.getConfig().getLoginType()) {
|
||||
switch (Gerrit.getConfig().getAuthType()) {
|
||||
case OPENID:
|
||||
panel = new OpenIdLoginPanel(signInMode, errorMsg);
|
||||
break;
|
||||
|
||||
@@ -54,7 +54,7 @@ class ExternalIdPanel extends Composite {
|
||||
});
|
||||
body.add(deleteIdentity);
|
||||
|
||||
switch (Gerrit.getConfig().getLoginType()) {
|
||||
switch (Gerrit.getConfig().getAuthType()) {
|
||||
case OPENID: {
|
||||
final Button linkIdentity = new Button(Util.C.buttonLinkIdentity());
|
||||
linkIdentity.addClickHandler(new ClickHandler() {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
package com.google.gerrit.client.data;
|
||||
|
||||
import com.google.gerrit.client.reviewdb.LoginType;
|
||||
import com.google.gerrit.client.reviewdb.AuthType;
|
||||
import com.google.gerrit.client.reviewdb.Project;
|
||||
|
||||
public class GerritConfig implements Cloneable {
|
||||
@@ -23,7 +23,7 @@ public class GerritConfig implements Cloneable {
|
||||
protected boolean useContributorAgreements;
|
||||
protected boolean useContactInfo;
|
||||
protected boolean allowRegisterNewEmail;
|
||||
protected LoginType loginType;
|
||||
protected AuthType authType;
|
||||
protected boolean useRepoDownload;
|
||||
protected String gitDaemonUrl;
|
||||
protected String sshdAddress;
|
||||
@@ -38,12 +38,12 @@ public class GerritConfig implements Cloneable {
|
||||
canonicalUrl = u;
|
||||
}
|
||||
|
||||
public LoginType getLoginType() {
|
||||
return loginType;
|
||||
public AuthType getAuthType() {
|
||||
return authType;
|
||||
}
|
||||
|
||||
public void setLoginType(final LoginType t) {
|
||||
loginType = t;
|
||||
public void setAuthType(final AuthType t) {
|
||||
authType = t;
|
||||
}
|
||||
|
||||
public GitwebLink getGitwebLink() {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
package com.google.gerrit.client.reviewdb;
|
||||
|
||||
public enum LoginType {
|
||||
public enum AuthType {
|
||||
/** Login relies upon the OpenID standard: {@link "http://openid.net/"} */
|
||||
OPENID,
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.google.gerrit.server.config;
|
||||
|
||||
import com.google.gerrit.client.reviewdb.AccountExternalId;
|
||||
import com.google.gerrit.client.reviewdb.AccountGroup;
|
||||
import com.google.gerrit.client.reviewdb.LoginType;
|
||||
import com.google.gerrit.client.reviewdb.AuthType;
|
||||
import com.google.gerrit.client.reviewdb.SystemConfig;
|
||||
import com.google.gwtjsonrpc.server.SignedToken;
|
||||
import com.google.gwtjsonrpc.server.XsrfException;
|
||||
@@ -33,7 +33,7 @@ import java.util.Set;
|
||||
/** Authentication related settings from {@code gerrit.config}. */
|
||||
@Singleton
|
||||
public class AuthConfig {
|
||||
private final LoginType loginType;
|
||||
private final AuthType loginType;
|
||||
private final String httpHeader;
|
||||
private final String logoutUrl;
|
||||
private final String[] trusted;
|
||||
@@ -73,11 +73,11 @@ public class AuthConfig {
|
||||
return r;
|
||||
}
|
||||
|
||||
private static LoginType toType(final Config cfg) {
|
||||
private static AuthType toType(final Config cfg) {
|
||||
if (isBecomeAnyoneEnabled()) {
|
||||
return LoginType.DEVELOPMENT_BECOME_ANY_ACCOUNT;
|
||||
return AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT;
|
||||
}
|
||||
return ConfigUtil.getEnum(cfg, "auth", null, "type", LoginType.OPENID);
|
||||
return ConfigUtil.getEnum(cfg, "auth", null, "type", AuthType.OPENID);
|
||||
}
|
||||
|
||||
private static boolean isBecomeAnyoneEnabled() {
|
||||
@@ -90,7 +90,7 @@ public class AuthConfig {
|
||||
}
|
||||
|
||||
/** Type of user authentication used by this Gerrit server. */
|
||||
public LoginType getLoginType() {
|
||||
public AuthType getLoginType() {
|
||||
return loginType;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import static com.google.inject.Scopes.SINGLETON;
|
||||
import static com.google.inject.Stage.PRODUCTION;
|
||||
|
||||
import com.google.gerrit.client.data.ApprovalTypes;
|
||||
import com.google.gerrit.client.reviewdb.LoginType;
|
||||
import com.google.gerrit.client.reviewdb.AuthType;
|
||||
import com.google.gerrit.git.ChangeMergeQueue;
|
||||
import com.google.gerrit.git.MergeOp;
|
||||
import com.google.gerrit.git.MergeQueue;
|
||||
@@ -81,7 +81,7 @@ public class GerritGlobalModule extends FactoryModule {
|
||||
return cfg.createChildInjector(modules);
|
||||
}
|
||||
|
||||
private final LoginType loginType;
|
||||
private final AuthType loginType;
|
||||
|
||||
@Inject
|
||||
GerritGlobalModule(final AuthConfig authConfig,
|
||||
|
||||
@@ -81,7 +81,7 @@ public class GerritConfigProvider implements Provider<GerritConfig> {
|
||||
config.setUseContactInfo(contactStore != null && contactStore.isEnabled());
|
||||
config.setAllowRegisterNewEmail(emailSender != null
|
||||
&& emailSender.isEnabled());
|
||||
config.setLoginType(authConfig.getLoginType());
|
||||
config.setAuthType(authConfig.getLoginType());
|
||||
config.setWildProject(wildProject);
|
||||
config.setApprovalTypes(approvalTypes);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ package com.google.gerrit.server.http;
|
||||
import static com.google.inject.Scopes.SINGLETON;
|
||||
|
||||
import com.google.gerrit.client.data.GerritConfig;
|
||||
import com.google.gerrit.client.reviewdb.LoginType;
|
||||
import com.google.gerrit.client.reviewdb.AuthType;
|
||||
import com.google.gerrit.server.CurrentUser;
|
||||
import com.google.gerrit.server.IdentifiedUser;
|
||||
import com.google.gerrit.server.RemotePeer;
|
||||
@@ -42,14 +42,14 @@ import java.net.SocketAddress;
|
||||
|
||||
class WebModule extends FactoryModule {
|
||||
private final Provider<SshInfo> sshInfoProvider;
|
||||
private final LoginType loginType;
|
||||
private final AuthType loginType;
|
||||
|
||||
@Inject
|
||||
WebModule(final Provider<SshInfo> sshInfoProvider, final AuthConfig authConfig) {
|
||||
this(sshInfoProvider, authConfig.getLoginType());
|
||||
}
|
||||
|
||||
WebModule(final Provider<SshInfo> sshInfoProvider, final LoginType loginType) {
|
||||
WebModule(final Provider<SshInfo> sshInfoProvider, final AuthType loginType) {
|
||||
this.sshInfoProvider = sshInfoProvider;
|
||||
this.loginType = loginType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user