Skip to content

Commit aba69a9

Browse files
Merge pull request #136 from IABTechLab/wzh-uid2-3574-check-version-update-presignedurl
check operator version and provide correct presigned url
2 parents 6a80d18 + 9f2105e commit aba69a9

19 files changed

+570
-167
lines changed

conf/default-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
"att_token_enc_key": null,
1818
"att_token_enc_salt": null,
1919
"enforceJwt": false,
20-
"cloud_encryption_keys_metadata_path": null
20+
"cloud_encryption_keys_metadata_path": null,
21+
"encryption_support_version": "9999"
2122
}

conf/integ-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
"keyset_keys_metadata_path": "uid2/keyset_keys/metadata.json",
1919
"salts_metadata_path": "uid2/salts/metadata.json",
2020
"enforceJwt": false,
21-
"cloud_encryption_keys_metadata_path": "uid2/cloud_encryption_keys/metadata.json"
21+
"cloud_encryption_keys_metadata_path": "uid2/cloud_encryption_keys/metadata.json",
22+
"encryption_support_version": "9999"
2223
}

conf/local-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"att_token_enc_salt": "<salt-for-attestation-token>",
2020
"provide_private_site_data": true,
2121
"enforceJwt": false,
22-
"cloud_encryption_keys_metadata_path": "/com.uid2.core/test/cloud_encryption_keys/metadata.json"
22+
"cloud_encryption_keys_metadata_path": "/com.uid2.core/test/cloud_encryption_keys/metadata.json",
23+
"encryption_support_version": "9999"
2324
}

conf/local-e2e-config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@
3333
"aws_kms_jwt_signing_public_keys": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmvwB41qI5Fe41PDbXqcX5uOvSvfKh8l9QV0O3M+NsB4lKqQEP0t1hfoiXTpOgKz1ArYxHsQ2LeXifX4uwEbYJFlpVM+tyQkTWQjBOw6fsLYK2Xk4X2ylNXUUf7x3SDiOVxyvTh3OZW9kqrDBN9JxSoraNLyfw0hhW0SHpfs699SehgbQ7QWep/gVlKRLIz0XAXaZNw24s79ORcQlrCE6YD0PgQmpI/dK5xMML82n6y3qcTlywlGaU7OGIMdD+CTXA3BcOkgXeqZTXNaX1u6jCTa1lvAczun6avp5VZ4TFiuPo+y4rJ3GU+14cyT5NckEcaTKSvd86UdwK5Id9tl3bQIDAQAB",
3434
"core_public_url": "http://localhost:8088",
3535
"optout_url": "http://localhost:8081",
36-
"cloud_keys_metadata_path": "cloud_encryption_keys/metadata.json"
36+
"s3_keys_metadata_path": "s3encryption_keys/metadata.json",
37+
"cloud_keys_metadata_path": "cloud_encryption_keys/metadata.json",
38+
"encryption_support_version": "6.0.0"
3739
}

conf/local-e2e-docker-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@
3232
"aws_kms_jwt_signing_public_keys": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmvwB41qI5Fe41PDbXqcX5uOvSvfKh8l9QV0O3M+NsB4lKqQEP0t1hfoiXTpOgKz1ArYxHsQ2LeXifX4uwEbYJFlpVM+tyQkTWQjBOw6fsLYK2Xk4X2ylNXUUf7x3SDiOVxyvTh3OZW9kqrDBN9JxSoraNLyfw0hhW0SHpfs699SehgbQ7QWep/gVlKRLIz0XAXaZNw24s79ORcQlrCE6YD0PgQmpI/dK5xMML82n6y3qcTlywlGaU7OGIMdD+CTXA3BcOkgXeqZTXNaX1u6jCTa1lvAczun6avp5VZ4TFiuPo+y4rJ3GU+14cyT5NckEcaTKSvd86UdwK5Id9tl3bQIDAQAB",
3333
"core_public_url": "http://core:8088",
3434
"optout_url": "http://optout:8081",
35-
"cloud_encryption_keys_metadata_path": "cloud_encryption_keys/metadata.json"
35+
"cloud_encryption_keys_metadata_path": "cloud_encryption_keys/metadata.json",
36+
"encryption_support_version": "6.0.0"
3637
}

