ChangeJson: Ignore PUSH_CERTIFICATES if GPG API is disabled
GpgApiAdapter throws an exception if the GPG API is disabled. The client respects whether the server advertises signed push is enabled when deciding whether to send the PUSH_CERTIFICATES option, but we can't assume all clients will be so well behaved. Recently in I04ddc340 we started passing this option when generating events, causing breakage when processing a patch set with a push certificate but the GPG API is disabled. Change-Id: I53981d521f67906def7e8d3018f87816d5e43ab9
This commit is contained in:
committed by
Jonathan Nieder
parent
2dd29b7452
commit
d373a09673
@@ -56,6 +56,11 @@ public class GpgApiAdapterImpl implements GpgApiAdapter {
|
||||
this.pushCertCheckerFactory = pushCertCheckerFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GpgKeyInfo> listGpgKeys(AccountResource account)
|
||||
throws RestApiException, GpgException {
|
||||
|
||||
@@ -61,6 +61,11 @@ public class GpgApiModule extends RestApiModule {
|
||||
private static class NoGpgApi implements GpgApiAdapter {
|
||||
private static final String MSG = "GPG key APIs disabled";
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GpgKeyInfo> listGpgKeys(AccountResource account) {
|
||||
throw new NotImplementedException(MSG);
|
||||
|
||||
Reference in New Issue
Block a user