Skip to content

Commit

Permalink
Merge branch 'master' into dependencies/bump-gpp-library
Browse files Browse the repository at this point in the history
  • Loading branch information
Compile-Ninja committed May 7, 2024
2 parents 42ccc8f + bc76b28 commit 6df1708
Show file tree
Hide file tree
Showing 68 changed files with 292 additions and 1,875 deletions.
18 changes: 9 additions & 9 deletions docs/config-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ This parameter exists to allow to change the location of the directory Vert.x wi
- `server.jks-password` - password for the keystore (if ssl is enabled).

## HTTP Server
- `http.max-headers-size` - set the maximum length of all headers, deprecated(use server.max-headers-size instead).
- `http.ssl` - enable SSL/TLS support, deprecated(use server.ssl instead).
- `http.jks-path` - path to the java keystore (if ssl is enabled), deprecated(use server.jks-path instead).
- `http.jks-password` - password for the keystore (if ssl is enabled), deprecated(use server.jks-password instead).
- `server.max-headers-size` - set the maximum length of all headers, deprecated(use server.max-headers-size instead).
- `server.ssl` - enable SSL/TLS support, deprecated(use server.ssl instead).
- `server.jks-path` - path to the java keystore (if ssl is enabled), deprecated(use server.jks-path instead).
- `server.jks-password` - password for the keystore (if ssl is enabled), deprecated(use server.jks-password instead).
- `server.http.server-instances` - how many http server instances should be created.
This parameter affects how many CPU cores will be utilized by the application. Rough assumption - one http server instance will keep 1 CPU core busy.
- `server.http.enabled` - if set to `true` enables http server
Expand Down Expand Up @@ -75,8 +75,8 @@ Removes and downloads file again if depending service cant process probably corr
- `default-request.file.path` - path to a JSON file containing the default request

## Auction (OpenRTB)
- `auction.blacklisted-accounts` - comma separated list of blacklisted account IDs.
- `auction.blacklisted-apps` - comma separated list of blacklisted applications IDs, requests from which should not be processed.
- `auction.blocklisted-accounts` - comma separated list of blocklisted account IDs.
- `auction.blocklisted-apps` - comma separated list of blocklisted applications IDs, requests from which should not be processed.
- `auction.max-timeout-ms` - maximum operation timeout for OpenRTB Auction requests. Deprecated.
- `auction.biddertmax.min` - minimum operation timeout for OpenRTB Auction requests.
- `auction.biddertmax.max` - maximum operation timeout for OpenRTB Auction requests.
Expand Down Expand Up @@ -104,7 +104,7 @@ Removes and downloads file again if depending service cant process probably corr

## Video
- `auction.video.stored-required` - flag forces to merge with stored request
- `auction.blacklisted-accounts` - comma separated list of blacklisted account IDs.
- `auction.blocklisted-accounts` - comma separated list of blocklisted account IDs.
- `video.stored-requests-timeout-ms` - timeout for stored requests fetching.
- `auction.ad-server-currency` - default currency for video auction, if its value was not specified in request. Important note: PBS uses ISO-4217 codes for the representation of currencies.
- `auction.video.escape-log-cache-regex` - regex to remove from cache debug log xml.
Expand Down Expand Up @@ -346,10 +346,10 @@ available: `/cache/invalidate?account={accountId}` which remove account from the
- `settings.in-memory-cache.http-update.timeout` - timeout for obtaining stored request updates.
- `settings.in-memory-cache.database-update.init-query` - initial query for fetching all stored requests at the startup.
- `settings.in-memory-cache.database-update.update-query` - a query for periodical update of stored requests, that should
contain 'WHERE last_updated > ?' to fetch only the records that were updated since previous check.
contain 'WHERE last_updated > ?' for MySQL and 'WHERE last_updated > $1' for Postgresql to fetch only the records that were updated since previous check.
- `settings.in-memory-cache.database-update.amp-init-query` - initial query for fetching all AMP stored requests at the startup.
- `settings.in-memory-cache.database-update.amp-update-query` - a query for periodical update of AMP stored requests, that should
contain 'WHERE last_updated > ?' to fetch only the records that were updated since previous check.
contain 'WHERE last_updated > ?' for MySQL and 'WHERE last_updated > $1' for Postgresql to fetch only the records that were updated since previous check.
- `settings.in-memory-cache.database-update.refresh-rate` - refresh period in ms for stored request updates.
- `settings.in-memory-cache.database-update.timeout` - timeout for obtaining stored request updates.