pom.xml

Lines changed: 135 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.uid2</groupId>
88
<artifactId>uid2-core</artifactId>
9-
<version>2.21.7</version>
9+
<version>2.21.8-alpha-63-SNAPSHOT</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -172,135 +172,139 @@
172172
<version>5.12.0</version>
173173
<scope>test</scope>
174174
</dependency>
175+
<dependency>
176+
<groupId>org.mockito</groupId>
177+
<artifactId>mockito-inline</artifactId>
178+
<version>5.2.0</version>
179+
<scope>test</scope>
180+
</dependency>
181+
<dependency>
182+
<groupId>net.bytebuddy</groupId>
183+
<artifactId>byte-buddy</artifactId>
184+
<version>1.14.17</version>
185+
</dependency>
186+
</dependencies>
175187

176-
</dependencies>
177-
178-
<build>
179-
<plugins>
180-
<plugin>
181-
<groupId>org.jacoco</groupId>
182-
<artifactId>jacoco-maven-plugin</artifactId>
183-
<version>0.8.12</version>
184-
<executions>
185-
<execution>
186-
<goals>
187-
<goal>prepare-agent</goal>
188-
</goals>
189-
</execution>
190-
</executions>
191-
</plugin>
192-
<plugin>
193-
<groupId>org.apache.maven.plugins</groupId>
194-
<artifactId>maven-compiler-plugin</artifactId>
195-
<version>3.12.1</version>
196-
<configuration>
197-
<source>21</source>
198-
<target>21</target>
199-
<release>21</release>
200-
</configuration>
201-
</plugin>
202-
<plugin>
203-
<groupId>org.apache.maven.plugins</groupId>
204-
<artifactId>maven-source-plugin</artifactId>
205-
<version>3.2.1</version>
206-
<executions>
207-
<execution>
208-
<id>attach-sources</id>
209-
<goals>
210-
<goal>jar</goal>
211-
</goals>
212-
</execution>
213-
</executions>
214-
</plugin>
215-
<plugin>
216-
<groupId>io.reactiverse</groupId>
217-
<artifactId>vertx-maven-plugin</artifactId>
218-
<version>${vertx-maven-plugin.version}</version>
219-
<executions>
220-
<execution>
221-
<id>vmp</id>
222-
<goals>
223-
<goal>initialize</goal>
224-
<goal>package</goal>
225-
</goals>
226-
</execution>
227-
</executions>
228-
<configuration>
229-
<redeploy>true</redeploy>
230-
<jvmArgs>
231-
<jvmArg>-Djava.security.egd=file:/dev/./urandom</jvmArg>
232-
</jvmArgs>
233-
</configuration>
234-
</plugin>
235-
<plugin>
236-
<groupId>org.apache.maven.plugins</groupId>
237-
<artifactId>maven-assembly-plugin</artifactId>
238-
<version>3.3.0</version>
239-
<configuration>
240-
<!-- get all project dependencies -->
241-
<descriptorRefs>
242-
<descriptorRef>jar-with-dependencies</descriptorRef>
243-
</descriptorRefs>
244-
<!-- MainClass in manifest make a executable jar -->
245-
<archive>
246-
<manifest>
247-
<mainClass>com.uid2.core.Main</mainClass>
248-
</manifest>
249-
</archive>
250-
</configuration>
251-
<executions>
252-
<execution>
253-
<id>make-assembly</id>
254-
<!-- bind to the packaging phase -->
255-
<phase>package</phase>
256-
<goals>
257-
<goal>single</goal>
258-
</goals>
259-
</execution>
260-
</executions>
261-
</plugin>
262-
<plugin>
263-
<groupId>org.codehaus.mojo</groupId>
264-
<artifactId>properties-maven-plugin</artifactId>
265-
<version>1.0.0</version>
266-
<executions>
267-
<execution>
268-
<phase>generate-resources</phase>
269-
<goals>
270-
<goal>write-project-properties</goal>
271-
</goals>
272-
<configuration>
273-
<outputFile>${project.build.outputDirectory}/${project.artifactId}.properties</outputFile>
274-
</configuration>
275-
</execution>
276-
</executions>
277-
</plugin>
278-
<plugin>
279-
<groupId>org.codehaus.mojo</groupId>
280-
<artifactId>exec-maven-plugin</artifactId>
281-
<version>${exec-maven-plugin.version}</version>
282-
<executions>
283-
<execution>
284-
<id>default-cli</id>
285-
<goals>
286-
<goal>java</goal>
287-
</goals>
288-
<configuration>
289-
<mainClass>com.uid2.core.Main</mainClass>
290-
</configuration>
291-
</execution>
292-
</executions>
293-
</plugin>
294-
<plugin>
295-
<groupId>org.apache.maven.plugins</groupId>
296-
<artifactId>maven-surefire-plugin</artifactId>
297-
<version>${maven-surefire-plugin.version}</version>
298-
</plugin>
299-
<plugin>
300-
<groupId>com.azure.tools</groupId>
301-
<artifactId>azure-sdk-build-tool</artifactId>
302-
<version>1.0.0</version>
303-
</plugin>
304-
</plugins>
305-
</build>
188+
<build>
189+
<plugins>
190+
<plugin>
191+
<groupId>org.jacoco</groupId>
192+
<artifactId>jacoco-maven-plugin</artifactId>
193+
<version>0.8.8</version>
194+
<executions>
195+
<execution>
196+
<goals>
197+
<goal>prepare-agent</goal>
198+
</goals>
199+
</execution>
200+
</executions>
201+
</plugin>
202+
<plugin>
203+
<groupId>org.apache.maven.plugins</groupId>
204+
<artifactId>maven-compiler-plugin</artifactId>
205+
<version>3.11.0</version>
206+
<configuration>
207+
<source>16</source>
208+
<target>16</target>
209+
</configuration>
210+
</plugin>
211+
<plugin>
212+
<groupId>org.apache.maven.plugins</groupId>
213+
<artifactId>maven-source-plugin</artifactId>
214+
<version>3.2.1</version>
215+
<executions>
216+
<execution>
217+
<id>attach-sources</id>
218+
<goals>
219+
<goal>jar</goal>
220+
</goals>
221+
</execution>
222+
</executions>
223+
</plugin>
224+
<plugin>
225+
<groupId>io.reactiverse</groupId>
226+
<artifactId>vertx-maven-plugin</artifactId>
227+
<version>${vertx-maven-plugin.version}</version>
228+
<executions>
229+
<execution>
230+
<id>vmp</id>
231+
<goals>
232+
<goal>initialize</goal>
233+
<goal>package</goal>
234+
</goals>
235+
</execution>
236+
</executions>
237+
<configuration>
238+
<redeploy>true</redeploy>
239+
<jvmArgs>
240+
<jvmArg>-Djava.security.egd=file:/dev/./urandom</jvmArg>
241+
</jvmArgs>
242+
</configuration>
243+
</plugin>
244+
<plugin>
245+
<groupId>org.apache.maven.plugins</groupId>
246+
<artifactId>maven-assembly-plugin</artifactId>
247+
<version>3.3.0</version>
248+
<configuration>
249+
<!-- get all project dependencies -->
250+
<descriptorRefs>
251+
<descriptorRef>jar-with-dependencies</descriptorRef>
252+
</descriptorRefs>
253+
<!-- MainClass in manifest make a executable jar -->
254+
<archive>
255+
<manifest>
256+
<mainClass>com.uid2.core.Main</mainClass>
257+
</manifest>
258+
</archive>
259+
</configuration>
260+
<executions>
261+
<execution>
262+
<id>make-assembly</id>
263+
<!-- bind to the packaging phase -->
264+
<phase>package</phase>
265+
<goals>
266+
<goal>single</goal>
267+
</goals>
268+
</execution>
269+
</executions>
270+
</plugin>
271+
<plugin>
272+
<groupId>org.codehaus.mojo</groupId>
273+
<artifactId>properties-maven-plugin</artifactId>
274+
<version>1.0.0</version>
275+
<executions>
276+
<execution>
277+
<phase>generate-resources</phase>
278+
<goals>
279+
<goal>write-project-properties</goal>
280+
</goals>
281+
<configuration>
282+
<outputFile>${project.build.outputDirectory}/${project.artifactId}.properties</outputFile>
283+
</configuration>
284+
</execution>
285+
</executions>
286+
</plugin>
287+
<plugin>
288+
<groupId>org.codehaus.mojo</groupId>
289+
<artifactId>exec-maven-plugin</artifactId>
290+
<version>${exec-maven-plugin.version}</version>
291+
<executions>
292+
<execution>
293+
<id>default-cli</id>
294+
<goals>
295+
<goal>java</goal>
296+
</goals>
297+
<configuration>
298+
<mainClass>com.uid2.core.Main</mainClass>
299+
</configuration>
300+
</execution>
301+
</executions>
302+
</plugin>
303+
<plugin>
304+
<groupId>org.apache.maven.plugins</groupId>
305+
<artifactId>maven-surefire-plugin</artifactId>
306+
<version>${maven-surefire-plugin.version}</version>
307+
</plugin>
308+
</plugins>
309+
</build>
306310
</project>

