diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/data/GerritConfig.java b/gerrit-common/src/main/java/com/google/gerrit/common/data/GerritConfig.java index 38901c7072..324f00b4fa 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/data/GerritConfig.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/data/GerritConfig.java @@ -30,6 +30,7 @@ public class GerritConfig implements Cloneable { protected String loginText; protected String httpPasswordUrl; protected String reportBugUrl; + protected boolean gitBasicAuth; protected GitwebConfig gitweb; protected boolean useContributorAgreements; @@ -90,6 +91,14 @@ public class GerritConfig implements Cloneable { reportBugUrl = u; } + public boolean isGitBasicAuth() { + return gitBasicAuth; + } + + public void setGitBasicAuth(boolean gba) { + gitBasicAuth = gba; + } + public String getEditFullNameUrl() { return editFullNameUrl; } diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/SettingsScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/SettingsScreen.java index 97b2efb6de..2c29ab2a54 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/SettingsScreen.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/SettingsScreen.java @@ -29,7 +29,9 @@ public abstract class SettingsScreen extends MenuScreen { if (Gerrit.getConfig().getSshdAddress() != null) { link(Util.C.tabSshKeys(), PageLinks.SETTINGS_SSHKEYS); } - link(Util.C.tabHttpAccess(), PageLinks.SETTINGS_HTTP_PASSWORD); + if (!Gerrit.getConfig().isGitBasicAuth()) { + link(Util.C.tabHttpAccess(), PageLinks.SETTINGS_HTTP_PASSWORD); + } link(Util.C.tabWebIdentities(), PageLinks.SETTINGS_WEBIDENT); link(Util.C.tabMyGroups(), PageLinks.SETTINGS_MYGROUPS); if (Gerrit.getConfig().isUseContributorAgreements()) { diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritConfigProvider.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritConfigProvider.java index 2cea40d187..208d2823d8 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritConfigProvider.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritConfigProvider.java @@ -131,6 +131,8 @@ class GerritConfigProvider implements Provider { config.setReportBugUrl(null); } + config.setGitBasicAuth(authConfig.isGitBasichAuth()); + final Set fields = new HashSet(); for (final Account.FieldName n : Account.FieldName.values()) { if (realm.allowsEdit(n)) {