Skip to content

Commit c8ac598

Browse files
committed
Merge remote-tracking branch 'origin/master' into add-vertx-uri-template
2 parents ec833c6 + 6460b38 commit c8ac598

72 files changed

Lines changed: 2181 additions & 143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extra/bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.prebid</groupId>
77
<artifactId>prebid-server-aggregator</artifactId>
8-
<version>3.42.0-SNAPSHOT</version>
8+
<version>3.43.0-SNAPSHOT</version>
99
<relativePath>../../extra/pom.xml</relativePath>
1010
</parent>
1111

extra/modules/confiant-ad-quality/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.prebid.server.hooks.modules</groupId>
77
<artifactId>all-modules</artifactId>
8-
<version>3.42.0-SNAPSHOT</version>
8+
<version>3.43.0-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>confiant-ad-quality</artifactId>

extra/modules/fiftyone-devicedetection/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.prebid.server.hooks.modules</groupId>
77
<artifactId>all-modules</artifactId>
8-
<version>3.42.0-SNAPSHOT</version>
8+
<version>3.43.0-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>fiftyone-devicedetection</artifactId>
@@ -14,7 +14,7 @@
1414
<description>51Degrees Device Detection module</description>
1515

1616
<properties>
17-
<fiftyone-device-detection.version>4.4.226</fiftyone-device-detection.version>
17+
<fiftyone-device-detection.version>4.5.51</fiftyone-device-detection.version>
1818
</properties>
1919

2020
<dependencies>

extra/modules/fiftyone-devicedetection/src/main/java/org/prebid/server/hooks/modules/fiftyone/devicedetection/v1/core/DeviceEnricher.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ private EnrichmentResult patchDevice(Device device, DeviceData deviceData) {
9797
updatedFields.add("model");
9898
}
9999

100+
final UpdateResult<String> resolvedHwv = resolveDeviceHwv(device, deviceData);
101+
if (resolvedHwv.isUpdated()) {
102+
deviceBuilder.hwv(resolvedHwv.getValue());
103+
updatedFields.add("hwv");
104+
}
105+
100106
final UpdateResult<String> resolvedOs = resolveOs(device, deviceData);
101107
if (resolvedOs.isUpdated()) {
102108
deviceBuilder.os(resolvedOs.getValue());
@@ -184,6 +190,11 @@ private UpdateResult<String> resolveModel(Device device, DeviceData deviceData)
184190
return UpdateResult.unaltered(currentModel);
185191
}
186192

193+
final String hardwareNamePrefix = getSafe(deviceData, DeviceData::getHardwareNamePrefix);
194+
if (StringUtils.isNotBlank(hardwareNamePrefix)) {
195+
return UpdateResult.updated(hardwareNamePrefix);
196+
}
197+
187198
final String model = getSafe(deviceData, DeviceData::getHardwareModel);
188199
if (StringUtils.isNotBlank(model)) {
189200
return UpdateResult.updated(model);
@@ -284,6 +295,18 @@ private UpdateResult<String> resolveDeviceId(Device device, DeviceData deviceDat
284295
: UpdateResult.unaltered(currentDeviceId);
285296
}
286297

298+
private UpdateResult<String> resolveDeviceHwv(Device device, DeviceData deviceData) {
299+
final String currentDeviceHwv = device.getHwv();
300+
if (StringUtils.isNotEmpty(currentDeviceHwv)) {
301+
return UpdateResult.unaltered(currentDeviceHwv);
302+
}
303+
304+
final String deviceHwv = getSafe(deviceData, DeviceData::getHardwareNameVersion);
305+
return StringUtils.isNotEmpty(deviceHwv)
306+
? UpdateResult.updated(deviceHwv)
307+
: UpdateResult.unaltered(currentDeviceHwv);
308+
}
309+
287310
private static boolean isPositive(Integer value) {
288311
return value != null && value > 0;
289312
}

extra/modules/fiftyone-devicedetection/src/test/java/org/prebid/server/hooks/modules/fiftyone/devicedetection/v1/core/DeviceEnricherTest.java

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ public void populateDeviceInfoShouldEnrichAllPropertiesWhenDeviceIsEmpty() throw
273273
"devicetype",
274274
"make",
275275
"model",
276+
"hwv",
276277
"os",
277278
"osv",
278279
"h",
@@ -335,6 +336,28 @@ public void populateDeviceInfoShouldEnrichMakeWhenItIsMissing() throws Exception
335336
assertThat(result.enrichedDevice().getMake()).isEqualTo(buildCompleteDevice().getMake());
336337
}
337338

