Skip to content

Commit 8c3ebdc

Browse files
committed
Remove obsolete ArtController
1 parent 0593e9e commit 8c3ebdc

File tree

12 files changed

+14
-182
lines changed

12 files changed

+14
-182
lines changed

service/config/sample-secrets-bundle.yml

-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ paymentsService.userAuthenticationTokenSharedSecret: AAAAAAAAAAAAAAAAAAAAAAAAAAA
8989
paymentsService.fixerApiKey: unset
9090
paymentsService.coinMarketCapApiKey: unset
9191

92-
artService.userAuthenticationTokenSharedSecret: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= # base64-encoded 32-byte secret not shared with any external service, but used in ArtController
93-
artService.userAuthenticationTokenUserIdSecret: AAAAAAAAAAA= # base64-encoded secret to obscure user phone numbers from Sticker Creator
94-
9592
currentReportingKey.secret: AAAAAAAAAAA=
9693
currentReportingKey.salt: AAAAAAAAAAA=
9794

service/config/sample.yml

-4
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,6 @@ paymentsService:
331331
coinMarketCapCurrencyIds:
332332
MOB: 7878
333333

334-
artService:
335-
userAuthenticationTokenSharedSecret: secret://artService.userAuthenticationTokenSharedSecret
336-
userAuthenticationTokenUserIdSecret: secret://artService.userAuthenticationTokenUserIdSecret
337-
338334
badges:
339335
badges:
340336
- id: TEST

service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java

-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.whispersystems.textsecuregcm.configuration.ApnConfiguration;
1818
import org.whispersystems.textsecuregcm.configuration.AppleAppStoreConfiguration;
1919
import org.whispersystems.textsecuregcm.configuration.AppleDeviceCheckConfiguration;
20-
import org.whispersystems.textsecuregcm.configuration.ArtServiceConfiguration;
2120
import org.whispersystems.textsecuregcm.configuration.AwsCredentialsProviderFactory;
2221
import org.whispersystems.textsecuregcm.configuration.BadgesConfiguration;
2322
import org.whispersystems.textsecuregcm.configuration.BraintreeConfiguration;
@@ -217,11 +216,6 @@ public class WhisperServerConfiguration extends Configuration {
217216
@JsonProperty
218217
private PaymentsServiceConfiguration paymentsService;
219218

220-
@Valid
221-
@NotNull
222-
@JsonProperty
223-
private ArtServiceConfiguration artService;
224-
225219
@Valid
226220
@NotNull
227221
@JsonProperty
@@ -469,10 +463,6 @@ public PaymentsServiceConfiguration getPaymentsServiceConfiguration() {
469463
return paymentsService;
470464
}
471465

472-
public ArtServiceConfiguration getArtServiceConfiguration() {
473-
return artService;
474-
}
475-
476466
public ZkConfig getZkConfig() {
477467
return zkConfig;
478468
}

service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
import org.whispersystems.textsecuregcm.controllers.AccountController;
109109
import org.whispersystems.textsecuregcm.controllers.AccountControllerV2;
110110
import org.whispersystems.textsecuregcm.controllers.ArchiveController;
111-
import org.whispersystems.textsecuregcm.controllers.ArtController;
112111
import org.whispersystems.textsecuregcm.controllers.AttachmentControllerV4;
113112
import org.whispersystems.textsecuregcm.controllers.CallLinkController;
114113
import org.whispersystems.textsecuregcm.controllers.CallRoutingController;
@@ -214,9 +213,6 @@
214213
import org.whispersystems.textsecuregcm.storage.AccountPrincipalSupplier;
215214
import org.whispersystems.textsecuregcm.storage.Accounts;
216215
import org.whispersystems.textsecuregcm.storage.AccountsManager;
217-
import org.whispersystems.textsecuregcm.storage.devicecheck.AppleDeviceCheckManager;
218-
import org.whispersystems.textsecuregcm.storage.devicecheck.AppleDeviceCheckTrustAnchor;
219-
import org.whispersystems.textsecuregcm.storage.devicecheck.AppleDeviceChecks;
220216
import org.whispersystems.textsecuregcm.storage.ChangeNumberManager;
221217
import org.whispersystems.textsecuregcm.storage.ClientPublicKeys;
222218
import org.whispersystems.textsecuregcm.storage.ClientPublicKeysManager;
@@ -244,6 +240,9 @@
244240
import org.whispersystems.textsecuregcm.storage.Subscriptions;
245241
import org.whispersystems.textsecuregcm.storage.VerificationSessionManager;
246242
import org.whispersystems.textsecuregcm.storage.VerificationSessions;
243+
import org.whispersystems.textsecuregcm.storage.devicecheck.AppleDeviceCheckManager;
244+
import org.whispersystems.textsecuregcm.storage.devicecheck.AppleDeviceCheckTrustAnchor;
245+
import org.whispersystems.textsecuregcm.storage.devicecheck.AppleDeviceChecks;
247246
import org.whispersystems.textsecuregcm.subscriptions.AppleAppStoreManager;
248247
import org.whispersystems.textsecuregcm.subscriptions.BankMandateTranslator;
249248
import org.whispersystems.textsecuregcm.subscriptions.BraintreeManager;
@@ -582,8 +581,6 @@ public void run(WhisperServerConfiguration config, Environment environment) thro
582581
config.getSecureStorageServiceConfiguration());
583582
ExternalServiceCredentialsGenerator paymentsCredentialsGenerator = PaymentsController.credentialsGenerator(
584583
config.getPaymentsServiceConfiguration());
585-
ExternalServiceCredentialsGenerator artCredentialsGenerator = ArtController.credentialsGenerator(
586-
config.getArtServiceConfiguration());
587584
ExternalServiceCredentialsGenerator svr2CredentialsGenerator = SecureValueRecovery2Controller.credentialsGenerator(
588585
config.getSvr2Configuration());
589586

