diff --git a/pom.xml b/pom.xml
index bf19bece..d364f8ec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
com.uid2
uid2-shared
- 7.21.7
+ 7.21.12-alpha-165-SNAPSHOT
${project.groupId}:${project.artifactId}
Library for all the shared uid2 operations
https://github.com/IABTechLab/uid2docs
@@ -68,7 +68,7 @@
com.google.cloud
libraries-bom
- 26.26.0
+ 26.50.0
pom
import
@@ -186,12 +186,22 @@
com.google.auth
google-auth-library-oauth2-http
- 1.23.0
+ 1.30.0
+
+
+ com.google.auth
+ google-auth-library-credentials
+ 1.30.0
com.google.cloud
google-cloud-logging
- 3.20.6
+ 3.15.12
+
+
+ com.google.protobuf
+ protobuf-java
+ 3.25.5
com.azure
diff --git a/src/main/java/com/uid2/shared/Const.java b/src/main/java/com/uid2/shared/Const.java
index 865944d1..4345ab8f 100644
--- a/src/main/java/com/uid2/shared/Const.java
+++ b/src/main/java/com/uid2/shared/Const.java
@@ -63,7 +63,7 @@ public static class Config {
public static final String ServiceLinkMetadataPathProp = "service_links_metadata_path";
public static final String SitesMetadataPathProp = "sites_metadata_path";
public static final String OperatorsMetadataPathProp = "operators_metadata_path";
- public static final String S3keysMetadataPathProp = "s3_keys_metadata_path";
+ public static final String CloudEncryptionKeysMetadataPathProp = "cloud_encryption_keys_metadata_path";
public static final String SaltsMetadataPathProp = "salts_metadata_path";
public static final String OptOutMetadataPathProp = "optout_metadata_path";
public static final String CoreAttestUrlProp = "core_attest_url";
diff --git a/src/main/java/com/uid2/shared/model/S3Key.java b/src/main/java/com/uid2/shared/model/CloudEncryptionKey.java
similarity index 77%
rename from src/main/java/com/uid2/shared/model/S3Key.java
rename to src/main/java/com/uid2/shared/model/CloudEncryptionKey.java
index a23b09ee..f699acc3 100644
--- a/src/main/java/com/uid2/shared/model/S3Key.java
+++ b/src/main/java/com/uid2/shared/model/CloudEncryptionKey.java
@@ -7,7 +7,7 @@
import java.util.Objects;
@JsonPropertyOrder({ "id", "siteId", "activates", "created", "secret" })
-public class S3Key {
+public class CloudEncryptionKey {
private final int id;
private final int siteId;
private final long activates;
@@ -15,7 +15,7 @@ public class S3Key {
private final String secret;
@JsonCreator
- public S3Key(
+ public CloudEncryptionKey(
@JsonProperty("id") int id,
@JsonProperty("site_id") int siteId,
@JsonProperty("activates") long activates,
@@ -52,12 +52,12 @@ public String getSecret() {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- S3Key s3Key = (S3Key) o;
- return id == s3Key.id &&
- siteId == s3Key.siteId &&
- activates == s3Key.activates &&
- created == s3Key.created &&
- Objects.equals(secret, s3Key.secret);
+ CloudEncryptionKey cloudEncryptionKey = (CloudEncryptionKey) o;
+ return id == cloudEncryptionKey.id &&
+ siteId == cloudEncryptionKey.siteId &&
+ activates == cloudEncryptionKey.activates &&
+ created == cloudEncryptionKey.created &&
+ Objects.equals(secret, cloudEncryptionKey.secret);
}
@Override
diff --git a/src/main/java/com/uid2/shared/store/EncryptedScopedStoreReader.java b/src/main/java/com/uid2/shared/store/EncryptedScopedStoreReader.java
index 9b24f762..32b2b5d5 100644
--- a/src/main/java/com/uid2/shared/store/EncryptedScopedStoreReader.java
+++ b/src/main/java/com/uid2/shared/store/EncryptedScopedStoreReader.java
@@ -1,12 +1,11 @@
package com.uid2.shared.store;
import com.uid2.shared.cloud.DownloadCloudStorage;
-import com.uid2.shared.model.S3Key;
+import com.uid2.shared.model.CloudEncryptionKey;
import com.uid2.shared.store.parser.Parser;
import com.uid2.shared.store.parser.ParsingResult;
-import com.uid2.shared.store.scope.EncryptedScope;
import com.uid2.shared.store.scope.StoreScope;
-import com.uid2.shared.store.reader.RotatingS3KeyProvider;
+import com.uid2.shared.store.reader.RotatingCloudEncryptionKeyProvider;
import io.vertx.core.json.JsonObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -15,7 +14,6 @@
import com.uid2.shared.encryption.AesGcm;
-import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.Map;
@@ -23,11 +21,11 @@
public class EncryptedScopedStoreReader extends ScopedStoreReader {
private static final Logger LOGGER = LoggerFactory.getLogger(EncryptedScopedStoreReader.class);
- private final RotatingS3KeyProvider s3KeyProvider;
+ private final RotatingCloudEncryptionKeyProvider cloudEncryptionKeyProvider;
- public EncryptedScopedStoreReader(DownloadCloudStorage fileStreamProvider, StoreScope scope, Parser parser, String dataTypeName, RotatingS3KeyProvider s3KeyProvider) {
+ public EncryptedScopedStoreReader(DownloadCloudStorage fileStreamProvider, StoreScope scope, Parser parser, String dataTypeName, RotatingCloudEncryptionKeyProvider cloudEncryptionKeyProvider) {
super(fileStreamProvider, scope, parser, dataTypeName);
- this.s3KeyProvider = s3KeyProvider;
+ this.cloudEncryptionKeyProvider = cloudEncryptionKeyProvider;
}
@Override
@@ -52,9 +50,9 @@ protected String getDecryptedContent(String encryptedContent) throws Exception {
JsonObject json = new JsonObject(encryptedContent);
int keyId = json.getInteger("key_id");
String encryptedPayload = json.getString("encrypted_payload");
- Map s3Keys = s3KeyProvider.getAll();
- S3Key decryptionKey = null;
- for (S3Key key : s3Keys.values()) {
+ Map cloudEncryptionKeys = cloudEncryptionKeyProvider.getAll();
+ CloudEncryptionKey decryptionKey = null;
+ for (CloudEncryptionKey key : cloudEncryptionKeys.values()) {
if (key.getId() == keyId) {
decryptionKey = key;
break;
diff --git a/src/main/java/com/uid2/shared/store/parser/CloudEncryptionKeyParser.java b/src/main/java/com/uid2/shared/store/parser/CloudEncryptionKeyParser.java
new file mode 100644
index 00000000..81e7ec17
--- /dev/null
+++ b/src/main/java/com/uid2/shared/store/parser/CloudEncryptionKeyParser.java
@@ -0,0 +1,23 @@
+package com.uid2.shared.store.parser;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.uid2.shared.model.CloudEncryptionKey;
+import com.uid2.shared.util.Mapper;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+public class CloudEncryptionKeyParser implements Parser