Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IX: fix ix adapter handling of paapi config #3563

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/main/java/org/prebid/server/bidder/ix/IxBidder.java
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,12 @@ private static ExtBidPrebidVideo videoInfo(ExtBidPrebidVideo extBidPrebidVideo)
private List<FledgeAuctionConfig> extractFledge(IxBidResponse bidResponse) {
return Optional.ofNullable(bidResponse)
.map(IxBidResponse::getExt)
.map(IxExtBidResponse::getFledgeAuctionConfigs)
.orElse(Collections.emptyMap())
.entrySet()
.map(IxExtBidResponse::getProtectedAudienceAuctionConfigs)
.filter(CollectionUtils::isNotEmpty)
.orElse(Collections.emptyList())
.stream()
.map(e -> FledgeAuctionConfig.builder().impId(e.getKey()).config(e.getValue()).build())
.map(ixAuctionConfig -> FledgeAuctionConfig.builder().impId(ixAuctionConfig.getBidId())
.config(ixAuctionConfig.getConfig()).build())
.toList();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.prebid.server.bidder.ix.model.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Value;

@Value(staticConstructor = "of")
public class AuctionConfigExtBidResponse {

@JsonProperty("bidId")
String bidId;

ObjectNode config;
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package org.prebid.server.bidder.ix.model.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Value;

import java.util.Map;
import java.util.List;

@Value(staticConstructor = "of")
public class IxExtBidResponse {

@JsonProperty("fledge_auction_configs")
Map<String, ObjectNode> fledgeAuctionConfigs;
@JsonProperty("protectedAudienceAuctionConfigs")
List<AuctionConfigExtBidResponse> protectedAudienceAuctionConfigs;

}
4 changes: 2 additions & 2 deletions src/test/java/org/prebid/server/bidder/ix/IxBidderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.mockito.junit.jupiter.MockitoExtension;
import org.prebid.server.VertxTest;
import org.prebid.server.bidder.ix.model.request.IxDiag;
import org.prebid.server.bidder.ix.model.response.AuctionConfigExtBidResponse;
import org.prebid.server.bidder.ix.model.response.IxBidResponse;
import org.prebid.server.bidder.ix.model.response.IxExtBidResponse;
import org.prebid.server.bidder.ix.model.response.NativeV11Wrapper;
Expand All @@ -49,7 +50,6 @@
import org.prebid.server.version.PrebidVersionProvider;

import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.function.UnaryOperator;

Expand Down Expand Up @@ -778,7 +778,7 @@ public void makeBidderResponseShouldReturnFledgeAuctionConfig() throws JsonProce
final IxBidResponse bidResponseWithFledge = IxBidResponse.builder()
.cur(bidResponse.getCur())
.seatbid(bidResponse.getSeatbid())
.ext(IxExtBidResponse.of(Map.of(impId, fledgeAuctionConfig)))
.ext(IxExtBidResponse.of(List.of(AuctionConfigExtBidResponse.of(impId, fledgeAuctionConfig))))
.build();
final BidderCall<BidRequest> httpCall =
givenHttpCall(bidRequest, mapper.writeValueAsString(bidResponseWithFledge));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"h": 250
},
"ext": {
"ae": 1,
"ix": {
"siteId": "10002"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,47 @@
"ix": "{{ ix.response_time_ms }}"
},
"prebid": {
"auctiontimestamp": 0
"auctiontimestamp": 0,
"fledge": {
"auctionconfigs": [
{
"impid": "imp_id",
"bidder": "ix",
"adapter": "ix",
"config": {
"seller": "https://test.casalemedia.com",
"decisionLogicUrl": "https://test.casalemedia.com/decision-logic.js",
"trustedScoringSignalsURL": "https://test.casalemedia.com/123",
"interestGroupBuyers": [
"https://test.com"
],
"sellerSignals": {
"callbackURL": "https://test.casalemedia.com/callback/1",
"debugURL": "https://test.casalemedia.com/debug/1",
"width": 300,
"height": 250
},
"sellerTimeout": 150,
"perBuyerSignals": {
"https://test.com": [
{
"key": "value"
}
]
},
"perBuyerCurrencies": {
"*": "USD"
},
"sellerCurrency": "USD",
"requestedSize": {
"width": 300,
"height": 250
},
"maxTrustedBiddingSignalsURLLength": 1000
}
}
]
}
},
"tmaxrequest": 5000
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"h": 250
},
"ext": {
"ae": 1,
"tid": "${json-unit.any-string}",
"bidder": {
"siteId": "10002"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,43 @@
],
"seat": "seatId6"
}
]
],
"ext": {
"protectedAudienceAuctionConfigs": [
{
"bidId": "imp_id",
"config": {
"seller": "https://test.casalemedia.com",
"decisionLogicUrl": "https://test.casalemedia.com/decision-logic.js",
"trustedScoringSignalsURL": "https://test.casalemedia.com/123",
"interestGroupBuyers": [
"https://test.com"
],
"sellerSignals": {
"callbackURL": "https://test.casalemedia.com/callback/1",
"debugURL": "https://test.casalemedia.com/debug/1",
"width": 300,
"height": 250
},
"sellerTimeout": 150,
"perBuyerSignals": {
"https://test.com": [
{
"key": "value"
}
]
},
"perBuyerCurrencies": {
"*": "USD"
},
"sellerCurrency": "USD",
"requestedSize": {
"width": 300,
"height": 250
},
"maxTrustedBiddingSignalsURLLength": 1000
}
}
]
}
}