GetServerInfo: Include configured contributor agreements

When contributor agreements are enabled, include the list of configured
contributor agreements in the `auth` section.

Add support to get the server info via the API, and use this in the
existing agreements acceptance test to verify that the agreements are
returned as expected.

Change-Id: Ie6c8d25a4cd1519e3a42eb4cb3e6aeea77e56651
This commit is contained in:
David Pursehouse
2016-08-22 20:08:52 +09:00
parent 0512b9fdcc
commit cc046735b5
6 changed files with 77 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.extensions.api.config;
import com.google.gerrit.extensions.client.DiffPreferencesInfo;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo;
import com.google.gerrit.extensions.common.ServerInfo;
import com.google.gerrit.extensions.restapi.NotImplementedException;
import com.google.gerrit.extensions.restapi.RestApiException;
@@ -25,6 +26,8 @@ public interface Server {
*/
String getVersion() throws RestApiException;
ServerInfo getInfo() throws RestApiException;
GeneralPreferencesInfo getDefaultPreferences() throws RestApiException;
GeneralPreferencesInfo setDefaultPreferences(GeneralPreferencesInfo in)
throws RestApiException;
@@ -42,6 +45,11 @@ public interface Server {
throw new NotImplementedException();
}
@Override
public ServerInfo getInfo() throws RestApiException {
throw new NotImplementedException();
}
@Override
public GeneralPreferencesInfo getDefaultPreferences()
throws RestApiException {

View File

@@ -22,6 +22,7 @@ import java.util.List;
public class AuthInfo {
public AuthType authType;
public Boolean useContributorAgreements;
public List<AgreementInfo> contributorAgreements;
public List<AccountFieldName> editableAccountFields;
public String loginUrl;
public String loginText;