Add v4 attachment controller

Add AttachmentControllerV4 which can be configured to generate upload
forms for a TUS based CDN
This commit is contained in:
ravi-signal
2023-07-21 12:09:45 -05:00
committed by GitHub
parent 9df923d916
commit 705fb93e45
12 changed files with 344 additions and 33 deletions

View File

@@ -5,7 +5,22 @@
package org.whispersystems.textsecuregcm.entities;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
public record AttachmentDescriptorV3(int cdn, String key, Map<String, String> headers, String signedUploadLocation) {
public record AttachmentDescriptorV3(
@Schema(description = """
Indicates the CDN type. 2 in the v3 API, 2 or 3 in the v4 API.
2 indicates resumable uploads using GCS,
3 indicates resumable uploads using TUS
""")
int cdn,
@Schema(description = "The location within the specified cdn where the finished upload can be found")
String key,
@Schema(description = "A map of headers to include with all upload requests. Potentially contains time-limited upload credentials")
Map<String, String> headers,
@Schema(description = "The URL to upload to with the appropriate protocol")
String signedUploadLocation) {
}