Skip to content

Commit e8740b5

Browse files
committed
Merged main
2 parents 9347011 + b3542b2 commit e8740b5

11 files changed

Lines changed: 479 additions & 629 deletions

File tree

js/euid-sdk-1.0.0/options.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('cookiePath option', () => {
8080

8181
describe('baseUrl option', () => {
8282
const identity = makeIdentity({
83-
refresh_from: Date.now()- 100000
83+
refresh_from: Date.now() - 100000
8484
});
8585

8686
describe('when using default value', () => {

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
<groupId>com.uid2</groupId>
88
<artifactId>uid2-operator</artifactId>
9-
<version>5.56.61</version>
9+
<version>5.57.14</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<vertx.version>4.5.13</vertx.version>
13+
<vertx.version>4.5.18</vertx.version>
1414
<vertx-maven-plugin.version>1.0.22</vertx-maven-plugin.version>
1515
<junit-jupiter.version>5.11.2</junit-jupiter.version>
1616
<junit-vintage.version>5.11.2</junit-vintage.version>
@@ -22,7 +22,7 @@
2222
<enclave-aws.version>2.1.0</enclave-aws.version>
2323
<enclave-azure.version>2.1.13</enclave-azure.version>
2424
<enclave-gcp.version>2.1.0</enclave-gcp.version>
25-
<uid2-shared.version>10.8.0</uid2-shared.version>
25+
<uid2-shared.version>10.9.0</uid2-shared.version>
2626
<image.version>${project.version}</image.version>
2727
<maven.compiler.source>21</maven.compiler.source>
2828
<maven.compiler.target>21</maven.compiler.target>

scripts/gcp-oidc/terraform/main.tf

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,21 @@ resource "google_compute_instance_template" "uid_operator" {
102102
source_image = data.google_compute_image.confidential_space_image.self_link
103103
}
104104

105-
metadata = {
106-
tee-image-reference = var.uid_operator_image
107-
tee-container-log-redirect = true
108-
tee-restart-policy = "Never"
109-
tee-env-DEBUG_MODE = var.debug_mode
110-
tee-env-DEPLOYMENT_ENVIRONMENT = var.uid_deployment_env
111-
tee-env-API_TOKEN_SECRET_NAME = module.secret-manager.secret_versions[0]
112-
tee-env-CORE_BASE_URL = var.uid_deployment_env == "integ" ? "https://core-integ.uidapi.com" : "https://core-prod.uidapi.com"
113-
tee-env-OPTOUT_BASE_URL = var.uid_deployment_env == "integ" ? "https://optout-integ.uidapi.com" : "https://optout-prod.uidapi.com"
114-
}
105+
metadata = merge(
106+
{
107+
tee-image-reference = var.uid_operator_image
108+
tee-container-log-redirect = true
109+
tee-restart-policy = "Never"
110+
tee-env-DEPLOYMENT_ENVIRONMENT = var.uid_deployment_env
111+
tee-env-API_TOKEN_SECRET_NAME = var.uid_operator_key_secret_name
112+
tee-env-CORE_BASE_URL = var.uid_deployment_env == "integ" ? "https://core-integ.uidapi.com" : "https://core-prod.uidapi.com"
113+
tee-env-OPTOUT_BASE_URL = var.uid_deployment_env == "integ" ? "https://optout-integ.uidapi.com" : "https://optout-prod.uidapi.com"
114+
},
115+
var.uid_deployment_env != "prod" ? {
116+
tee-env-DEBUG_MODE = var.debug_mode
117+
} : {}
118+
)
119+
115120

116121
network_interface {
117122
network = google_compute_network.default.name

src/main/java/com/uid2/operator/monitoring/StatsCollectorVerticle.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,14 @@ public void handleMessage(Message message) {
8989
}
9090

9191
String path = messageItem.getPath();
92-
String apiVersion = "v0";
93-
String endpoint = path.substring(1);
92+
String apiVersion = "unknown";
93+
String endpoint = path.startsWith("/") ? path.substring(1) : path;
9494

95-
if(path.length() > 1 && path.charAt(1) == 'v') {
95+
if (path.length() > 1 && path.charAt(1) == 'v') {
9696
int apiVIndex = path.indexOf("/", 1);
9797
if (apiVIndex > 1) {
9898
apiVersion = path.substring(1, apiVIndex);
9999
endpoint = path.substring(apiVIndex + 1);
100-
} else {
101-
apiVersion = "unknown";
102100
}
103101
}
104102

src/main/resources/com.uid2.core/test/salts/metadata.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
"id_secret" : "HF6Qz42HBbVHINxhh191dB09BCuTWyBkNtrNicO4ZCw=",
77
"salts" : [
88
{
9-
"effective" : 1670796729291,
10-
"expires" : 1766125493000,
11-
"location" : "/com.uid2.core/test/salts/salts.txt.1670796729291",
12-
"size" : 2
13-
},{
9+
"effective" : 1670796729291,
10+
"expires" : 1766125493000,
11+
"location" : "/com.uid2.core/test/salts/salts.txt.1670796729291",
12+
"size" : 2
13+
},{
1414
"effective" : 1745907348982,
15-
"expires" : 1780620362000,
15+
"expires" : 1766720293000,
1616
"location" : "/com.uid2.core/test/salts/salts.txt.1745907348982",
17-
"size" : 4
17+
"size" : 2
1818
}
1919
]
20-
}
20+
}
21+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1000000,1614556800000,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnss=,,,,,,,,
2-
1000001,1643235130717,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnsP=,,,,,,,,
1+
1000000,1806364800001,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnss=,1814140800000,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnsS=,,,,,,
2+
1000001,1786924800001,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnst=,1812844800000,,,,,,,
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
1000000,1614556800000,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnss=,,,,,,,,
2-
1000001,1643235130717,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnss=,,,,,,,,
3-
1000002,1614556000010,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnss=,,,,,,,,
4-
1000003,1643235230717,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnss=,,,,,,,,
1+
1000000,1806364800001,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnss=,1814140800000,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnsS=,,,,,,
2+
1000001,1786924800001,vgv1BwiNRCW7F3VcNXHlZh+7oHJ4G4gCshbGcVOLnst=,1812844800000,,,,,,,

src/test/java/com/uid2/operator/EUIDOperatorVerticleTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void badRequestOnInvalidTcfConsent(Vertx vertx, VertxTestContext testContext) {
4040
final JsonObject v2Payload = new JsonObject();
4141
v2Payload.put("email", emailAddress);
4242
v2Payload.put("tcf_consent_string", "invalid_consent_string");
43-
sendTokenGenerate("v2", vertx, "", v2Payload, 400, json -> testContext.completeNow());
43+
sendTokenGenerate(vertx, v2Payload, 400, json -> testContext.completeNow());
4444
}
4545

4646
@Test
@@ -53,7 +53,7 @@ void noTCFString(Vertx vertx, VertxTestContext testContext) {
5353
final String emailAddress = "test@uid2.com";
5454
final JsonObject v2Payload = new JsonObject();
5555
v2Payload.put("email", emailAddress);
56-
sendTokenGenerate("v2", vertx, "", v2Payload, 200, json -> testContext.completeNow(), false);
56+
sendTokenGenerate(vertx, v2Payload, 200, json -> testContext.completeNow(), false);
5757

5858
}
5959

@@ -69,7 +69,7 @@ void noContentOnInsufficientTcfConsent(Vertx vertx, VertxTestContext testContext
6969
v2Payload.put("email", emailAddress);
7070
// this TCString is missing consent for purpose #1
7171
v2Payload.put("tcf_consent_string", "CPehXK9PehXK9ABAMBFRACBoADAAAEJAAIYgAKwAQAKgArABAAqAAA");
72-
sendTokenGenerate("v2", vertx, "", v2Payload, 200, json -> {
72+
sendTokenGenerate(vertx, v2Payload, 200, json -> {
7373
assertFalse(json.containsKey("body"));
7474
assertEquals("insufficient_user_consent", json.getString("status"));
7575
testContext.completeNow();

src/test/java/com/uid2/operator/StatsCollectorVerticleTest.java

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,6 @@ private void triggerSerializeAndWait(VertxTestContext testContext) throws JsonPr
7373
testContext.awaitCompletion(LOG_WAIT_INTERVAL, TimeUnit.MILLISECONDS);
7474
}
7575

76-
@Test
77-
void testJSONSerializeWithV0AndV1Paths(Vertx vertx, VertxTestContext testContext) throws InterruptedException, JsonProcessingException {
78-
StatsCollectorMessageItem messageItem = new StatsCollectorMessageItem("/test", "https://test.com", "test", 1, CLIENT_VERSION);
79-
sendStatMessage(messageItem);
80-
sendStatMessage(messageItem);
81-
sendStatMessage(messageItem);
82-
83-
messageItem = new StatsCollectorMessageItem("/v1/test", "https://test.com", "test", 1, CLIENT_VERSION);
84-
sendStatMessage(messageItem);
85-
sendStatMessage(messageItem);
86-
waitForLogInterval(testContext);
87-
88-
triggerSerializeAndWait(testContext);
89-
90-
var expectedList = List.of("{\"endpoint\":\"test\",\"siteId\":1,\"apiVersion\":\"v1\",\"domainList\":[{\"domain\":\"test.com\",\"count\":2,\"apiContact\":\"test\"}]}",
91-
"{\"endpoint\":\"test\",\"siteId\":1,\"apiVersion\":\"v0\",\"domainList\":[{\"domain\":\"test.com\",\"count\":3,\"apiContact\":\"test\"}]}");
92-
var messages = getMessages();
93-
assertThat(messages).containsAll(expectedList);
94-
95-
testContext.completeNow();
96-
}
97-
9876
private static void waitForLogInterval(VertxTestContext testContext) throws InterruptedException {
9977
testContext.awaitCompletion(JSON_INTERVAL*2, TimeUnit.MILLISECONDS);
10078
}
@@ -134,7 +112,7 @@ void allValidPathsAllowed(Vertx vertx, VertxTestContext testContext) throws Inte
134112
var messages = getMessages();
135113
for(String endpoint: validEndpoints) {
136114
String withoutVersion = endpoint;
137-
if (endpoint.startsWith("/v1/") || endpoint.startsWith("/v2/") || endpoint.startsWith("/v3/")) {
115+
if (endpoint.startsWith("/v2/") || endpoint.startsWith("/v3/")) {
138116
withoutVersion = endpoint.substring(4);
139117
} else if (endpoint.startsWith("/")) {
140118
withoutVersion = endpoint.substring(1);
@@ -160,11 +138,11 @@ void invalidPathsLimit(Vertx vertx, VertxTestContext testContext) throws Interru
160138
var messages = getMessages();
161139
// MAX_INVALID_PATHS is not the hard limit. The maximum paths that can be recorded, including valid ones, is MAX_INVALID_PATHS + validPaths.size * 2
162140
for(int i = 0; i < MAX_INVALID_PATHS + Endpoints.pathSet().size(); i++) {
163-
String expected = "{\"endpoint\":\"bad" + i + "\",\"siteId\":1,\"apiVersion\":\"v0\",\"domainList\":[{\"domain\":\"test.com\",\"count\":1,\"apiContact\":\"test\"}]}";
141+
String expected = "{\"endpoint\":\"bad" + i + "\",\"siteId\":1,\"apiVersion\":\"unknown\",\"domainList\":[{\"domain\":\"test.com\",\"count\":1,\"apiContact\":\"test\"}]}";
164142
assertThat(messages).contains(expected);
165143
}
166144
for(int i = MAX_INVALID_PATHS + Endpoints.pathSet().size(); i < MAX_INVALID_PATHS + 5; i++) {
167-
String expected = "{\"endpoint\":\"bad" + i + "\",\"siteId\":1,\"apiVersion\":\"v0\",\"domainList\":[{\"domain\":\"test.com\",\"count\":1,\"apiContact\":\"test\"}]}";
145+
String expected = "{\"endpoint\":\"bad" + i + "\",\"siteId\":1,\"apiVersion\":\"unknown\",\"domainList\":[{\"domain\":\"test.com\",\"count\":1,\"apiContact\":\"test\"}]}";
168146
assertThat(messages).contains(expected);
169147
}
170148
assertThat(getMessages()).contains("max invalid paths reached; a large number of invalid paths have been requested from authenticated participants");

0 commit comments

Comments
 (0)