Expand Down
4 changes: 2 additions & 2 deletions docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Other available metrics not mentioned here can found at

where:
- `[IP]` should be equal to IP address of bound network interface on cluster node for Prebid Server (for example: `0.0.0.0`)
- `[PORT]` should be equal to `http.port` configuration property
- `[PORT]` should be equal to `server.http.port` configuration property

### HTTP client metrics
- `vertx.http.clients.connections.{min,max,mean,p95,p99}` - how long connections live
Expand Down Expand Up @@ -44,7 +44,7 @@ where `[DATASOURCE]` is a data source name, `DEFAULT_DS` by defaul.
- `imps_video` - number of video impressions
- `imps_native` - number of native impressions
- `imps_audio` - number of audio impressions
- `requests.(ok|badinput|err|networkerr|blacklisted_account|blacklisted_app).(openrtb2-web|openrtb-app|amp|legacy)` - number of requests broken down by status and type
- `requests.(ok|badinput|err|networkerr|blocklisted_account|blocklisted_app).(openrtb2-web|openrtb-app|amp|legacy)` - number of requests broken down by status and type
- `bidder-cardinality.<cardinality>.requests` - number of requests targeting `<cardinality>` of bidders
- `connection_accept_errors` - number of errors occurred while establishing HTTP connection
- `db_query_time` - timer tracking how long did it take for database client to obtain the result for a query
Expand Down
6 changes: 3 additions & 3 deletions extra/modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
<assertj.version>3.23.1</assertj.version>
<junit.version>4.13.2</junit.version>
<mockito.version>4.7.0</mockito.version>

<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -113,6 +110,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<skipTests>${skipUnitTests}</skipTests>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Expand Down
3 changes: 3 additions & 0 deletions extra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<vertx.version>4.5.5</vertx.version>
<lombok.version>1.18.30</lombok.version>
<maven-release-plugin.version>3.0.0-M6</maven-release-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<skipUnitTests>false</skipUnitTests>
</properties>

<modules>
Expand Down
3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,11 @@
<download-plugin.version>1.2.0</download-plugin.version>
<jacoco-plugin.version>0.8.11</jacoco-plugin.version>
<git-commmit-plugin.version>2.2.4</git-commmit-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>
<docker-maven-plugin.version>0.40.2</docker-maven-plugin.version>
<gmavenplus-plugin.version>3.0.2</gmavenplus-plugin.version>
<skipFunctionalTests>false</skipFunctionalTests>
<skipModuleFunctionalTests>true</skipModuleFunctionalTests>
<skipUnitTests>false</skipUnitTests>
<os-maven-plugin.version>1.6.2</os-maven-plugin.version>
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
Expand Down
12 changes: 1 addition & 11 deletions src/main/java/org/prebid/server/auction/BidResponseCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.prebid.server.auction.model.MultiBidConfig;
import org.prebid.server.auction.model.TargetingInfo;
import org.prebid.server.auction.model.debug.DebugContext;
import org.prebid.server.auction.requestfactory.Ortb2ImplicitParametersResolver;
import org.prebid.server.bidder.BidderCatalog;
import org.prebid.server.bidder.model.BidderBid;
import org.prebid.server.bidder.model.BidderError;
Expand Down Expand Up @@ -1444,16 +1443,7 @@ private static String channelFromRequest(BidRequest bidRequest) {
final ExtRequestPrebid prebid = ext != null ? ext.getPrebid() : null;
final ExtRequestPrebidChannel channel = prebid != null ? prebid.getChannel() : null;

return channel != null ? recogniseChannelName(channel.getName()) : null;
}

// TODO: remove alias resolving after transition period
private static String recogniseChannelName(String channelName) {
if (StringUtils.equalsIgnoreCase("pbjs", channelName)) {
return Ortb2ImplicitParametersResolver.WEB_CHANNEL;
}

return channelName;
return channel != null ? channel.getName() : null;
}