@@ -1101,7 +1098,6 @@ protected void configureServer(final ServerBuilder<?> serverBuilder) {
11011098
usernameHashZkProofVerifier),
11021099
new AccountControllerV2(accountsManager, changeNumberManager, phoneVerificationTokenManager,
11031100
registrationLockVerificationManager, rateLimiters),
1104-
new ArtController(rateLimiters, artCredentialsGenerator),
11051101
new AttachmentControllerV4(rateLimiters, gcsAttachmentGenerator, tusAttachmentGenerator,
11061102
experimentEnrollmentManager),
11071103
new ArchiveController(backupAuthManager, backupManager),

service/src/main/java/org/whispersystems/textsecuregcm/configuration/ArtServiceConfiguration.java

-21
This file was deleted.

service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArtController.java

-52
This file was deleted.

service/src/main/java/org/whispersystems/textsecuregcm/grpc/ExternalServiceDefinitions.java

-10
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,11 @@
1616
import org.signal.chat.credentials.ExternalServiceType;
1717
import org.whispersystems.textsecuregcm.WhisperServerConfiguration;
1818
import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator;
19-
import org.whispersystems.textsecuregcm.configuration.ArtServiceConfiguration;
2019
import org.whispersystems.textsecuregcm.configuration.DirectoryV2ClientConfiguration;
2120
import org.whispersystems.textsecuregcm.configuration.PaymentsServiceConfiguration;
2221
import org.whispersystems.textsecuregcm.configuration.SecureValueRecovery2Configuration;
2322