339+
@Test
340+
public void populateDeviceInfoShouldEnrichModelWithHardwareNamePrefixWhenItIsMissing() throws Exception {
341+
// given
342+
final Device testDevice = buildCompleteDevice().toBuilder()
343+
.model(null)
344+
.build();
345+
final String expectedModel = "NinjaTech";
346+
when(deviceData.getHardwareNamePrefix())
347+
.thenReturn(aspectPropertyValueWith(expectedModel));
348+
when(deviceData.getHardwareModel()).thenThrow(new RuntimeException());
349+
350+
// when
351+
final CollectedEvidence collectedEvidence = CollectedEvidence.builder()
352+
.deviceUA("fake-UserAgent")
353+
.build();
354+
final EnrichmentResult result = target.populateDeviceInfo(testDevice, collectedEvidence);
355+
356+
// then
357+
assertThat(result.enrichedFields()).hasSize(1);
358+
assertThat(result.enrichedDevice().getModel()).isEqualTo(expectedModel);
359+
}
360+
338361
@Test
339362
public void populateDeviceInfoShouldEnrichModelWithHWNameWhenHWModelIsMissing() throws Exception {
340363
// given
@@ -366,6 +389,7 @@ public void populateDeviceInfoShouldEnrichModelWhenItIsMissing() throws Exceptio
366389

367390
// when
368391
buildCompleteDeviceData();
392+
when(deviceData.getHardwareNamePrefix()).thenReturn(null);
369393
final CollectedEvidence collectedEvidence = CollectedEvidence.builder()
370394
.deviceUA("fake-UserAgent")
371395
.build();
@@ -376,6 +400,28 @@ public void populateDeviceInfoShouldEnrichModelWhenItIsMissing() throws Exceptio
376400
assertThat(result.enrichedDevice().getModel()).isEqualTo(buildCompleteDevice().getModel());
377401
}
378402

