Remove zkgroup enabled flag
The last remnants of a time before zkgroup have been swept away.
This commit is contained in:
parent
02a296e500
commit
041aed2d72
|
@ -535,7 +535,6 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
|
||||||
ServerSecretParams zkSecretParams = new ServerSecretParams(config.getZkConfig().getServerSecret());
|
ServerSecretParams zkSecretParams = new ServerSecretParams(config.getZkConfig().getServerSecret());
|
||||||
ServerZkProfileOperations zkProfileOperations = new ServerZkProfileOperations(zkSecretParams);
|
ServerZkProfileOperations zkProfileOperations = new ServerZkProfileOperations(zkSecretParams);
|
||||||
ServerZkAuthOperations zkAuthOperations = new ServerZkAuthOperations(zkSecretParams);
|
ServerZkAuthOperations zkAuthOperations = new ServerZkAuthOperations(zkSecretParams);
|
||||||
boolean isZkEnabled = config.getZkConfig().isEnabled();
|
|
||||||
|
|
||||||
AuthFilter<BasicCredentials, AuthenticatedAccount> accountAuthFilter = new BasicCredentialAuthFilter.Builder<AuthenticatedAccount>().setAuthenticator(
|
AuthFilter<BasicCredentials, AuthenticatedAccount> accountAuthFilter = new BasicCredentialAuthFilter.Builder<AuthenticatedAccount>().setAuthenticator(
|
||||||
accountAuthenticator).buildAuthFilter();
|
accountAuthenticator).buildAuthFilter();
|
||||||
|
@ -584,7 +583,7 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
|
||||||
new AttachmentControllerV1(rateLimiters, config.getAwsAttachmentsConfiguration().getAccessKey(), config.getAwsAttachmentsConfiguration().getAccessSecret(), config.getAwsAttachmentsConfiguration().getBucket()),
|
new AttachmentControllerV1(rateLimiters, config.getAwsAttachmentsConfiguration().getAccessKey(), config.getAwsAttachmentsConfiguration().getAccessSecret(), config.getAwsAttachmentsConfiguration().getBucket()),
|
||||||
new AttachmentControllerV2(rateLimiters, config.getAwsAttachmentsConfiguration().getAccessKey(), config.getAwsAttachmentsConfiguration().getAccessSecret(), config.getAwsAttachmentsConfiguration().getRegion(), config.getAwsAttachmentsConfiguration().getBucket()),
|
new AttachmentControllerV2(rateLimiters, config.getAwsAttachmentsConfiguration().getAccessKey(), config.getAwsAttachmentsConfiguration().getAccessSecret(), config.getAwsAttachmentsConfiguration().getRegion(), config.getAwsAttachmentsConfiguration().getBucket()),
|
||||||
new AttachmentControllerV3(rateLimiters, config.getGcpAttachmentsConfiguration().getDomain(), config.getGcpAttachmentsConfiguration().getEmail(), config.getGcpAttachmentsConfiguration().getMaxSizeInBytes(), config.getGcpAttachmentsConfiguration().getPathPrefix(), config.getGcpAttachmentsConfiguration().getRsaSigningKey()),
|
new AttachmentControllerV3(rateLimiters, config.getGcpAttachmentsConfiguration().getDomain(), config.getGcpAttachmentsConfiguration().getEmail(), config.getGcpAttachmentsConfiguration().getMaxSizeInBytes(), config.getGcpAttachmentsConfiguration().getPathPrefix(), config.getGcpAttachmentsConfiguration().getRsaSigningKey()),
|
||||||
new CertificateController(new CertificateGenerator(config.getDeliveryCertificate().getCertificate(), config.getDeliveryCertificate().getPrivateKey(), config.getDeliveryCertificate().getExpiresDays()), zkAuthOperations, isZkEnabled),
|
new CertificateController(new CertificateGenerator(config.getDeliveryCertificate().getCertificate(), config.getDeliveryCertificate().getPrivateKey(), config.getDeliveryCertificate().getExpiresDays()), zkAuthOperations),
|
||||||
new ChallengeController(rateLimitChallengeManager),
|
new ChallengeController(rateLimitChallengeManager),
|
||||||
new DeviceController(pendingDevicesManager, accountsManager, messagesManager, keysDynamoDb, rateLimiters, config.getMaxDevices()),
|
new DeviceController(pendingDevicesManager, accountsManager, messagesManager, keysDynamoDb, rateLimiters, config.getMaxDevices()),
|
||||||
new DirectoryController(directoryCredentialsGenerator),
|
new DirectoryController(directoryCredentialsGenerator),
|
||||||
|
|
|
@ -26,10 +26,6 @@ public class ZkConfig {
|
||||||
@NotNull
|
@NotNull
|
||||||
private byte[] serverPublic;
|
private byte[] serverPublic;
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
@NotNull
|
|
||||||
private Boolean enabled;
|
|
||||||
|
|
||||||
public byte[] getServerSecret() {
|
public byte[] getServerSecret() {
|
||||||
return serverSecret;
|
return serverSecret;
|
||||||
}
|
}
|
||||||
|
@ -37,8 +33,4 @@ public class ZkConfig {
|
||||||
public byte[] getServerPublic() {
|
public byte[] getServerPublic() {
|
||||||
return serverPublic;
|
return serverPublic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnabled() {
|
|
||||||
return enabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,15 +35,13 @@ public class CertificateController {
|
||||||
|
|
||||||
private final CertificateGenerator certificateGenerator;
|
private final CertificateGenerator certificateGenerator;
|
||||||
private final ServerZkAuthOperations serverZkAuthOperations;
|
private final ServerZkAuthOperations serverZkAuthOperations;
|
||||||
private final boolean isZkEnabled;
|
|
||||||
|
|
||||||
private static final String GENERATE_DELIVERY_CERTIFICATE_COUNTER_NAME = name(CertificateGenerator.class, "generateCertificate");
|
private static final String GENERATE_DELIVERY_CERTIFICATE_COUNTER_NAME = name(CertificateGenerator.class, "generateCertificate");
|
||||||
private static final String INCLUDE_E164_TAG_NAME = "includeE164";
|
private static final String INCLUDE_E164_TAG_NAME = "includeE164";
|
||||||
|
|
||||||
public CertificateController(CertificateGenerator certificateGenerator, ServerZkAuthOperations serverZkAuthOperations, boolean isZkEnabled) {
|
public CertificateController(CertificateGenerator certificateGenerator, ServerZkAuthOperations serverZkAuthOperations) {
|
||||||
this.certificateGenerator = certificateGenerator;
|
this.certificateGenerator = certificateGenerator;
|
||||||
this.serverZkAuthOperations = serverZkAuthOperations;
|
this.serverZkAuthOperations = serverZkAuthOperations;
|
||||||
this.isZkEnabled = isZkEnabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Timed
|
@Timed
|
||||||
|
@ -73,9 +71,6 @@ public class CertificateController {
|
||||||
public GroupCredentials getAuthenticationCredentials(@Auth AuthenticatedAccount auth,
|
public GroupCredentials getAuthenticationCredentials(@Auth AuthenticatedAccount auth,
|
||||||
@PathParam("startRedemptionTime") int startRedemptionTime,
|
@PathParam("startRedemptionTime") int startRedemptionTime,
|
||||||
@PathParam("endRedemptionTime") int endRedemptionTime) {
|
@PathParam("endRedemptionTime") int endRedemptionTime) {
|
||||||
if (!isZkEnabled) {
|
|
||||||
throw new WebApplicationException(Response.Status.NOT_FOUND);
|
|
||||||
}
|
|
||||||
if (startRedemptionTime > endRedemptionTime) {
|
if (startRedemptionTime > endRedemptionTime) {
|
||||||
throw new WebApplicationException(Response.Status.BAD_REQUEST);
|
throw new WebApplicationException(Response.Status.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ class CertificateControllerTest {
|
||||||
ImmutableSet.of(AuthenticatedAccount.class, DisabledPermittedAuthenticatedAccount.class)))
|
ImmutableSet.of(AuthenticatedAccount.class, DisabledPermittedAuthenticatedAccount.class)))
|
||||||
.setMapper(SystemMapper.getMapper())
|
.setMapper(SystemMapper.getMapper())
|
||||||
.setTestContainerFactory(new GrizzlyWebTestContainerFactory())
|
.setTestContainerFactory(new GrizzlyWebTestContainerFactory())
|
||||||
.addResource(new CertificateController(certificateGenerator, serverZkAuthOperations, true))
|
.addResource(new CertificateController(certificateGenerator, serverZkAuthOperations))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue