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

Fix TCF policy test #3507

Merged
Merged
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
2 changes: 1 addition & 1 deletion extra/bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid</groupId>
<artifactId>prebid-server-aggregator</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
<relativePath>../../extra/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion extra/modules/confiant-ad-quality/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
</parent>

<artifactId>confiant-ad-quality</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extra/modules/fiftyone-devicedetection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
</parent>

<artifactId>fiftyone-devicedetection</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extra/modules/ortb2-blocking/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
</parent>

<artifactId>ortb2-blocking</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extra/modules/pb-response-correction/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
</parent>

<artifactId>pb-response-correction</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extra/modules/pb-richmedia-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid.server.hooks.modules</groupId>
<artifactId>all-modules</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
</parent>

<artifactId>pb-richmedia-filter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extra/modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid</groupId>
<artifactId>prebid-server-aggregator</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
<relativePath>../../extra/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion extra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.prebid</groupId>
<artifactId>prebid-server-aggregator</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
<packaging>pom</packaging>

<scm>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.prebid</groupId>
<artifactId>prebid-server-aggregator</artifactId>
<version>3.13.0-SNAPSHOT</version>
<version>3.14.0-SNAPSHOT</version>
<relativePath>extra/pom.xml</relativePath>
</parent>

Expand Down
27 changes: 9 additions & 18 deletions src/main/java/com/iab/openrtb/request/Eid.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
package com.iab.openrtb.request;

import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Builder;
import lombok.Value;

import java.util.List;

/**
* Extended identifiers support in the OpenRTB specification allows buyers
* to use audience data in real-time bidding. This object can contain one
* or more {@link Uid}s from a single source or a technology provider. The
* exchange should ensure that business agreements allow for the sending
* of this data.
*/
@Value(staticConstructor = "of")
@Value
@Builder(toBuilder = true)
public class Eid {

/**
* Source or technology provider responsible for the set of included IDs. Expressed as a top-level domain.
*/
String source;

/**
* Array of extended ID {@link Uid} objects from the given source.
* Refer to 3.2.28 Extended Identifier UIDs
*/
List<Uid> uids;

/**
* Placeholder for vendor specific extensions to this object
*/
String inserter;

String matcher;

Integer mm;

ObjectNode ext;
}
4 changes: 3 additions & 1 deletion src/main/java/com/iab/openrtb/request/Uid.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package com.iab.openrtb.request;

import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Builder;
import lombok.Value;

/**
* This object contains a single user identifier provided as part of
* extended identifiers. The exchange should ensure that business
* agreements allow for the sending of this data.
*/
@Value(staticConstructor = "of")
@Value
@Builder(toBuilder = true)
public class Uid {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,12 @@ private boolean isNotAllowedAdapterByGlobalOrAccountAnalyticsConfig(String adapt

if (modules != null && modules.containsKey(adapter)) {
final ObjectNode moduleConfig = modules.get(adapter);
return moduleConfig == null || !moduleConfig.has("enabled")
|| !moduleConfig.get("enabled").asBoolean();

if (moduleConfig == null || !moduleConfig.has("enabled")) {
return false;
}

return !moduleConfig.get("enabled").asBoolean();
}

return !globalEnabledAdapters.contains(adapter);
Expand Down Expand Up @@ -421,12 +425,13 @@ private AuctionContext updateAuctionContext(AuctionContext context, String adapt
if (modules != null && modules.containsKey(adapterName)) {
final ObjectNode moduleConfig = modules.get(adapterName);
if (moduleConfigContainsAdapterSpecificData(moduleConfig)) {
final JsonNode analyticsNode = Optional.ofNullable(context.getBidRequest())
final ExtRequestPrebid extRequestPrebid = Optional.ofNullable(context.getBidRequest())
.map(BidRequest::getExt)
.map(ExtRequest::getPrebid)
.map(ExtRequestPrebid::getAnalytics)
.orElse(null);

final JsonNode analyticsNode = extRequestPrebid != null ? extRequestPrebid.getAnalytics() : null;

if (analyticsNode != null && analyticsNode.isObject()) {
final ObjectNode adapterNode = Optional.ofNullable((ObjectNode) analyticsNode.get(adapterName))
.orElse(mapper.mapper().createObjectNode());
Expand All @@ -439,7 +444,7 @@ private AuctionContext updateAuctionContext(AuctionContext context, String adapt
});

((ObjectNode) analyticsNode).set(adapterName, adapterNode);
final ExtRequestPrebid updatedPrebid = ExtRequestPrebid.builder()
final ExtRequestPrebid updatedPrebid = extRequestPrebid.toBuilder()
.analytics(analyticsNode)
.build();
final ExtRequest updatedExtRequest = ExtRequest.of(updatedPrebid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.vertx.core.CompositeFuture;
import io.vertx.core.Future;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
Expand Down Expand Up @@ -191,10 +192,11 @@ Future<BidResponse> createOnSkippedAuction(AuctionContext auctionContext, List<S
.tmaxrequest(bidRequest.getTmax())
.build();

final List<String> cur = bidRequest.getCur();
final BidResponse bidResponse = BidResponse.builder()
.id(bidRequest.getId())
.cur(Stream.ofNullable(bidRequest.getCur()).flatMap(Collection::stream).findFirst().orElse(null))
.seatbid(Optional.ofNullable(seatBids).orElse(Collections.emptyList()))
.cur(CollectionUtils.isNotEmpty(cur) ? cur.getFirst() : null)
.seatbid(ListUtils.emptyIfNull(seatBids))
.ext(extBidResponse)
.build();

Expand Down
9 changes: 4 additions & 5 deletions src/main/java/org/prebid/server/auction/BidsAdjuster.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ private AuctionParticipation validBidderResponse(AuctionParticipation auctionPar

final List<String> requestCurrencies = bidRequest.getCur();
if (requestCurrencies.size() > 1) {
errors.add(BidderError.badInput("Cur parameter contains more than one currency. %s will be used"
.formatted(requestCurrencies.getFirst())));
warnings.add(BidderError.badInput(
"a single currency (" + requestCurrencies.getFirst() + ") has been chosen for the request. "
+ "ORTB 2.6 requires that all responses are in the same currency."));
}

final List<BidderBid> bids = seatBid.getBids();
Expand All @@ -118,9 +119,7 @@ private AuctionParticipation validBidderResponse(AuctionParticipation auctionPar
}
}

final BidderResponse resultBidderResponse = errors.size() == seatBid.getErrors().size()
? bidderResponse
: bidderResponse.with(
final BidderResponse resultBidderResponse = bidderResponse.with(
seatBid.toBuilder()
.bids(validBids)
.errors(errors)
Expand Down
Loading
Loading