403+
@Test
404+
public void populateDeviceInfoShouldEnrichHwvWithHardwareNameVersionWhenItIsMissing() throws Exception {
405+
// given
406+
final Device testDevice = buildCompleteDevice().toBuilder()
407+
.hwv(null)
408+
.build();
409+
final String expectedHwv = "NinjaTech";
410+
when(deviceData.getHardwareNameVersion())
411+
.thenReturn(aspectPropertyValueWith(expectedHwv));
412+
when(deviceData.getHardwareModel()).thenReturn(null);
413+
414+
// when
415+
final CollectedEvidence collectedEvidence = CollectedEvidence.builder()
416+
.deviceUA("fake-UserAgent")
417+
.build();
418+
final EnrichmentResult result = target.populateDeviceInfo(testDevice, collectedEvidence);
419+
420+
// then
421+
assertThat(result.enrichedFields()).hasSize(1);
422+
assertThat(result.enrichedDevice().getHwv()).isEqualTo(expectedHwv);
423+
}
424+
379425
@Test
380426
public void populateDeviceInfoShouldEnrichOsWhenItIsMissing() throws Exception {
381427
// given
@@ -534,6 +580,7 @@ private static Device buildCompleteDevice() {
534580
.devicetype(1)
535581
.make("StarFleet")
536582
.model("communicator")
583+
.hwv("hmv")
537584
.os("NeutronAI")
538585
.osv("X-502")
539586
.h(5051)
@@ -551,6 +598,8 @@ private void buildCompleteDeviceData() {
551598
when(deviceData.getHardwareVendor()).thenReturn(aspectPropertyValueWith("StarFleet"));
552599
when(deviceData.getHardwareModel()).thenReturn(aspectPropertyValueWith("communicator"));
553600
when(deviceData.getPlatformName()).thenReturn(aspectPropertyValueWith("NeutronAI"));
601+
when(deviceData.getHardwareNamePrefix()).thenReturn(aspectPropertyValueWith("Prefix"));
602+
when(deviceData.getHardwareNameVersion()).thenReturn(aspectPropertyValueWith("Version"));
554603
when(deviceData.getPlatformVersion()).thenReturn(aspectPropertyValueWith("X-502"));
555604
when(deviceData.getScreenPixelsHeight()).thenReturn(aspectPropertyValueWith(5051));
556605
when(deviceData.getScreenPixelsWidth()).thenReturn(aspectPropertyValueWith(3001));

extra/modules/greenbids-real-time-data/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.prebid.server.hooks.modules</groupId>
66
<artifactId>all-modules</artifactId>
7-
<version>3.42.0-SNAPSHOT</version>
7+
<version>3.43.0-SNAPSHOT</version>
88
</parent>
99

1010
<artifactId>greenbids-real-time-data</artifactId>

extra/modules/live-intent-omni-channel-identity/README.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,48 @@
22

33
This module enriches bid requests with user EIDs.
44

5-
The user EIDs to be enriched are configured per partner as part of the LiveIntent HIRO onboarding process. As part of this onboarding process, partners will also be provided with the `identity-resolution-endpoint` URL as well as with the `auth-token`.
5+
The user EIDs to be enriched are configured per partner as part of the LiveIntent HIRO onboarding process. As part of
6+
this onboarding process, partners will also be provided with the `identity-resolution-endpoint` URL as well as with the
7+
`auth-token`.
68

7-
`treatment-rate` is a value between 0.0 and 1.0 (including 0.0 and 1.0) and defines the percentage of requests for which identity enrichment should be performed. This value can be freely picked. We recommend a value between 0.9 and 0.95
9+
`treatment-rate` is a value between 0.0 and 1.0 (including 0.0 and 1.0) and defines the percentage of requests for which
10+
identity enrichment should be performed. This value can be freely picked. We recommend a value between 0.9 and 0.95
811

912
## Configuration
1013

1114
To start using the LiveIntent Omni Channel Identity module you have to enable it and add configuration:
1215

1316
```yaml
1417
hooks:
15-
liveintent-omni-channel-identity:
16-
enabled: true
17-
host-execution-plan: >
18-
{
19-
"endpoints": {
20-
"/openrtb2/auction": {
21-
"stages": {
22-
"processed-auction-request": {
23-
"groups": [
24-
{
25-
"timeout": 100,
26-
"hook-sequence": [
18+
liveintent-omni-channel-identity:
19+
enabled: true
20+
host-execution-plan: >
21+
{
22+
"endpoints": {
23+
"/openrtb2/auction": {
24+
"stages": {
25+
"processed-auction-request": {
26+
"groups": [
2727
{
28-
"module-code": "liveintent-omni-channel-identity",
29-
"hook-impl-code": "liveintent-omni-channel-identity-enrichment-hook"
28+
"timeout": 100,
29+
"hook-sequence": [
30+
{
31+
"module-code": "liveintent-omni-channel-identity",
32+
"hook-impl-code": "liveintent-omni-channel-identity-enrichment-hook"
33+
}
34+
]
3035
}
3136
]
3237
}
33-
]
38+
}
3439
}
3540
}
3641
}
37-
}
38-
}
39-
modules:
40-
liveintent-omni-channel-identity:
41-
request-timeout-ms: 2000
42-
identity-resolution-endpoint: "https://liveintent.com/idx"
43-
auth-token: "secret-token"
44-
treatment-rate: 0.9
42+
modules:
43+
liveintent-omni-channel-identity:
44+
request-timeout-ms: 2000
45+
identity-resolution-endpoint: "https://u.liveintent.com/idx"
46+
auth-token: "secret-token"
47+
treatment-rate: 0.9
4548
```
4649

extra/modules/live-intent-omni-channel-identity/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.prebid.server.hooks.modules</groupId>
66
<artifactId>all-modules</artifactId>
7-
<version>3.42.0-SNAPSHOT</version>
7+
<version>3.43.0-SNAPSHOT</version>
88
</parent>
99

1010
<artifactId>live-intent-omni-channel-identity</artifactId>

0 commit comments

Comments
 (0)