Skip to content

Commit fa145d7

Browse files
committed
Use 'response' rather than 'outcome' in backups.proto responses
1 parent edcc61d commit fa145d7

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ message RedeemReceiptRequest {
8484
}
8585

8686
message RedeemReceiptResponse {
87-
oneof outcome {
87+
oneof response {
8888
// The receipt was successfully redeemed
8989
google.protobuf.Empty success = 1;
9090

@@ -217,7 +217,7 @@ message SetPublicKeyRequest {
217217
}
218218

219219
message SetPublicKeyResponse {
220-
oneof outcome {
220+
oneof response {
221221
// The public key was successfully set
222222
google.protobuf.Empty success = 1;
223223

@@ -240,7 +240,7 @@ message GetCdnCredentialsResponse {
240240
message CdnCredentials {
241241
map<string, string> headers = 1;
242242
}
243-
oneof outcome {
243+
oneof response {
244244
// Headers to include with requests to the read from the backup CDN. Includes
245245
// time limited read-only credentials.
246246
CdnCredentials cdn_credentials = 1;
@@ -266,7 +266,7 @@ message GetSvrBCredentialsResponse {
266266
string password = 2;
267267
}
268268

269-
oneof outcome {
269+
oneof response {
270270
SvrBCredentials svrb_credentials = 1;
271271

272272
// The provided backup auth credential presentation could not be
@@ -295,7 +295,7 @@ message GetMessageBackupInfoResponse {
295295
string backup_name = 3;
296296
}
297297

298-
oneof outcome {
298+
oneof response {
299299
MessageBackupInfo backup_info = 1;
300300

301301
// The provided backup auth credential presentation could not be
@@ -319,7 +319,7 @@ message GetMediaBackupInfoResponse {
319319
uint64 used_space = 3;
320320
}
321321

322-
oneof outcome {
322+
oneof response {
323323
MediaBackupInfo backup_info = 1;
324324

325325
// The provided backup auth credential presentation could not be
@@ -334,7 +334,7 @@ message RefreshRequest {
334334
SignedPresentation signed_presentation = 1;
335335
}
336336
message RefreshResponse {
337-
oneof outcome {
337+
oneof response {
338338
// The backup was successfully refreshed
339339
google.protobuf.Empty success = 1;
340340

@@ -369,7 +369,7 @@ message GetUploadFormRequest {
369369
uint64 uploadLength = 4 [(require.range) = {min: 1}];
370370
}
371371
message GetUploadFormResponse {
372-
oneof outcome {
372+
oneof response {
373373
common.UploadForm upload_form = 1;
374374

375375
// The provided backup auth credential presentation could not be
@@ -425,7 +425,7 @@ message CopyMediaResponse {
425425
// The 15-byte media_id from the corresponding CopyMediaItem in the request
426426
bytes media_id = 1;
427427

428-
oneof outcome {
428+
oneof response {
429429
// The media item was successfully copied into the backup
430430
CopySuccess success = 2;
431431

@@ -485,7 +485,7 @@ message ListMediaResponse {
485485
optional string cursor = 4;
486486
}
487487

488-
oneof outcome {
488+
oneof response {
489489
ListResult list_result = 1;
490490

491491
// The provided backup auth credential presentation could not be
@@ -500,7 +500,7 @@ message DeleteAllRequest {
500500
SignedPresentation signed_presentation = 1;
501501
}
502502
message DeleteAllResponse {
503-
oneof outcome {
503+
oneof response {
504504
// The backup was successfully scheduled for deletion
505505
google.protobuf.Empty success = 1;
506506

@@ -527,7 +527,7 @@ message DeleteMediaRequest {
527527
}
528528

529529
message DeleteMediaResponse {
530-
oneof outcome {
530+
oneof response {
531531
DeleteMediaItem deleted_item = 1;
532532

533533
// The provided backup auth credential presentation could not be

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void setPublicKey() {
111111
.setPublicKey(ByteString.copyFrom(ECKeyPair.generate().getPublicKey().serialize()))
112112
.setSignedPresentation(signedPresentation(presentation))
113113
.build())
114-
.getOutcomeCase()).isEqualTo(SetPublicKeyResponse.OutcomeCase.SUCCESS);
114+
.getResponseCase()).isEqualTo(SetPublicKeyResponse.ResponseCase.SUCCESS);
115115
}
116116

117117
@Test

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ void setBackupIdException(final Exception ex, final Status expected)
170170

171171
public static Stream<Arguments> redeemReceipt() {
172172
return Stream.of(
173-
Arguments.of(null, RedeemReceiptResponse.OutcomeCase.SUCCESS),
174-
Arguments.of(new BackupBadReceiptException("test"), RedeemReceiptResponse.OutcomeCase.INVALID_RECEIPT),
175-
Arguments.of(new BackupMissingIdCommitmentException(), RedeemReceiptResponse.OutcomeCase.ACCOUNT_MISSING_COMMITMENT));
173+
Arguments.of(null, RedeemReceiptResponse.ResponseCase.SUCCESS),
174+
Arguments.of(new BackupBadReceiptException("test"), RedeemReceiptResponse.ResponseCase.INVALID_RECEIPT),
175+
Arguments.of(new BackupMissingIdCommitmentException(), RedeemReceiptResponse.ResponseCase.ACCOUNT_MISSING_COMMITMENT));
176176
}
177177

178178
@ParameterizedTest
179179
@MethodSource
180-
void redeemReceipt(@Nullable final BackupException exception, final RedeemReceiptResponse.OutcomeCase expectedOutcome)
180+
void redeemReceipt(@Nullable final BackupException exception, final RedeemReceiptResponse.ResponseCase expectedOutcome)
181181
throws InvalidInputException, VerificationFailedException, BackupInvalidArgumentException, BackupMissingIdCommitmentException, BackupBadReceiptException {
182182

183183
final ServerSecretParams params = ServerSecretParams.generate();
@@ -197,7 +197,7 @@ void redeemReceipt(@Nullable final BackupException exception, final RedeemReceip
197197
RedeemReceiptRequest.newBuilder()
198198
.setPresentation(ByteString.copyFrom(presentation.serialize()))
199199
.build());
200-
assertThat(redeemReceiptResponse.getOutcomeCase()).isEqualTo(expectedOutcome);
200+
assertThat(redeemReceiptResponse.getResponseCase()).isEqualTo(expectedOutcome);
201201

202202
verify(backupAuthManager).redeemReceipt(account, presentation);
203203
}

0 commit comments

Comments
 (0)