src/main/java/com/uid2/core/service/ClientMetadataProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class ClientMetadataProvider implements IClientMetadataProvider {
2323

2424
@Override
2525
public String getMetadata(OperatorInfo info) throws Exception {
26-
String pathname = getMetadataPathName(info.getOperatorType(), info.getSiteId(), SecretStore.Global.get(ClientsMetadataPathName));
26+
String pathname = getMetadataPathName(info, SecretStore.Global.get(ClientsMetadataPathName));
2727
String original = readToEndAsString(metadataStreamProvider.download(pathname));
2828
JsonObject main = (JsonObject) Json.decodeValue(original);
2929
JsonObject obj = main.getJsonObject("client_keys");
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.uid2.core.service;
22

3+
import com.uid2.core.util.OperatorInfo;
4+
35
public interface ISiteMetadataProvider {
4-
String getMetadata() throws Exception;
6+
String getMetadata(OperatorInfo info) throws Exception;
57
}

src/main/java/com/uid2/core/service/KeysetKeysMetadataProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public KeysetKeysMetadataProvider(ICloudStorage cloudStorage) {
2121

2222
@Override
2323
public String getMetadata(OperatorInfo info) throws Exception {
24-
String pathname = getMetadataPathName(info.getOperatorType(), info.getSiteId(), SecretStore.Global.get(Const.Config.KeysetKeysMetadataPathProp));
24+
String pathname = getMetadataPathName(info, SecretStore.Global.get(Const.Config.KeysetKeysMetadataPathProp));
2525
String original = readToEndAsString(metadataStreamProvider.download(pathname));
2626
JsonObject main = (JsonObject) Json.decodeValue(original);
2727
JsonObject obj = main.getJsonObject("keyset_keys");

src/main/java/com/uid2/core/service/KeysetMetadataProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public KeysetMetadataProvider(ICloudStorage cloudStorage) {
2020

2121
@Override
2222
public String getMetadata(OperatorInfo info) throws Exception {
23-
String pathname = getMetadataPathName(info.getOperatorType(), info.getSiteId(), SecretStore.Global.get(Const.Config.KeysetsMetadataPathProp));
23+
String pathname = getMetadataPathName(info, SecretStore.Global.get(Const.Config.KeysetsMetadataPathProp));
2424
String original = readToEndAsString(metadataStreamProvider.download(pathname));
2525
JsonObject main = (JsonObject) Json.decodeValue(original);
2626
JsonObject obj = main.getJsonObject("keysets");

0 commit comments

Comments
 (0)