2423
enum ExternalServiceDefinitions {
25-
ART(ExternalServiceType.EXTERNAL_SERVICE_TYPE_ART, (chatConfig, clock) -> {
26-
final ArtServiceConfiguration cfg = chatConfig.getArtServiceConfiguration();
27-
return ExternalServiceCredentialsGenerator
28-
.builder(cfg.userAuthenticationTokenSharedSecret())
29-
.withUserDerivationKey(cfg.userAuthenticationTokenUserIdSecret())
30-
.prependUsername(false)
31-
.truncateSignature(false)
32-
.build();
33-
}),
3424
DIRECTORY(ExternalServiceType.EXTERNAL_SERVICE_TYPE_DIRECTORY, (chatConfig, clock) -> {
3525
final DirectoryV2ClientConfiguration cfg = chatConfig.getDirectoryV2Configuration().getDirectoryV2ClientConfiguration();
3626
return ExternalServiceCredentialsGenerator

service/src/main/proto/org/signal/chat/credentials.proto

+4-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ service ExternalServiceCredentialsAnonymous {
4949

5050
enum ExternalServiceType {
5151
EXTERNAL_SERVICE_TYPE_UNSPECIFIED = 0;
52-
EXTERNAL_SERVICE_TYPE_ART = 1;
53-
EXTERNAL_SERVICE_TYPE_DIRECTORY = 2;
54-
EXTERNAL_SERVICE_TYPE_PAYMENTS = 3;
55-
EXTERNAL_SERVICE_TYPE_STORAGE = 4;
56-
EXTERNAL_SERVICE_TYPE_SVR = 5;
52+
EXTERNAL_SERVICE_TYPE_DIRECTORY = 1;
53+
EXTERNAL_SERVICE_TYPE_PAYMENTS = 2;
54+
EXTERNAL_SERVICE_TYPE_STORAGE = 3;
55+
EXTERNAL_SERVICE_TYPE_SVR = 4;
5756
}
5857

5958
message GetExternalServiceCredentialsRequest {

service/src/test/java/org/whispersystems/textsecuregcm/controllers/ArtControllerTest.java

-56
This file was deleted.

service/src/test/java/org/whispersystems/textsecuregcm/grpc/ExternalServiceCredentialsGrpcServiceTest.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
public class ExternalServiceCredentialsGrpcServiceTest
4444
extends SimpleBaseGrpcTest<ExternalServiceCredentialsGrpcService, ExternalServiceCredentialsGrpc.ExternalServiceCredentialsBlockingStub> {
4545

46-
private static final ExternalServiceCredentialsGenerator ART_CREDENTIALS_GENERATOR = Mockito.spy(ExternalServiceCredentialsGenerator
46+
private static final ExternalServiceCredentialsGenerator DIRECTORY_CREDENTIALS_GENERATOR = Mockito.spy(ExternalServiceCredentialsGenerator
4747
.builder(TestRandomUtil.nextBytes(32))
4848
.withUserDerivationKey(TestRandomUtil.nextBytes(32))
4949
.prependUsername(false)
@@ -62,14 +62,14 @@ public class ExternalServiceCredentialsGrpcServiceTest
6262
@Override
6363
protected ExternalServiceCredentialsGrpcService createServiceBeforeEachTest() {
6464
return new ExternalServiceCredentialsGrpcService(Map.of(
65-
ExternalServiceType.EXTERNAL_SERVICE_TYPE_ART, ART_CREDENTIALS_GENERATOR,
65+
ExternalServiceType.EXTERNAL_SERVICE_TYPE_DIRECTORY, DIRECTORY_CREDENTIALS_GENERATOR,
6666
ExternalServiceType.EXTERNAL_SERVICE_TYPE_PAYMENTS, PAYMENTS_CREDENTIALS_GENERATOR
6767
), rateLimiters);
6868
}
6969

7070
static Stream<Arguments> testSuccess() {
7171
return Stream.of(
72-
Arguments.of(ExternalServiceType.EXTERNAL_SERVICE_TYPE_ART, ART_CREDENTIALS_GENERATOR),
72+
Arguments.of(ExternalServiceType.EXTERNAL_SERVICE_TYPE_DIRECTORY, DIRECTORY_CREDENTIALS_GENERATOR),
7373
Arguments.of(ExternalServiceType.EXTERNAL_SERVICE_TYPE_PAYMENTS, PAYMENTS_CREDENTIALS_GENERATOR)
7474
);
7575
}
@@ -111,22 +111,22 @@ public void testInvalidRequest() throws Exception {
111111
public void testRateLimitExceeded() throws Exception {
112112
final Duration retryAfter = MockUtils.updateRateLimiterResponseToFail(
113113
rateLimiters, RateLimiters.For.EXTERNAL_SERVICE_CREDENTIALS, AUTHENTICATED_ACI, Duration.ofSeconds(100));
114-
Mockito.reset(ART_CREDENTIALS_GENERATOR);
114+
Mockito.reset(DIRECTORY_CREDENTIALS_GENERATOR);
115115
assertRateLimitExceeded(
116116
retryAfter,
117117
() -> authenticatedServiceStub().getExternalServiceCredentials(
118118
GetExternalServiceCredentialsRequest.newBuilder()
119-
.setExternalService(ExternalServiceType.EXTERNAL_SERVICE_TYPE_ART)
119+
.setExternalService(ExternalServiceType.EXTERNAL_SERVICE_TYPE_DIRECTORY)
120120
.build()),
121-
ART_CREDENTIALS_GENERATOR
121+
DIRECTORY_CREDENTIALS_GENERATOR
122122
);
123123
}
124124

125125
@Test
126126
public void testUnauthenticatedCall() throws Exception {
127127
assertStatusUnauthenticated(() -> unauthenticatedServiceStub().getExternalServiceCredentials(
128128
GetExternalServiceCredentialsRequest.newBuilder()
129-
.setExternalService(ExternalServiceType.EXTERNAL_SERVICE_TYPE_ART)
129+
.setExternalService(ExternalServiceType.EXTERNAL_SERVICE_TYPE_DIRECTORY)
130130
.build()));
131131
}
132132

service/src/test/resources/config/test-secrets-bundle.yml

-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ paymentsService.userAuthenticationTokenSharedSecret: AAAAAAAAAAAAAAAAAAAAAAAAAAA
159159
paymentsService.fixerApiKey: unset
160160
paymentsService.coinMarketCapApiKey: unset
161161

162-
artService.userAuthenticationTokenSharedSecret: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= # base64-encoded 32-byte secret not shared with any external service, but used in ArtController
163-
artService.userAuthenticationTokenUserIdSecret: AAAAAAAAAAA= # base64-encoded secret to obscure user phone numbers from Sticker Creator
164-
165162
currentReportingKey.secret: AAAAAAAAAAA=
166163
currentReportingKey.salt: AAAAAAAAAAA=
167164

service/src/test/resources/config/test.yml

-4
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,6 @@ paymentsService:
326326
externalClients:
327327
type: stub
328328

329-
artService:
330-
userAuthenticationTokenSharedSecret: secret://artService.userAuthenticationTokenSharedSecret
331-
userAuthenticationTokenUserIdSecret: secret://artService.userAuthenticationTokenUserIdSecret
332-
333329
badges:
334330
badges:
335331
- id: TEST

0 commit comments

Comments
 (0)