Fix incorrect setting on TTL of share URL (#39)

Share URL mechanism was provided in https://github.com/halo-sigs/plugin-s3/pull/35, and I set the TTL of the URL with 5 mins incorrectly.

```release-note
None
```
This commit is contained in:
John Niang
2023-06-01 16:13:16 +08:00
committed by GitHub
parent 5a95b4ced1
commit b3bdd02e08

View File

@@ -120,7 +120,7 @@ public class S3OsAttachmentHandler implements AttachmentHandler {
.key(objectKey)
.build();
var presignedRequest = GetObjectPresignRequest.builder()
.signatureDuration(Duration.ofMinutes(5))
.signatureDuration(ttl)
.getObjectRequest(getObjectRequest)
.build();
var presignedGetObjectRequest = s3Presigner.presignGetObject(presignedRequest);
@@ -170,9 +170,9 @@ public class S3OsAttachmentHandler implements AttachmentHandler {
var metadata = new Metadata();
metadata.setName(UUID.randomUUID().toString());
metadata.setAnnotations(
metadata.setAnnotations(new HashMap<>(
Map.of(OBJECT_KEY, objectDetail.uploadState.objectKey, Constant.EXTERNAL_LINK_ANNO_KEY,
UriUtils.encodePath(externalLink, StandardCharsets.UTF_8)));
UriUtils.encodePath(externalLink, StandardCharsets.UTF_8))));
var objectMetadata = objectDetail.objectMetadata();
var spec = new AttachmentSpec();