private static boolean eventsAllowedByRequest(AuctionContext auctionContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class VideoStoredRequestProcessor {
private static final String DEFAULT_CURRENCY = "USD";

private final boolean enforceStoredRequest;
private final List<String> blacklistedAccounts;
private final List<String> blocklistedAccounts;
private final long defaultTimeout;
private final String currency;
private final BidRequest defaultBidRequest;
Expand All @@ -71,7 +71,7 @@ public class VideoStoredRequestProcessor {
private final JsonMerger jsonMerger;

public VideoStoredRequestProcessor(boolean enforceStoredRequest,
List<String> blacklistedAccounts,
List<String> blocklistedAccounts,
long defaultTimeout,
String adServerCurrency,
String defaultBidRequestPath,
Expand All @@ -84,7 +84,7 @@ public VideoStoredRequestProcessor(boolean enforceStoredRequest,
JsonMerger jsonMerger) {

this.enforceStoredRequest = enforceStoredRequest;
this.blacklistedAccounts = Objects.requireNonNull(blacklistedAccounts);
this.blocklistedAccounts = Objects.requireNonNull(blocklistedAccounts);
this.defaultTimeout = defaultTimeout;
this.currency = StringUtils.isBlank(adServerCurrency) ? DEFAULT_CURRENCY : adServerCurrency;
this.defaultBidRequest = readBidRequest(
Expand Down Expand Up @@ -147,7 +147,7 @@ private WithPodErrors<BidRequest> toBidRequestWithPodErrors(StoredDataResult sto
String storedBidRequestId) {

final BidRequestVideo mergedStoredRequest = mergeBidRequest(videoRequest, storedBidRequestId, storedResult);
validator.validateStoredBidRequest(mergedStoredRequest, enforceStoredRequest, blacklistedAccounts);
validator.validateStoredBidRequest(mergedStoredRequest, enforceStoredRequest, blocklistedAccounts);

final Podconfig podconfig = mergedStoredRequest.getPodconfig();
final Video video = mergedStoredRequest.getVideo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.prebid.server.auction.model.Endpoint;
import org.prebid.server.auction.model.IpAddress;
import org.prebid.server.auction.model.SecBrowsingTopic;
import org.prebid.server.exception.BlacklistedAppException;
import org.prebid.server.exception.BlocklistedAppException;
import org.prebid.server.exception.InvalidRequestException;
import org.prebid.server.exception.PreBidException;
import org.prebid.server.identity.IdGenerator;
Expand Down Expand Up @@ -91,7 +91,7 @@ public class Ortb2ImplicitParametersResolver {
private final boolean shouldCacheOnlyWinningBids;
private final boolean generateBidRequestId;
private final String adServerCurrency;
private final List<String> blacklistedApps;
private final List<String> blocklistedApps;
private final ExtRequestPrebidServer serverInfo;
private final ImplicitParametersExtractor paramsExtractor;
private final TimeoutResolver timeoutResolver;
Expand All @@ -104,7 +104,7 @@ public class Ortb2ImplicitParametersResolver {
public Ortb2ImplicitParametersResolver(boolean shouldCacheOnlyWinningBids,
boolean generateBidRequestId,
String adServerCurrency,
List<String> blacklistedApps,
List<String> blocklistedApps,
String externalUrl,
Integer hostVendorId,
String datacenterRegion,
Expand All @@ -119,7 +119,7 @@ public Ortb2ImplicitParametersResolver(boolean shouldCacheOnlyWinningBids,
this.shouldCacheOnlyWinningBids = shouldCacheOnlyWinningBids;
this.generateBidRequestId = generateBidRequestId;
this.adServerCurrency = validateCurrency(Objects.requireNonNull(adServerCurrency));
this.blacklistedApps = Objects.requireNonNull(blacklistedApps);
this.blocklistedApps = Objects.requireNonNull(blocklistedApps);
this.serverInfo = ExtRequestPrebidServer.of(externalUrl, hostVendorId, datacenterRegion, null);
this.paramsExtractor = Objects.requireNonNull(paramsExtractor);
this.timeoutResolver = Objects.requireNonNull(timeoutResolver);
Expand Down Expand Up @@ -153,7 +153,7 @@ public BidRequest resolve(BidRequest bidRequest,
String endpoint,
boolean hasStoredBidRequest) {

checkBlacklistedApp(bidRequest);
checkBlocklistedApp(bidRequest);

final HttpRequestContext httpRequest = auctionContext.getHttpRequest();

Expand Down Expand Up @@ -211,12 +211,12 @@ public static boolean isImpExtBidder(String field) {
return !IMP_EXT_NON_BIDDER_FIELDS.contains(field);
}

private void checkBlacklistedApp(BidRequest bidRequest) {
private void checkBlocklistedApp(BidRequest bidRequest) {
final App app = bidRequest.getApp();
final String appId = app != null ? app.getId() : null;

if (StringUtils.isNotBlank(appId) && blacklistedApps.contains(appId)) {
throw new BlacklistedAppException(
if (StringUtils.isNotBlank(appId) && blocklistedApps.contains(appId)) {
throw new BlocklistedAppException(
"Prebid-server does not process requests from App ID: " + appId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.prebid.server.auction.model.TimeoutContext;
import org.prebid.server.auction.model.debug.DebugContext;
import org.prebid.server.cookie.UidsCookieService;
import org.prebid.server.exception.BlacklistedAccountException;
import org.prebid.server.exception.BlocklistedAccountException;
import org.prebid.server.exception.InvalidRequestException;
import org.prebid.server.exception.PreBidException;
import org.prebid.server.exception.UnauthorizedAccountException;
Expand Down Expand Up @@ -89,7 +89,7 @@ public class Ortb2RequestFactory {

private final int timeoutAdjustmentFactor;
private final double logSamplingRate;
private final List<String> blacklistedAccounts;
private final List<String> blocklistedAccounts;
private final UidsCookieService uidsCookieService;
private final ActivityInfrastructureCreator activityInfrastructureCreator;
private final RequestValidator requestValidator;
Expand All @@ -105,7 +105,7 @@ public class Ortb2RequestFactory {

public Ortb2RequestFactory(int timeoutAdjustmentFactor,
double logSamplingRate,
List<String> blacklistedAccounts,
List<String> blocklistedAccounts,
UidsCookieService uidsCookieService,
ActivityInfrastructureCreator activityInfrastructureCreator,
RequestValidator requestValidator,
Expand All @@ -125,7 +125,7 @@ public Ortb2RequestFactory(int timeoutAdjustmentFactor,

this.timeoutAdjustmentFactor = timeoutAdjustmentFactor;
this.logSamplingRate = logSamplingRate;
this.blacklistedAccounts = Objects.requireNonNull(blacklistedAccounts);
this.blocklistedAccounts = Objects.requireNonNull(blocklistedAccounts);
this.uidsCookieService = Objects.requireNonNull(uidsCookieService);
this.activityInfrastructureCreator = Objects.requireNonNull(activityInfrastructureCreator);
this.requestValidator = Objects.requireNonNull(requestValidator);
Expand Down Expand Up @@ -180,7 +180,7 @@ private Future<Account> fetchAccount(AuctionContext auctionContext, boolean isLo
final HttpRequestContext httpRequest = auctionContext.getHttpRequest();

return findAccountIdFrom(bidRequest, isLookupStoredRequest)
.map(this::validateIfAccountBlacklisted)
.map(this::validateIfAccountBlocklisted)
.compose(accountId -> loadAccount(timeout, httpRequest, accountId));
}

Expand Down Expand Up @@ -423,13 +423,13 @@ private Future<String> findAccountIdFrom(BidRequest bidRequest, boolean isLookup
.map(storedAuctionResult -> accountIdFrom(storedAuctionResult.bidRequest()));
}

private String validateIfAccountBlacklisted(String accountId) {
if (CollectionUtils.isNotEmpty(blacklistedAccounts)
private String validateIfAccountBlocklisted(String accountId) {
if (CollectionUtils.isNotEmpty(blocklistedAccounts)
&& StringUtils.isNotBlank(accountId)
&& blacklistedAccounts.contains(accountId)) {
&& blocklistedAccounts.contains(accountId)) {

throw new BlacklistedAccountException(
"Prebid-server has blacklisted Account ID: %s, please reach out to the prebid server host."
throw new BlocklistedAccountException(
"Prebid-server has blocklisted Account ID: %s, please reach out to the prebid server host."
.formatted(accountId));
}
return accountId;
Expand Down
Loading

0 comments on commit 6df1708

Please sign in to comment.