From d096798340dab047632f3fe8946367e33f3a31e8 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Fri, 20 Dec 2024 16:29:55 -0600 Subject: [PATCH] Add documentation to /v1/storage/auth --- .../controllers/SecureStorageController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureStorageController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureStorageController.java index c6b157e73..c152e06af 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureStorageController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureStorageController.java @@ -6,6 +6,8 @@ package org.whispersystems.textsecuregcm.controllers; import io.dropwizard.auth.Auth; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; @@ -37,6 +39,14 @@ public class SecureStorageController { @GET @Path("/auth") @Produces(MediaType.APPLICATION_JSON) + @Operation( + summary = "Generate credentials for Storage Service", + description = """ + Generate Storage Service credentials. Generated credentials have an expiration time of 24 hours\s + (however, the TTL is fully controlled by the server and may change even for already generated credentials). + """ + ) + @ApiResponse(responseCode = "200", description = "`JSON` with generated credentials.", useReturnTypeSchema = true) public ExternalServiceCredentials getAuth(@ReadOnly @Auth AuthenticatedDevice auth) { return storageServiceCredentialsGenerator.generateForUuid(auth.getAccount().getUuid()); }