From e160025cfc0d8362d161a12663a5d19257830a3e Mon Sep 17 00:00:00 2001 From: Ameya Lokare Date: Wed, 4 Sep 2024 17:58:51 -0700 Subject: [PATCH] Clean up OpenAPI annotations on PUT /v1/challenge * Remove 413 response since we no longer send it * Add missing 428 response for when invalid captcha is submitted --- .../textsecuregcm/controllers/ChallengeController.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ChallengeController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ChallengeController.java index a90665c97..27e993851 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ChallengeController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ChallengeController.java @@ -66,16 +66,14 @@ public class ChallengeController { summary = "Submit proof of a challenge completion", description = """ Some server endpoints (the "send message" endpoint, for example) may return a 428 response indicating the client must complete a challenge before continuing. - Clients may use this endpoint to provide proof of a completed challenge. If successful, the client may then + Clients may use this endpoint to provide proof of a completed challenge. If successful, the client may then continue their original operation. """, requestBody = @RequestBody(content = {@Content(schema = @Schema(oneOf = {AnswerPushChallengeRequest.class, AnswerCaptchaChallengeRequest.class}))}) ) @ApiResponse(responseCode = "200", description = "Indicates the challenge proof was accepted") - @ApiResponse(responseCode = "413", description = "Too many attempts", headers = @Header( - name = "Retry-After", - description = "If present, an positive integer indicating the number of seconds before a subsequent attempt could succeed")) + @ApiResponse(responseCode = "428", description = "Submitted captcha token is invalid") @ApiResponse(responseCode = "429", description = "Too many attempts", headers = @Header( name = "Retry-After", description = "If present, an positive integer indicating the number of seconds before a subsequent attempt could succeed"))