From 0ea6cf7a692c7c4e4dc4f3168bf37c0384b124ef Mon Sep 17 00:00:00 2001 From: tna-da-bot <181243999+tna-da-bot@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:10:53 +0000 Subject: [PATCH 1/6] Setting version to 0.0.450 --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index 07e0a499..5a1e523c 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.0.450-SNAPSHOT" +ThisBuild / version := "0.0.450" From 48a7b2455219c3c27fefdefac856c9c0ead50bdd Mon Sep 17 00:00:00 2001 From: tna-da-bot <181243999+tna-da-bot@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:11:28 +0000 Subject: [PATCH 2/6] Setting version to 0.0.451-SNAPSHOT --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index 5a1e523c..b80cebdc 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.0.450" +ThisBuild / version := "0.0.451-SNAPSHOT" From 990bdcc54a22e4a3f74ba1dd7f3db32c2a9a7d55 Mon Sep 17 00:00:00 2001 From: TomJKing Date: Tue, 19 Nov 2024 14:11:10 +0000 Subject: [PATCH 3/6] Remove object tagging when copying to export bucket Having object tagging causes permission issues with downstream service when copy from TDR s3 buckets TDR should be serving up s3 objects clean with any necessary information held in the metadata --- .../main/scala/uk/gov/nationalarchives/export/S3Utils.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/export/src/main/scala/uk/gov/nationalarchives/export/S3Utils.scala b/export/src/main/scala/uk/gov/nationalarchives/export/S3Utils.scala index 2c08024f..ae48d696 100644 --- a/export/src/main/scala/uk/gov/nationalarchives/export/S3Utils.scala +++ b/export/src/main/scala/uk/gov/nationalarchives/export/S3Utils.scala @@ -6,7 +6,7 @@ import io.circe.syntax._ import io.circe.{Json, JsonObject, Printer} import software.amazon.awssdk.core.sync.RequestBody import software.amazon.awssdk.services.s3.S3Client -import software.amazon.awssdk.services.s3.model.{CopyObjectRequest, ListObjectsV2Request, PutObjectRequest, S3Object} +import software.amazon.awssdk.services.s3.model.{CopyObjectRequest, ListObjectsV2Request, PutObjectRequest, S3Object, TaggingDirective} import uk.gov.nationalarchives.`export`.Main.Config import uk.gov.nationalarchives.`export`.MetadataUtils.{ConsignmentType, Judgment, Metadata, Standard} import uk.gov.nationalarchives.`export`.S3Utils.FileOutput @@ -52,6 +52,7 @@ class S3Utils(config: Config, s3Client: S3Client) { .sourceBucket(config.s3.cleanBucket) .destinationKey(destinationKey) .destinationBucket(destinationBucket) + .taggingDirective(TaggingDirective.REPLACE) .build() s3Client.copyObject(copyRequest) val series = consignmentMetadata.find(_.propertyName == "Series").map(_.value) From aa496cda8d16b88753b6670807ef4bb9cb94bde2 Mon Sep 17 00:00:00 2001 From: TomJKing Date: Tue, 19 Nov 2024 14:36:16 +0000 Subject: [PATCH 4/6] Ensure empty tag set is provided Need to specify when using 'x-amz-tagging-directive=REPLACE' See documentation here: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html#API_CopyObject_RequestParameters --- .../main/scala/uk/gov/nationalarchives/export/S3Utils.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/export/src/main/scala/uk/gov/nationalarchives/export/S3Utils.scala b/export/src/main/scala/uk/gov/nationalarchives/export/S3Utils.scala index ae48d696..c0b3557d 100644 --- a/export/src/main/scala/uk/gov/nationalarchives/export/S3Utils.scala +++ b/export/src/main/scala/uk/gov/nationalarchives/export/S3Utils.scala @@ -6,7 +6,7 @@ import io.circe.syntax._ import io.circe.{Json, JsonObject, Printer} import software.amazon.awssdk.core.sync.RequestBody import software.amazon.awssdk.services.s3.S3Client -import software.amazon.awssdk.services.s3.model.{CopyObjectRequest, ListObjectsV2Request, PutObjectRequest, S3Object, TaggingDirective} +import software.amazon.awssdk.services.s3.model.{CopyObjectRequest, ListObjectsV2Request, PutObjectRequest, S3Object, Tagging, TaggingDirective} import uk.gov.nationalarchives.`export`.Main.Config import uk.gov.nationalarchives.`export`.MetadataUtils.{ConsignmentType, Judgment, Metadata, Standard} import uk.gov.nationalarchives.`export`.S3Utils.FileOutput @@ -53,6 +53,7 @@ class S3Utils(config: Config, s3Client: S3Client) { .destinationKey(destinationKey) .destinationBucket(destinationBucket) .taggingDirective(TaggingDirective.REPLACE) + .tagging(Tagging.builder().build()) .build() s3Client.copyObject(copyRequest) val series = consignmentMetadata.find(_.propertyName == "Series").map(_.value) From 2712dda0359bdb89cefbf76e4d7bc5ac319c8906 Mon Sep 17 00:00:00 2001 From: tna-da-bot <181243999+tna-da-bot@users.noreply.github.com> Date: Wed, 20 Nov 2024 06:36:17 +0000 Subject: [PATCH 5/6] Setting version to 0.0.451 --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index b80cebdc..80e96827 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.0.451-SNAPSHOT" +ThisBuild / version := "0.0.451" From a26698c21c36fe8f36174007c4fd65bd8ba675a7 Mon Sep 17 00:00:00 2001 From: tna-da-bot <181243999+tna-da-bot@users.noreply.github.com> Date: Wed, 20 Nov 2024 06:36:52 +0000 Subject: [PATCH 6/6] Setting version to 0.0.452-SNAPSHOT --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index 80e96827..0cb852c1 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.0.451" +ThisBuild / version := "0.0.452-SNAPSHOT"