Skip to content

Commit d2ef40b

Browse files
committed
Add GetInterfaceHandler and GetInterfaceRequestFactory
1 parent 3eaafd4 commit d2ef40b

19 files changed

Lines changed: 1350 additions & 43 deletions

File tree

extra/modules/wurfl-devicedetection/src/main/java/org/prebid/server/hooks/modules/com/scientiamobile/wurfl/devicedetection/v1/OrtbDeviceUpdater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ private ExtDevice updateExt(ExtDevice ortbExtDevice) {
247247
}
248248

249249
private ExtDevice copyExtDevice(ExtDevice original) {
250-
final ExtDevice copy = ExtDevice.of(original.getAtts(), original.getPrebid());
250+
final ExtDevice copy = ExtDevice.of(original.getAtts(), original.getIfaType(), original.getPrebid());
251251
mapper.fillExtension(copy, original);
252252
return copy;
253253
}

extra/modules/wurfl-devicedetection/src/test/java/org/prebid/server/hooks/modules/com/scientiamobile/wurfl/devicedetection/v1/WURFLDeviceDetectionRawAuctionRequestHookTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void callShouldReturnNoActionWhenDeviceHasWurflProperty() {
9696
// given
9797
final String ua = "Mozilla/5.0 (testPhone; CPU testPhone OS 1_0_2) Version/17.4.1 Mobile/12E GrandTest/604.1";
9898
final ExtDevicePrebid extDevicePrebid = ExtDevicePrebid.of(ExtDeviceInt.of(80, 80));
99-
final ExtDevice extDevice = ExtDevice.of(0, extDevicePrebid);
99+
final ExtDevice extDevice = ExtDevice.of(0, null, extDevicePrebid);
100100
final ObjectNode wurfl = mapper.mapper().createObjectNode();
101101
wurfl.put("wurfl_id", "test_phone_ver1");
102102
extDevice.addProperty("wurfl", wurfl);

src/main/java/org/prebid/server/auction/requestfactory/AuctionRequestFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
*/
3939
public class AuctionRequestFactory {
4040

41+
private static final String ENDPOINT = Endpoint.openrtb2_auction.value();
42+
4143
private final long maxRequestSize;
4244
private final Ortb2RequestFactory ortb2RequestFactory;
4345
private final StoredRequestProcessor storedRequestProcessor;
@@ -55,8 +57,6 @@ public class AuctionRequestFactory {
5557
private final GeoLocationServiceWrapper geoLocationServiceWrapper;
5658
private final BidAdjustmentsEnricher bidAdjustmentsEnricher;
5759

58-
private static final String ENDPOINT = Endpoint.openrtb2_auction.value();
59-
6060
public AuctionRequestFactory(long maxRequestSize,
6161
Ortb2RequestFactory ortb2RequestFactory,
6262
StoredRequestProcessor storedRequestProcessor,

src/main/java/org/prebid/server/auction/requestfactory/GetInterfaceRequestFactory.java

Lines changed: 871 additions & 0 deletions
Large diffs are not rendered by default.

src/main/java/org/prebid/server/handler/openrtb2/GetInterfaceHandler.java

Lines changed: 343 additions & 0 deletions
Large diffs are not rendered by default.

src/main/java/org/prebid/server/log/HttpInteractionLogger.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ public void maybeLogOpenrtb2Amp(AuctionContext auctionContext,
7979
}
8080
}
8181

82+
public void maybeLogOpenrtb2GetInterface(AuctionContext auctionContext,
83+
RoutingContext routingContext,
84+
int statusCode,
85+
String responseBody) {
86+
87+
if (interactionSatisfiesSpec(HttpLogSpec.Endpoint.get_interface, statusCode, auctionContext)) {
88+
logger.info(
89+
"Requested URL: \"{}\", response status: \"{}\", response body: \"{}\"",
90+
routingContext.request().uri(),
91+
statusCode,
92+
responseBody);
93+
94+
incLoggedInteractions();
95+
}
96+
}
97+
8298
public void maybeLogBidderRequest(AuctionContext context, BidderRequest bidderRequest) {
8399
final String bidder = bidderRequest.getBidder();
84100
if (interactionSatisfiesSpec(context, bidder)) {

src/main/java/org/prebid/server/log/model/HttpLogSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public class HttpLogSpec {
1616
int limit;
1717

1818
public enum Endpoint {
19-
auction, amp
19+
auction, amp, get_interface
2020
}
2121
}

src/main/java/org/prebid/server/model/Endpoint.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public enum Endpoint {
1515
openrtb2_auction("/openrtb2/auction"),
1616
openrtb2_amp("/openrtb2/amp"),
1717
openrtb2_video("/openrtb2/video"),
18+
openrtb2_get_interface("/openrtb2/get"),
1819
cookie_sync("/cookie_sync"),
1920
setuid("/setuid"),
2021

src/main/java/org/prebid/server/proto/openrtb/ext/request/ExtDevice.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ public class ExtDevice extends FlexibleExtension {
1515

1616
Integer atts;
1717

18+
String ifaType;
19+
1820
ExtDevicePrebid prebid;
1921

2022
public static ExtDevice empty() {
21-
return of(null, null);
23+
return of(null, null, null);
2224
}
2325
}

src/main/java/org/prebid/server/proto/openrtb/ext/request/ExtRequestPrebid.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,10 @@ public class ExtRequestPrebid {
200200
ExtRequestPrebidAlternateBidderCodes alternateBidderCodes;
201201

202202
ObjectNode kvps;
203+
204+
@JsonProperty("outputformat")
205+
String outputFormat;
206+
207+
@JsonProperty("outputmodule")
208+
String outputModule;
203209
}

0 commit comments

Comments
 (0)