diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index f5d07b2639d..b34d4827eae 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -14,7 +14,7 @@ jobs: - name: Extract tag from commit message run: | target_tag=${COMMIT_MSG#"Prebid Server prepare release "} - echo "::set-env name=TARGET_TAG::$target_tag" + echo "TARGET_TAG=$target_tag" >> $GITHUB_ENV env: COMMIT_MSG: ${{ github.event.head_commit.message }} - name: Create and publish release diff --git a/README.md b/README.md index e7edc4aca48..6f4788e5bb1 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,26 @@ -### This code is being used in production by multiple Prebid.org members, but is not the "official" version. See https://github.com/prebid/prebid-server/ +### This is the Java version of Prebid Server. See the Prebid Server [Feature List](https://docs.prebid.org/prebid-server/features/pbs-feature-idx.html) and [FAQ entry](https://docs.prebid.org/faq/prebid-server-faq.html#why-are-there-two-versions-of-prebid-server-are-they-kept-in-sync) to understand the differences between PBS-Java and [PBS-Go](https://github.com/prebid/prebid-server). -# Prebid Server +# Prebid Server (Java) -[![GitHub version](https://badge.fury.io/gh/rubicon-project%2fprebid-server-java.svg)](http://badge.fury.io/gh/rubicon-project%2fprebid-server-java) -[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/rubicon-project/prebid-server-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rubicon-project/prebid-server-java/context:java) -[![Total alerts](https://img.shields.io/lgtm/alerts/g/rubicon-project/prebid-server-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rubicon-project/prebid-server-java/alerts/) -[![GitHub contributors](https://img.shields.io/github/contributors/rubicon-project/prebid-server-java.svg)](https://GitHub.com/rubicon-project/prebid-server-java/contributors/) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/rubicon-project/prebid-server-java/blob/master/docs/contributing.md) -[![GitHub pull-requests closed](https://img.shields.io/github/issues-pr-closed/rubicon-project/prebid-server-java.svg)](https://GitHub.com/rubicon-project/prebid-server-java/pull/) +[![GitHub version](https://badge.fury.io/gh/prebid%2fprebid-server-java.svg)](http://badge.fury.io/gh/prebid%2fprebid-server-java) +[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/prebid/prebid-server-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/prebid/prebid-server-java/context:java) +[![Total alerts](https://img.shields.io/lgtm/alerts/g/prebid/prebid-server-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/prebid/prebid-server-java/alerts/) +[![GitHub contributors](https://img.shields.io/github/contributors/prebid/prebid-server-java.svg)](https://GitHub.com/prebid/prebid-server-java/contributors/) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/prebid/prebid-server-java/blob/master/docs/contributing.md) +[![GitHub pull-requests closed](https://img.shields.io/github/issues-pr-closed/prebid/prebid-server-java.svg)](https://GitHub.com/prebid/prebid-server-java/pull/) Prebid Server is an open source implementation of Server-Side Header Bidding. -It is managed by [Prebid.org](http://prebid.org/overview/what-is-prebid-org.html), -and upholds the principles from the [Prebid Code of Conduct](http://prebid.org/wrapper_code_of_conduct.html). +It is managed by Prebid.org, +and upholds the principles from the [Prebid Code of Conduct](https://prebid.org/wrapper_code_of_conduct.html). This project does not support the same set of Bidders as Prebid.js, although there is overlap. The current set can be found in the [adapters](./src/main/java/org/prebid/server/bidder) package. If you don't see the one you want, feel free to [contribute it](docs/developers/add-new-bidder.md). For more information, see: -- [What is Prebid?](http://prebid.org/overview/intro.html) -- [Getting started with Prebid Server](http://prebid.org/dev-docs/get-started-with-prebid-server.html) -- [Current Bidders](http://prebid.org/dev-docs/prebid-server-bidders.html) +- [What is Prebid?](https://prebid.org/why-prebid/) +- [Getting started with Prebid Server](https://docs.prebid.org/prebid-server/overview/prebid-server-overview.html) +- [Current Bidders](https://docs.prebid.org/dev-docs/pbs-bidders.html) # Getting Started @@ -28,23 +28,21 @@ The server makes the following assumptions: - No ranking or decisioning is performed by this server. It just proxies requests. - No ad quality management (e.g., malware, viruses, deceptive creatives) is performed by this server. - This server does no fraud scanning and does nothing to prevent bad traffic. -- This server does no logging. -- This server has not user profiling or user data collection capabilities. +- This server logs errors but not requests. +- This server has no user profiling or user data collection capabilities. This project is built upon [Vert.x](http://vertx.io) to achieve high request throughput. We use [Maven](https://maven.apache.org) and attempt to introduce minimal dependencies. When running, the server responds to several HTTP [endpoints](docs/endpoints). -To start the Prebid Server you need to do the following steps: - ## Building Follow next steps to create JAR file which can be deployed locally. - Download or clone a project: ```bash -git clone https://github.com/rubicon-project/prebid-server-java.git +git clone https://github.com/prebid/prebid-server-java.git ``` - Move to project directory: @@ -84,28 +82,27 @@ and verify response status is `200 OK`. # Documentation ## Development -- [Differences Between Prebid Server Go and Java](differenceBetweenPBSGo-and-Java.md) -- [Endpoints](endpoints) -- [Adding new bidder](developers/add-new-bidder.md) -- [Adding new analytics module](developers/add-new-analytics-module.md) -- [Adding viewability support](developers/add-viewability-vendors.md) -- [Auction result post-processing](developers/auction-result-post-processing.md) -- [Cookie Syncs](developers/cookie-syncs.md) -- [Stored Requests](developers/stored-requests.md) -- [Unit Tests](developers/unit-tests.md) -- [GDPR](developers/gdpr.md) +- [Endpoints](docs/endpoints) +- [Adding new bidder](docs/developers/add-new-bidder.md) +- [Adding new analytics module](docs/developers/add-new-analytics-module.md) +- [Adding viewability support](docs/developers/add-viewability-vendors.md) +- [Auction result post-processing](docs/developers/auction-result-post-processing.md) +- [Cookie Syncs](docs/developers/cookie-syncs.md) +- [Stored Requests](docs/developers/stored-requests.md) +- [Unit Tests](docs/developers/unit-tests.md) +- [GDPR](docs/developers/gdpr.md) ## Maintenance -- [Build for local](build.md) -- [Build for AWS](build-aws.md) -- [Configure application](config.md) - - [Full list of configuration options](config-app.md) - - [Application settings](application-settings.md) -- [Run with optimizations](run.md) -- [Metrics](metrics.md) +- [Build for local](docs/build.md) +- [Build for AWS](docs/build-aws.md) +- [Configure application](docs/config.md) + - [Full list of configuration options](docs/config-app.md) + - [Application settings](docs/application-settings.md) +- [Run with optimizations](docs/run.md) +- [Metrics](docs/metrics.md) ## Contributing -- [Contributing](contributing.md) -- [Code Style](code-style.md) -- [Code Review](code-reviews.md) -- [Versioning](versioning.md) +- [Contributing](docs/contributing.md) +- [Code Style](docs/code-style.md) +- [Code Review](docs/code-reviews.md) +- [Versioning](docs/versioning.md) diff --git a/docs/application-settings.md b/docs/application-settings.md index 178ae5c9cc2..a6132a997f4 100644 --- a/docs/application-settings.md +++ b/docs/application-settings.md @@ -23,14 +23,17 @@ There are two ways to configure application settings: database and file. This do - `truncate-target-attr` - Maximum targeting attributes size. Values between 1 and 255. - `default-integration` - Default integration to assume. - `analytics-config.auction-events.` - defines which channels are supported by analytics for this account +- `bid-validations.banner-creative-max-size` - Overrides creative max size validation for banners. +- `status` - allows to mark account as `active` or `inactive`. +Here are the definitions of the "purposes" that can be defined in the GDPR setting configurations: ``` Purpose | Purpose goal | Purpose meaning for PBS (n\a - not affected) ----------|---------------------------------|--------------------------------------------- p1 | Access device | Stops usersync for given vendor and stops settings cookie on `/seuid` p2 | Select basic ads | Verify consent for each vendor as appropriate for the enforcement method before calling a bid adapter. If consent is not granted, log a metric and skip it. p3 | Personalized ads profile | n\a -p4 | Select personalized ads | Verify consent for each vendor that passed the Purpose 2. If consent is not granted, remove the bidrequest.userId, user.ext.eids, user.ext.digitrust, device.if attributes and call the adapter. +p4 | Select personalized ads | Verify consent for each vendor that passed the Purpose 2. If consent is not granted, remove the bidrequest.userId, user.ext.eids, device.if attributes and call the adapter. p5 | Personalized content profile | n\a p6 | Select personalized content | n\a p7 | Measure ad performance | Verify consent for each analytics module. If consent is not grantet skip it. @@ -42,22 +45,26 @@ sf1 | Precise geo | Verifies user opt-in. If the user sf2 | Fingerprinting | n\a ``` -## File application setting +## Setting Account Configuration in Files In file based approach all configuration stores in .yaml files, path to which are defined in application properties. ### Configuration in application.yaml -``` +The general idea is that you'll place all the account-specific settings in a separate YAML file and point to that file. + +```yaml settings: filesystem: settings-filename: ``` ### File format -``` +Here's an example YAML file containing account-specific settings: + +```yaml accounts: - - id: 14062 + - id: 1111 bannerCacheTtl: 100 videoCacheTtl: 100 eventsEnabled: true @@ -69,6 +76,7 @@ accounts: analytics-config: auction-events: amp: true + status: active gdpr: enabled: true integration-enabled: @@ -151,54 +159,70 @@ accounts: purpose-one-treatment-interpretation: ignore ``` - -## Database application setting +## Setting Account Configuration in the Database + +In database approach account properties are stored in database table. -In database approach account properties are stored in database table with name accounts_account. +SQL query for retrieving account is configurable and can be specified in [application configuration](config-app.md). +Requirements for the SQL query stated below. ### Configuration in application.yaml -``` + +```yaml settings: database: - type: pool-size: 20 - type: mysql + type: host: port: + account-query: ``` -### Table description +### Configurable SQL query for account requirements -Query to create accounts_account table: +The general approach is that each host company can set up their database however they wish, so long as the configurable query run by +Prebid Server returns expected data in the expected order. Here's an example configuration: +```yaml +settings: + database: + type: mysql + account-query: SELECT uuid, price_granularity, banner_cache_ttl, video_cache_ttl, events_enabled, enforce_ccpa, tcf_config, analytics_sampling_factor, truncate_target_attr, default_integration, analytics_config, bid_validations FROM accounts_account where uuid = ? LIMIT 1 ``` -'CREATE TABLE `accounts_account` ( -`id` int(10) unsigned NOT NULL AUTO_INCREMENT, -`uuid` varchar(40) NOT NULL, -`price_granularity` enum('low','med','high','auto','dense','unknown') NOT NULL DEFAULT 'unknown', -`granularityMultiplier` decimal(9,3) DEFAULT NULL, -`banner_cache_ttl` int(11) DEFAULT NULL, -`video_cache_ttl` int(11) DEFAULT NULL, -`events_enabled` bit(1) DEFAULT NULL, -`enforce_ccpa` bit(1) DEFAULT NULL, -`enforce_gdpr` bit(1) DEFAULT NULL, -`tcf_config` json DEFAULT NULL, -`analytics_sampling_factor` tinyint(4) DEFAULT NULL, -`truncate_target_attr` tinyint(3) unsigned DEFAULT NULL, -`default_integration` varchar(64) DEFAULT NULL, -`analytics_config` varchar(512) DEFAULT NULL, -`status` enum('active','inactive') DEFAULT 'active', -`updated_by` int(11) DEFAULT NULL, -`updated_by_user` varchar(64) DEFAULT NULL, -`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -PRIMARY KEY (`id`), -UNIQUE KEY `uuid` (`uuid`)) -ENGINE=InnoDB DEFAULT CHARSET=utf8' -``` -where tcf_config column is json with next format +The SQL query for account must: +* return following columns, with specified type, in this order: + * account ID, string + * price granularity, string + * banner cache TTL, integer + * video cache TTL, integer + * events enabled flag, boolean + * enforce CCPA flag, boolean + * TCF configuration, JSON string, see below + * analytics sampling factor, integer + * maximum targeting attribute size, integer + * default integration value, string + * analytics configuration, JSON string, see below +* specify a special single `%ACCOUNT_ID%` placeholder in the `WHERE` clause that will be replaced with account ID in +runtime + +It is recommended to include `LIMIT 1` clause in the query because only the very first result returned will be taken. + +If a host company doesn't support a given field, or they have a different table name, they can just update the query with whatever values are needed. e.g. +```yaml +settings: + database: + type: mysql + account-query: SELECT uuid, 'med', banner_cache_ttl, video_cache_ttl, events_enabled, enforce_ccpa, tcf_config, 0, null, default_integration, '{}', '{}' FROM myaccountstable where uuid = ? LIMIT 1 ``` +### Configuration Details + +#### TCF configuration JSON + +Here's an example of the value that the `tcf_config` column can take: + +```json { "enabled": true, "integration-enabled": { @@ -206,8 +230,8 @@ where tcf_config column is json with next format "web": true, "app": true, "amp": true - } - "purpose-one-treatment-interpretation": "ignore" + }, + "purpose-one-treatment-interpretation": "ignore", "purposes": { "p1": { "enforce-purpose": "full", @@ -309,10 +333,62 @@ where tcf_config column is json with next format } ``` -Query used to get an account: +#### Bid Validations configuration JSON + +The `bid_validations` column is json with this format: + +```json +{ + "banner-creative-max-size": "enforce" +} +``` + +Valid values are: +- "skip": don't do anything about creative max size for this publisher +- "warn": if a bidder returns a creative that's larger in height or width than any of the allowed sizes, log an operational warning. +- "enforce": if a bidder returns a creative that's larger in height or width than any of the allowed sizes, reject the bid and log an operational warning. + +#### Analytics Validations configuration JSON + +The `analytics_config` configuration column format: + +```json +{ + "auction-events": { + "web": true, // the analytics adapter should log auction events when the channel is web + "amp": true, // the analytics adapter should log auction events when the channel is AMP + "app": false // the analytics adapter should not log auction events when the channel is app + } +} ``` -SELECT uuid, price_granularity, banner_cache_ttl, video_cache_ttl, events_enabled, enforce_ccpa, tcf_config, analytics_sampling_factor, truncate_target_attr, default_integration, analytics_config -FROM accounts_account where uuid = ? -LIMIT 1 +#### Creating the accounts table + +Traditionally the table name used by Prebid Server is `accounts_account`. No one remembers why. But here's SQL +you could use to create your table: + +```sql +'CREATE TABLE `accounts_account` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `uuid` varchar(40) NOT NULL, + `price_granularity` enum('low','med','high','auto','dense','unknown') NOT NULL DEFAULT 'unknown', + `granularityMultiplier` decimal(9,3) DEFAULT NULL, + `banner_cache_ttl` int(11) DEFAULT NULL, + `video_cache_ttl` int(11) DEFAULT NULL, + `events_enabled` bit(1) DEFAULT NULL, + `enforce_ccpa` bit(1) DEFAULT NULL, + `enforce_gdpr` bit(1) DEFAULT NULL, + `tcf_config` json DEFAULT NULL, + `analytics_sampling_factor` tinyint(4) DEFAULT NULL, + `truncate_target_attr` tinyint(3) unsigned DEFAULT NULL, + `default_integration` varchar(64) DEFAULT NULL, + `analytics_config` varchar(512) DEFAULT NULL, + `bid_validations` json DEFAULT NULL, + `status` enum('active','inactive') DEFAULT 'active', + `updated_by` int(11) DEFAULT NULL, + `updated_by_user` varchar(64) DEFAULT NULL, + `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, +PRIMARY KEY (`id`), +UNIQUE KEY `uuid` (`uuid`)) +ENGINE=InnoDB DEFAULT CHARSET=utf8' ``` diff --git a/docs/build.md b/docs/build.md index 89e3d9a20f9..44b13bee47b 100644 --- a/docs/build.md +++ b/docs/build.md @@ -19,7 +19,7 @@ Follow next steps to create JAR which can be deployed locally. Download or clone a project locally: ```bash -git clone https://github.com/rubicon-project/prebid-server-java.git +git clone https://github.com/prebid/prebid-server-java.git ``` Move to project directory: diff --git a/docs/code-reviews.md b/docs/code-reviews.md index 972597751f5..78728fef18a 100644 --- a/docs/code-reviews.md +++ b/docs/code-reviews.md @@ -1,7 +1,7 @@ # Code Reviews ## Standards -Anyone is free to review and comment on any [open pull requests](https://github.com/rubicon-project/prebid-server-java/pulls). +Anyone is free to review and comment on any [open pull requests](https://github.com/prebid/prebid-server-java/pulls). All pull requests must be reviewed and approved by at least one [core member](https://github.com/orgs/prebid/teams/core/members) before merge. @@ -38,7 +38,7 @@ Some examples include: - Can we improve the user's experience in any way? - Have the relevant [docs]() been added or updated? If not, add the `needs docs` label. - Do you believe that the code works by looking at the unit tests? If not, suggest more tests until you do! -- Is the motivation behind these changes clear? If not, there must be [an issue](https://github.com/rubicon-project/prebid-server-java/issues) +- Is the motivation behind these changes clear? If not, there must be [an issue](https://github.com/prebid/prebid-server-java/issues) explaining it. Are there better ways to achieve those goals? - Does the code use any global, mutable state? [Inject dependencies](https://en.wikipedia.org/wiki/Dependency_injection) instead! - Can the code be organized into smaller, more modular pieces? diff --git a/docs/config-app.md b/docs/config-app.md index d52dcabc519..8557a6a3d67 100644 --- a/docs/config-app.md +++ b/docs/config-app.md @@ -15,6 +15,7 @@ This parameter exists to allow to change the location of the directory Vert.x wi - `vertx.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. - `vertx.init-timeout-ms` - time to wait for asynchronous initialization steps completion before considering them stuck. When exceeded - exception is thrown and Prebid Server stops. +- `vertx.enable-per-client-endpoint-metrics` - enables HTTP client metrics per destination endpoint (`host:port`) ## HTTP - `http.port` - the port to listen on. @@ -62,6 +63,9 @@ Removes and downloads file again if depending service cant process probably corr - `max-timeout-ms` - this setting controls maximum timeout for /auction endpoint. - `timeout-adjustment-ms` - reduces timeout value passed in legacy Auction request so that Prebid Server can handle timeouts from adapters and respond to the request before it times out. +## Default bid request +- `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. @@ -75,6 +79,8 @@ Removes and downloads file again if depending service cant process probably corr - `auction.cache.only-winning-bids` - if equals to `true` only the winning bids would be cached. Has lower priority than request-specific flags. - `auction.generate-bid-id` - whether to generate seatbid[].bid[].ext.prebid.bidid in the OpenRTB response. - `auction.id-generator-type` - if generate-bid-id is on, then this defines how the ID should be generated. Currently onlye `uuid` is supported. +- `auction.validations.banner-creative-max-size` - enables creative max size validation for banners. Possible values: `skip`, `enforce`, `warn`. Default is `skip`. +- `auction.validations.secure-markup` - enables secure markup validation. Possible values: `skip`, `enforce`, `warn`. Default is `skip`. ## Amp (OpenRTB) - `amp.default-timeout-ms` - default operation timeout for OpenRTB Amp requests. @@ -82,6 +88,12 @@ Removes and downloads file again if depending service cant process probably corr - `amp.timeout-adjustment-ms` - reduces timeout value passed in Amp request so that Prebid Server can handle timeouts from adapters and respond to the AMP RTC request before it times out. - `amp.custom-targeting` - a list of bidders whose custom targeting should be included in AMP responses. +## Timeout notification +- `auction.timeout-notification.timeout-ms` - HTTP timeout to use when sending notifications about bidder timeouts +- `auction.timeout-notification.log-result` - causes bidder timeout notification result to be logged +- `auction.timeout-notification.log-failure-only` - causes only bidder timeout notification failures to be logged +- `auction.timeout-notification.log-sampling-rate` - instructs apply sampling when logging bidder timeout notification results + ## Video - `auction.video.stored-required` - flag forces to merge with stored request - `auction.blacklisted-accounts` - comma separated list of blacklisted account IDs. @@ -127,6 +139,8 @@ But feel free to add additional bidder's specific options. - `currency-converter.external-rates.url` - the url for Prebid.org’s currency file. [More details](http://prebid.org/dev-docs/modules/currency.html) - `currency-converter.external-rates.default-timeout-ms` - default operation timeout for fetching currency rates. - `currency-converter.external-rates.refresh-period-ms` - default refresh period for currency rates updates. +- `currency-converter.external-rates.stale-after-ms` - how old currency rates should be to become considered stale. +- `currency-converter.external-rates.stale-period-ms` - stale period after which the latest external currency rates get discarded. ## Admin Endpoints - `admin-endpoints.version.enabled` - if equals to `true` the endpoint will be available. @@ -230,6 +244,7 @@ For database data source available next options: - `settings.database.user` - database user. - `settings.database.password` - database password. - `settings.database.pool-size` - set the initial/min/max pool size of database connections. +- `settings.database.account-query` - the SQL query to fetch account. - `settings.database.stored-requests-query` - the SQL query to fetch stored requests. - `settings.database.amp-stored-requests-query` - the SQL query to fetch AMP stored requests. - `settings.database.stored-responses-query` - the SQL query to fetch stored responses. @@ -246,6 +261,24 @@ For HTTP data source available next options: For account processing rules available next options: - `settings.enforce-valid-account` - if equals to `true` then request without account id will be rejected with 401. +It is possible to specify default account configuration values that will be assumed if account config have them +unspecified or missing at all. Example: +```yaml +settings: + default-account-config: + events-enabled: true + enforce-ccpa: true + gdpr: '{"enabled": true}' + analytics-sampling-factor: 1 + default-integration: pbjs + analytics-config: '{"auction-events":{"amp":true}}' +``` +See [application settings](application-settings.md) for full reference of available configuration parameters. +Be aware that individual configuration values will not be merged with concrete +account values if they exist in account configuration but account value will completely replace the default value. For +example, if account configuration defines `gdpr` field, it will completely replace `settings.default-account-config.gdpr` +value in the final account configuration model. + For caching available next options: - `settings.in-memory-cache.ttl-seconds` - how long (in seconds) data will be available in LRU cache. - `settings.in-memory-cache.cache-size` - the size of LRU cache. @@ -309,11 +342,15 @@ If not defined in config all other Health Checkers would be disabled and endpoin - `gdpr.vendorlist.vN.http-endpoint-template` - template string for vendor list url, where `{VERSION}` is used as version number placeholder. - `gdpr.vendorlist.vN.refresh-missing-list-period-ms` - time to wait between attempts to fetch vendor list version that previously was reported to be missing by origin. Default `3600000` (one hour). - `gdpr.vendorlist.vN.fallback-vendor-list-path` - location on the file system of the fallback vendor list that will be used in place of missing vendor list versions. Optional. +- `gdpr.vendorlist.vN.deprecated` - Flag to show is this vendor list is deprecated or not. - `gdpr.vendorlist.vN.cache-dir` - directory for local storage cache for vendor list. Should be with `WRITE` permissions for user application run from. ## CCPA - `ccpa.enforce` - if equals to `true` enforces to check ccpa policy, otherwise ignore ccpa verification. +## LMT +- `lmt.enforce` - if equals to `true` enforces to check lmt policy, otherwise ignore lmt verification. + ## Geo Location - `geolocation.enabled` - if equals to `true` the geo location service will be used to determine the country for client request. - `geolocation.circuit-breaker.enabled` - if equals to `true` circuit breaker will be used to make geo location client more robust. diff --git a/docs/config.md b/docs/config.md index 9a1966ba5f1..89055c2ca3d 100644 --- a/docs/config.md +++ b/docs/config.md @@ -24,8 +24,8 @@ metrics: settings: database: type: mysql - stored-requests-query: SELECT reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) UNION ALL SELECT impid, impData, 'imp' as dataType FROM stored_imps WHERE impid IN (%IMP_ID_LIST%) - amp-stored-requests-query: SELECT reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) + stored-requests-query: SELECT accountId, reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) UNION ALL SELECT accountId, impid, impData, 'imp' as dataType FROM stored_imps WHERE impid IN (%IMP_ID_LIST%) + amp-stored-requests-query: SELECT accountId, reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) stored-responses-query: SELECT resid, responseData FROM stored_responses WHERE resid IN (%RESPONSE_ID_LIST%) ``` If some property is missed in `prebid-config.yaml` application will look for it in `src/main/resources/application.yaml` file. diff --git a/docs/contributing.md b/docs/contributing.md index 3ca432f3905..ae3f10dc4e9 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -2,7 +2,7 @@ ## Create an issue -[Create an issue](https://github.com/rubicon-project/prebid-server-java/issues/new) describing the motivation for your changes. +[Create an issue](https://github.com/prebid/prebid-server-java/issues/new) describing the motivation for your changes. Are you fixing a bug? Improving documentation? Optimizing some slow code? Pull Requests without associated Issues may still be accepted, if the motivation is obvious. @@ -29,6 +29,6 @@ those updates must be submitted in the same Pull Request as the code changes. ## Open a Pull Request When you're ready, [submit a Pull Request](https://help.github.com/articles/creating-a-pull-request/) -against the `master` branch of [our GitHub repository](https://github.com/rubicon-project/prebid-server-java/compare). +against the `master` branch of [our GitHub repository](https://github.com/prebid/prebid-server-java/compare). If the tests pass locally, but fail on your PR, [update your fork](https://help.github.com/articles/syncing-a-fork/) with the latest code from `master`. diff --git a/docs/developers/PrebidServerJava_GDPR_Requirements.pdf b/docs/developers/PrebidServerJava_GDPR_Requirements.pdf deleted file mode 100644 index 33792ab1d4c..00000000000 Binary files a/docs/developers/PrebidServerJava_GDPR_Requirements.pdf and /dev/null differ diff --git a/docs/developers/add-new-bidder.md b/docs/developers/add-new-bidder.md index c299642733b..1bb8ac8b3dd 100644 --- a/docs/developers/add-new-bidder.md +++ b/docs/developers/add-new-bidder.md @@ -36,6 +36,18 @@ Bidder implementations are scattered throughout several files: Bidder implementations may assume that any params have already been validated against the defined json-schema. +### Timeout notification support +This is an optional feature. If you wish to get timeout notifications when a bid request from PBS times out, you can implement the +`org.prebid.server.bidder.Bidder.makeTimeoutNotification` method in your bidder implementation. If you do not wish +timeout notification, do not implement the method. + +`HttpRequest makeTimeoutNotification(HttpRequest httpRequest)` + +Here the `HttpRequest` supplied as an argument is the request returned from `makeHttpRequests` that timed out. If a bidder generates +multiple requests, and more than one of them times out, then there will be a call to `makeTimeoutNotification` for each failed +request. The method should then return a `HttpRequest` object that will be the timeout notification to be sent to the bidder. +Timeout notifications will not generate subsequent timeout notifications if they time out or fail. + ### Generic OpenRTB Bidder There's an option to implement a bidder by using a pre-existing template. diff --git a/docs/developers/default-request.md b/docs/developers/default-request.md new file mode 100644 index 00000000000..08bf1041009 --- /dev/null +++ b/docs/developers/default-request.md @@ -0,0 +1,29 @@ +# Server Based Global Default Request + +This allows a default request to be defined that allows the server to set up some defaults for all incoming +requests. A stored request(s) referenced by a bid request override default request, and of course any options specified +directly in the bid request override both. The default request is only read on server startup, it is meant as an +installation static default rather than a dynamic tuning option. + +## Config Options + +Following config options are exposed to support this feature. +```yaml +default-request: + file: + path : path/to/default/request.json +``` + +The `path` option is the path to a JSON file containing the default request JSON. +```json +{ + "tmax": "2000", + "regs": { + "ext": { + "gdpr": 1 + } + } +} +``` +This will be JSON merged into the incoming requests at the top level. These will be used as fallbacks which can be +overridden by both Stored Requests _and_ the incoming HTTP request payload. diff --git a/docs/developers/stored-requests.md b/docs/developers/stored-requests.md index b8b5bf1ece9..e76cddb6811 100644 --- a/docs/developers/stored-requests.md +++ b/docs/developers/stored-requests.md @@ -137,7 +137,7 @@ For example, assume the following `stored-requests/stored-request.json`: } ``` -Then an HTTP request like: +Then HTTP request like: ```json { @@ -178,8 +178,7 @@ Prebid Server does allow Stored BidRequests and Stored Imps in the same HTTP Req The Stored BidRequest will be applied first, and then the Stored Imps after. **Beware**: Stored Request data will not be applied recursively. -If a Stored BidRequest includes Imps with their own Stored Request IDs, -then the data for those Stored Imps not be resolved. +If a Stored BidRequest includes Imps with their own Stored Request IDs, then the data for those Stored Imps will not be resolved. ## Alternate backends @@ -193,13 +192,6 @@ For PostgreSQL: settings: database: type: postgres - host: localhost - port: 5432 - dbname: database-name - user: username - password: password - stored-requests-query: SELECT reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) UNION ALL SELECT impid, impData, 'imp' as dataType FROM stored_imps WHERE impid IN (%IMP_ID_LIST%) - amp-stored-requests-query: SELECT reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) ``` For MySQL: @@ -209,10 +201,11 @@ settings: type: mysql ``` -The select query columns of `stored-data-query` and `amp-stored-data-query` properties should correspond to the specific format: -- first column: ID of stored data item -- second column: value of stored data item -- third column: type of stored data item. Can be `request` for stored requests or `imp` for stored impressions. +The select query columns of `stored-requests-query` and `amp-stored-requests-query` properties should correspond to the specific format: +- first column: account ID which is searched by. +- second column: ID of stored data item which is searched by. +- third column: value of stored data item. +- forth column: type of stored data item. Can be `request` for stored requests or `imp` for stored impressions. ### HTTP backend @@ -261,8 +254,8 @@ settings: dbname: database-name user: username password: password - stored-requests-query: SELECT reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) UNION ALL SELECT impid, impData, 'imp' as dataType FROM stored_imps WHERE impid IN (%IMP_ID_LIST%) - amp-stored-requests-query: SELECT reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) + stored-requests-query: SELECT accountId, reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) UNION ALL SELECT accountId, impid, impData, 'imp' as dataType FROM stored_imps WHERE impid IN (%IMP_ID_LIST%) + amp-stored-requests-query: SELECT accountId, reqid, requestData, 'request' as dataType FROM stored_requests WHERE reqid IN (%REQUEST_ID_LIST%) http: endpoint: http://stored-requests.prebid.com amp-endpoint: http://stored-requests.prebid.com?amp=true diff --git a/docs/differenceBetweenPBSGo-and-Java.md b/docs/differenceBetweenPBSGo-and-Java.md deleted file mode 100644 index 3e6d185f550..00000000000 --- a/docs/differenceBetweenPBSGo-and-Java.md +++ /dev/null @@ -1,46 +0,0 @@ -# Differences Between Prebid Server Go and Java - -January 24, 2019 - -The sister Prebid Server projects are both busy and moving forward at different paces on different features. Sometimes a feature may exist in one implementation -and not the other for an interim period. This page tracks known differences that may persist for longer than a couple of weeks. - -[Feature Checklist Overview](pbs-java-and-go-features-review.md) - -## Feature Differences - -1) PBS-Java supports Stored Responses [issue 861](https://github.com/prebid/prebid-server/issues/861). PBS-Java [PR 354](https://github.com/rubicon-project/prebid-server-java/pull/354). -1) PBS-Java supports Currency conversion. PBS-Go has it implemented, but disabled by default(still under dev) [issue 280](https://github.com/prebid/prebid-server/issues/280), [issue 760](https://github.com/prebid/prebid-server/pull/760). PBS-Java [PR 22](https://github.com/rubicon-project/prebid-server-java/pull/22) -1) PBS-Java Currency conversion supports finding intermediate conversion rate, e.g. if pairs USD : AUD = 1.2 and EUR : AUD = 1.5 are present and EUR to USD conversion is needed, will return (1/1.5) * 1.2 conversion rate. -1) PBS-Go Currency conversion admin debug endpoint exposes following information: Sync source URL, Internal rates, Update frequency, Last update. PBS-Java `/currency-rates` admin endpoint currently supports checking the latest update time only and is not available if currency conversion is disabled. -1) PBS-Java supports IP-address lookup in certain scenarios around GDPR. See https://github.com/rubicon-project/prebid-server-java/blob/master/docs/developers/PrebidServerJava_GDPR_Requirements.pdf -1) PBS-Java supports InfluxDB, Graphite and Prometheus, PBS-Go supports InfluxDB and Prometheus as metrics backend. -1) PBS-Java has Circuit Breaker mechanism for database, http and geolocation requests. This can protect the server in scenarios where an external service becomes unavailable. -1) PBS-Java supports `ext.prebid.cache.{bids,vastxml}.returnCreative` field to control creative presence in response (`true` by default). -1) PBS-Java support caching winning bids only through `auction.cache.only-winning-bids` configuration property or request field `request.ext.prebid.cache.winningonly`. PBS-Java [issue 279](https://github.com/rubicon-project/prebid-server-java/issues/279), [PR 484](https://github.com/rubicon-project/prebid-server-java/pull/484). -1) PBS-Java has a specific `host-cookie` and `uids` cookie processing for all endpoints, that sets `uids.HOST-BIDDER` from `host-cookie` if first is absent or not equal to second. -1) PBS-Java has a specific `/cookie-sync` behaviour, that sets `/setuid` as usersync-url for host-bidder if `host-cookie` specified but `uids.HOST-BIDDER` undefined or differs. -1) PBS-Java has `/event` endpoint to allow Web browsers and mobile applications to notify about different ad events (win, view etc). Filling new bid extensions `response.seatbid.bid.ext.prebid.events.{win,view}` with events url after successful auction completing makes it possible. -1) PBS-Java supports per-account cache TTL and event URLs configuration in the database in columns `banner_cache_ttl`, `video_cache_ttl` and `events_enabled`. -1) PBS-Java does not support passing bidder extensions in `imp[...].ext.prebid.bidder`. PBS-Go [PR 846](https://github.com/prebid/prebid-server/pull/846) -1) PBS-Java responds with active bidders only in `/info/bidders` and `/info/bidders/all` endpoints, although PBS-Go returns all implemented ones. Calling `/info/bidders/{bidderName}` with a disabled bidder name will result in 404 Not Found, which is a desired behaviour, unlike in PBS-Go [issue 988](https://github.com/prebid/prebid-server/issues/988), [PR](https://github.com/prebid/prebid-server/pull/989). -1) PBS-Java supports video impression tracking [issue 1015](https://github.com/prebid/prebid-server/issues/1015). PBS-Java [PR 437](https://github.com/rubicon-project/prebid-server-java/pull/437). - -## Minor differences - -- PBS-Java removes null objects or empty strings (e.g. in Go `/auction` response bid object will have field `hb_cache: ""` whereas in Java it will be absent; also `digitrust: null` in PBS Go is not there in PBS Java). PBS-Go [Issue 476](https://github.com/prebid/prebid-server/issues/476) -- All adapters have been ported to use OpenRTB directly in PBS-Java. PBS-Go Facebook AudienceNetwork adapter [Issue 211](https://github.com/prebid/prebid-server/issues/211) -- Java and Go adapter internal interface returns currency in different ways: - - in PBS-Go, the adapter sets BidResponse.currency, which is outside of each TypedBid. - - in PBS-Java, the adapter set BidderBid[N].currency. -- PBS-Go use "60 seconds buffer + {bid,imp,mediaType}TTL" approach to determine caching TTL period. -- PBS-Java has different names for system metrics. For example instead of `active_connections` it uses `vertx.http.servers.[IP]:[PORT].open-netsockets.count`. See [Metrics](metrics.md) for details. -- PBS-Go `/openrtb2/{auction,amp}` returns HTTP 503 Service Unavailable if request has blacklisted account or app, PBS-Java returns HTTP 403 Forbidden. - -## GDPR differences -- PBS-Java supports geo location service interface to determine the country for incoming client request and provides a default implementation using MaxMind GeoLite2 Country database. -- Different checking of purpose IDs (1 - `Storage and access of information`, 3 - `Ad selection, delivery, reporting`): - - for `/auction` endpoint: in PBS-Java - doesn't support GDPR processing. - - for `/openrtb2/{auction,amp}` endpoint: in PBS-Java - 1 and 3 (for each bidder from request); in PBS-Go - doesn't support GDPR processing. - - for `/cookie_sync` endpoint: in PBS-Java - doesn't support GDPR processing; in PBS-Go - only 1 checked. -- PBS-Java allows bidder to enforce GDPR processing. This information available in bidder meta info. diff --git a/docs/endpoints/auction.md b/docs/endpoints/auction.md index ac4f19f1c6a..9eb35f77914 100644 --- a/docs/endpoints/auction.md +++ b/docs/endpoints/auction.md @@ -1,6 +1,6 @@ # Auction The `/auction` endpoint expects a JSON request in to format defined by -[pbs_request.json](https://github.com/rubicon-project/prebid-server-java/blob/master/src/main/resources/static/pbs_request.json). +[pbs_request.json](../../src/main/resources/static/pbs_request.json). This endpoint does not support OpenRTB request, so can be assumed as legacy. diff --git a/docs/endpoints/info/bidders/bidderName.md b/docs/endpoints/info/bidders/bidderName.md index f3a041635ca..bf4b65dc4e7 100644 --- a/docs/endpoints/info/bidders/bidderName.md +++ b/docs/endpoints/info/bidders/bidderName.md @@ -34,7 +34,7 @@ This endpoint returns JSON like: The fields hold the following information: -- `maintainer.email`: A contact email for the Bidder's maintainer. In general, Bidder bugs should be logged as [issues](https://github.com/rubicon-project/prebid-server-java/issues)... but this contact email may be useful in case of emergency. +- `maintainer.email`: A contact email for the Bidder's maintainer. In general, Bidder bugs should be logged as [issues](https://github.com/prebid/prebid-server-java/issues)... but this contact email may be useful in case of emergency. - `capabilities.app.mediaTypes`: A list of media types this Bidder supports from Mobile Apps. - `capabilities.site.mediaTypes`: A list of media types this Bidder supports from Web pages. diff --git a/docs/endpoints/openrtb2/auction.md b/docs/endpoints/openrtb2/auction.md index ed43a951a1a..a48a9a99bd0 100644 --- a/docs/endpoints/openrtb2/auction.md +++ b/docs/endpoints/openrtb2/auction.md @@ -116,7 +116,6 @@ The only exception here is the top-level `BidResponse`, because it's bidder-inde Exceptions are made for extensions with "standard" recommendations: -- `request.user.ext.digitrust` -- To support Digitrust support - `request.regs.ext.gdpr` and `request.user.ext.consent` -- To support GDPR - `request.site.ext.amp` -- To identify AMP as the request source - `request.app.ext.source` and `request.app.ext.version` -- To support identifying the displaymanager/SDK in mobile apps. If given, we expect these to be strings. @@ -165,6 +164,7 @@ to set these params on the response at `response.seatbid[i].bid[j].ext.prebid.ta }, "includewinners": false, // Optional param defaulting to true "includebidderkeys": false // Optional param defaulting to true + "includeformat": false // Optional param defaulting to false } } } @@ -179,6 +179,8 @@ For backwards compatibility the following strings will also be allowed as price One of "includewinners" or "includebidderkeys" must be true (both default to true if unset). If both were false, then no targeting keys would be set, which is better configured by omitting targeting altogether. +The parameter "includeformat" indicates the type of the bid (banner, video, etc) for multiformat requests. It will add the key `hb_format` and/or `hb_format_{bidderName}` as per "includewinners" and "includebidderkeys" above. + MediaType PriceGranularity - when a single OpenRTB request contains multiple impressions with different mediatypes, or a single impression supports multiple formats, the different mediatypes may need different price granularities. If `mediatypepricegranularity` is present, `pricegranularity` would only be used for any mediatypes not specified. ``` @@ -683,11 +685,7 @@ Prebid Server adapters can support the [Prebid.js User ID modules](http://prebid "source": "pubcommon", "id":"11111111" } - ], - "digitrust": { - "id": "11111111111", - "keyv": 4 - } + ] } } } @@ -768,8 +766,8 @@ This supports publishers who want to sell different impressions to different bid This endpoint returns a 400 if the request contains deprecated properties (e.g. `imp.wmin`, `imp.hmax`). The error message in the response should describe how to "fix" the request to make it legal. -If the message is unclear, please [log an issue](https://github.com/rubicon-project/prebid-server-java/issues) -or [submit a pull request](https://github.com/rubicon-project/prebid-server-java/pulls) to improve it. +If the message is unclear, please [log an issue](https://github.com/prebid/prebid-server-java/issues) +or [submit a pull request](https://github.com/prebid/prebid-server-java/pulls) to improve it. #### Determining Bid Security (http/https) diff --git a/docs/metrics.md b/docs/metrics.md index 86f8b1203fb..189a5b242c8 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -3,19 +3,41 @@ This document describes all metrics collected and submitted to configured backends by the Prebid Server. ## System metrics +Other available metrics not mentioned here can found at +[Vert.x Dropwizard Metrics](https://vertx.io/docs/vertx-dropwizard-metrics/java/#_the_metrics) page. + +### HTTP server metrics - `vertx.http.servers.[IP]:[PORT].open-netsockets.count` - current number of open connections 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 -Other available metrics can found at [Vert.x Dropwizard Metrics](https://vertx.io/docs/vertx-dropwizard-metrics/java/#_the_metrics) page. +### HTTP client metrics +- `vertx.http.clients.connections.{min,max,mean,p95,p99}` - how long connections live +- `vertx.http.clients.connections.{m1_rate,m5_rate,m15_rate,mean_rate}` - rate of the connection occurrences +- `vertx.http.clients.requests.{min,max,mean,p95,p99}` - request time +- `vertx.http.clients.requests.{m1_rate,m5_rate,m15_rate,mean_rate}` - request rate + +If HTTP client per destination endpoint metrics enabled: +- `vertx.http.clients.endpoint.[ENDPOINT]:[PORT].queue-delay.{min,max,mean,p95,p99}` - wait time of a pending request in the queue +- `vertx.http.clients.endpoint.[ENDPOINT]:[PORT].queue-size.count` - actual queue size +- `vertx.http.clients.endpoint.[ENDPOINT]:[PORT].open-netsockets.count` - actual number of open sockets to the endpoint +- `vertx.http.clients.endpoint.[ENDPOINT]:[PORT].usage.{min,max,mean,p95,p99}` - time of the delay between the request starts and the response ends +- `vertx.http.clients.endpoint.[ENDPOINT]:[PORT].in-use` - actual number of in-flight requests +- `vertx.http.clients.endpoint.[ENDPOINT]:[PORT].ttfb` - wait time between the request ended and its response begins + +### Database pool metrics +- `vertx.pools.datasouce.[DATASOURCE].queue-delay.{min,max,mean,p95,p99}` - duration of the delay to obtain the resource, i.e the wait time in the queue +- `vertx.pools.datasouce.[DATASOURCE].queue-size.counter` - the actual number of waiters in the queue +- `vertx.pools.datasouce.[DATASOURCE].usage.{min,max,mean,p95,p99}` - duration of the usage of the resource +- `vertx.pools.datasouce.[DATASOURCE].in-use.counter` - actual number of resources used + +where `[DATASOURCE]` is a data source name, `DEFAULT_DS` by defaul. ## General auction metrics - `app_requests` - number of requests received from applications - `no_cookie_requests` - number of requests without `uids` cookie or with one that didn't contain at least one live UID -- `safari_requests` - number of requests received from Safari browser -- `safari_no_cookie_requests` - number of requests received from Safari browser without `uids` cookie or with one that didn't contain at least one live UID - `request_time` - timer tracking how long did it take for Prebid Server to serve a request - `imps_requested` - number if impressions requested - `imps_banner` - number of banner impressions @@ -25,11 +47,7 @@ Other available metrics can found at [Vert.x Dropwizard Metrics](https://vertx.i - `requests.(ok|badinput|err|networkerr|blacklisted_account|blacklisted_app).(openrtb2-web|openrtb-app|amp|legacy)` - number of requests broken down by status and type - `bidder-cardinality..requests` - number of requests targeting `` of bidders - `connection_accept_errors` - number of errors occurred while establishing HTTP connection -- `db_circuitbreaker_opened` - number of times database circuit breaker was opened (database is unavailable) -- `db_circuitbreaker_closed` - number of times database circuit breaker was closed (database is available again) - `db_query_time` - timer tracking how long did it take for database client to obtain the result for a query -- `httpclient_circuitbreaker_opened.` - number of times http client circuit breaker was opened (requested resource is unavailable) for particular host -- `httpclient_circuitbreaker_closed.` - number of times http client circuit breaker was closed (requested resource is available again) for particular host - `stored_requests_found` - number of stored requests that were found - `stored_requests_missing` - number of stored requests that were not found by provided stored request IDs - `stored_imps_found` - number of stored impressions that were found @@ -37,8 +55,16 @@ Other available metrics can found at [Vert.x Dropwizard Metrics](https://vertx.i - `geolocation_requests` - number of times geo location lookup was requested - `geolocation_successful` - number of successful geo location lookup responses - `geolocation_fail` - number of failed geo location lookup responses -- `geolocation_circuitbreaker_opened` - number of times geo location circuit breaker was opened (geo location resource is unavailable) -- `geolocation_circuitbreaker_closed` - number of times geo location circuit breaker was closed (geo location resource is available again) +- `circuit-breaker.http.named..opened` - state of the http client circuit breaker for a particular host: `1` means opened (requested resource is unavailable), `0` - closed +- `circuit.breaker.http.existing` - number of http client circuit breakers existing currently for all hosts +- `circuit-breaker.db.opened` - state of the database circuit breaker: `1` means opened (database is unavailable), `0` - closed +- `circuit-breaker.geo.opened` - state of the geo location circuit breaker: `1` means opened (geo location resource is unavailable), `0` - closed +- `timeout_notification.ok` - number of times bidders were successfully notified about timeouts +- `timeout_notification.failed` - number of unsuccessful attempts to notify bidders about timeouts +- `currency-rates.stale` - a flag indicating if currency rates obtained from external source are fresh (`0`) or stale (`1`) +- `settings.cache.(stored-request|amp-stored-request).refresh.(initialize|update).db_query_time` - timer tracking how long was settings cache population +- `settings.cache.(stored-request|amp-stored-request).refresh.(initialize|update).err` - number of errors during settings cache population +- `settings.cache.account.(hit|miss)` - number of times account was found or was missing in cache ## Auction per-adapter metrics - `adapter..no_cookie_requests` - number of requests made to `` that did not contain UID @@ -52,17 +78,21 @@ Other available metrics can found at [Vert.x Dropwizard Metrics](https://vertx.i - `adapter..(openrtb2-web|openrtb-app|amp|legacy).tcf.geo_masked` - number of requests made to `` that required geo information removed as a result of TCF enforcement for that bidder - `adapter..(openrtb2-web|openrtb-app|amp|legacy).tcf.request_blocked` - number of requests made to `` that were blocked as a result of TCF enforcement for that bidder - `adapter..(openrtb2-web|openrtb-app|amp|legacy).tcf.analytics_blocked` - number of requests made to `` that required analytics blocked as a result of TCF enforcement for that bidder +- `adapter..response.validation.size.(warn|err)` - number of banner bids received from the `` that had invalid size +- `adapter..response.validation.secure.(warn|err)` - number of bids received from the `` that had insecure creative while in secure context ## Auction per-account metrics Following metrics are collected and submitted if account is configured with `basic` verbosity: - `account..requests` - number of requests received from account with `` +- `account..response.validation.size.(warn|err)` - number of banner bids received from account with `` that had invalid size +- `account..response.validation.secure.(warn|err)` - number of bids received from account with `` that had insecure creative while in secure context Following metrics are collected and submitted if account is configured with `detailed` verbosity: - `account..requests.type.(openrtb2-web,openrtb-app,amp,legacy)` - number of requests received from account with `` broken down by type of incoming request -- `account...request_time` - timer tracking how long did it take to make a request to `` when incoming request was from `` -- `account...bids_received` - number of bids received from `` when incoming request was from `` -- `account...requests.(gotbids|nobid)` - number of requests made to `` broken down by result status when incoming request was from `` -- `account..requests.rejected` - number of rejected requests caused by incorrect `accountId` ([UnauthorizedAccountException.java](https://github.com/rubicon-project/prebid-server-java/blob/master/src/main/java/org/prebid/server/exception/UnauthorizedAccountException.java)) +- `account..requests.rejected` - number of rejected requests caused by incorrect `accountId` +- `account..adapter..request_time` - timer tracking how long did it take to make a request to `` when incoming request was from `` +- `account..adapter..bids_received` - number of bids received from `` when incoming request was from `` +- `account..adapter..requests.(gotbids|nobid)` - number of requests made to `` broken down by result status when incoming request was from `` ## General Prebid Cache metrics - `prebid_cache.requests.ok` - timer tracking how long did successful cache requests take @@ -88,9 +118,12 @@ Following metrics are collected and submitted if account is configured with `det ## Privacy metrics - `privacy.tcf.(missing|invalid)` - number of requests lacking a valid consent string +- `privacy.tcf.(v1,v2).requests` - number of requests by TCF version - `privacy.tcf.(v1,v2).unknown-geo` - number of requests received from unknown geo region with consent string of particular version - `privacy.tcf.(v1,v2).in-geo` - number of requests received from TCF-concerned geo region with consent string of particular version - `privacy.tcf.(v1,v2).out-geo` - number of requests received outside of TCF-concerned geo region with consent string of particular version - `privacy.tcf.(v1,v2).vendorlist.(missing|ok|err|fallback)` - number of processed vendor lists of particular version - `privacy.usp.specified` - number of requests with a valid US Privacy string (CCPA) - `privacy.usp.opt-out` - number of requests that required privacy enforcement according to CCPA rules +- `privacy.lmt` - number of requests that required privacy enforcement according to LMT flag +- `privacy.coppa` - number of requests that required privacy enforcement according to COPPA rules diff --git a/docs/pbs-java-and-go-features-review.md b/docs/pbs-java-and-go-features-review.md deleted file mode 100644 index 44eeae86428..00000000000 --- a/docs/pbs-java-and-go-features-review.md +++ /dev/null @@ -1,42 +0,0 @@ -# Feature Differences Overview - -[Detailed Differences Description](differenceBetweenPBSGo-and-Java.md) - - Feature | Java | Go -| --- | :---: | :---:| -GDPR TCF1.1 |+|+ -GDPR TCF2 |+|+ -Geo location (used for GDPR) |+|- -COPPA |+|+ -CCPA |+|+ -AMP |+|+ -Stored Requests |+|+ -Stored Responses |+|- -PBJS First Party data |+|- -Currency Conversion** |+|+ -Multiple root schains |+|- -Price Granularity |+|+ -Price Granularity per MediaType|+|- -User ID Module support |+|+ -Account exclude list |+|+ -Event Notification endpoint |+|- -Video ad support |+|+ -Long-form video endpoint |-|+ -IAB advertiser category mapping |-|+ -Aliases |+|+ -Video Impression Tracking endpoint |+|- -Cooperative Cookie Syncing |+|- -Circuit Breaker (Http, DB) |+|- -Operational metrics |+|+ -Supports both "debug" and "test" flags |+|- -All adapters ported to OpenRTB |+|- -Echo stored request video attributes in response |+|- -Accept account ID on AMP requests |+|- -Cache only-winning-bids flag |+|- -Remote File Downloader |+|- -Bidder Generator |+|- -Passing `request.ext.prebid.bidders.BIDDER` to corresponding bidder |+|- - -** -* PBS-Java Currency conversion supports finding intermediate conversion rate; -* PBS-Go Currency Conversion debug endpoint exposes more information, PBS-Java currently provides last updated time only; diff --git a/pom.xml b/pom.xml index 9413528fd75..deb13eaf7a4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.prebid prebid-server - 1.46.0-SNAPSHOT + 1.53.0-SNAPSHOT prebid-server Prebid Server (Server-side Header Bidding) @@ -14,7 +14,7 @@ - scm:git:git@github.com:rubicon-project/prebid-server-java.git + scm:git:git@github.com:prebid/prebid-server-java.git HEAD @@ -55,7 +55,7 @@ 2.23.4 3.8.0 2.26.3 - 9.4.31.v20200723 + 9.4.35.v20201120 3.0.6 1.4.196 @@ -235,6 +235,11 @@ metrics-core ${metrics.version} + + io.dropwizard.metrics + metrics-jvm + ${metrics.version} + io.dropwizard.metrics metrics-graphite diff --git a/src/main/java/org/prebid/server/analytics/LogAnalyticsReporter.java b/src/main/java/org/prebid/server/analytics/LogAnalyticsReporter.java index 7fc108f1d42..3ca358a9cca 100644 --- a/src/main/java/org/prebid/server/analytics/LogAnalyticsReporter.java +++ b/src/main/java/org/prebid/server/analytics/LogAnalyticsReporter.java @@ -29,22 +29,26 @@ public LogAnalyticsReporter(JacksonMapper mapper) { @Override public void processEvent(T event) { - final String type; + final LogEvent logEvent; + if (event instanceof AuctionEvent) { - type = "/openrtb2/auction"; + logEvent = new LogEvent<>("/openrtb2/auction", ((AuctionEvent) event).getBidResponse()); } else if (event instanceof AmpEvent) { - type = "/openrtb2/amp"; + logEvent = new LogEvent<>("/openrtb2/amp", ((AmpEvent) event).getBidResponse()); } else if (event instanceof VideoEvent) { - type = "/openrtb2/video"; + logEvent = new LogEvent<>("/openrtb2/video", ((VideoEvent) event).getBidResponse()); } else if (event instanceof SetuidEvent) { - type = "/setuid"; + final SetuidEvent setuidEvent = (SetuidEvent) event; + logEvent = new LogEvent<>( + "/setuid", + setuidEvent.getBidder() + ":" + setuidEvent.getUid() + ":" + setuidEvent.getSuccess()); } else if (event instanceof CookieSyncEvent) { - type = "/cookie_sync"; + logEvent = new LogEvent<>("/cookie_sync", ((CookieSyncEvent) event).getBidderStatus()); } else { - type = "unknown"; + logEvent = new LogEvent<>("unknown", null); } - logger.debug(mapper.encode(new LogEvent<>(type, event))); + logger.debug(mapper.encode(logEvent)); } @AllArgsConstructor diff --git a/src/main/java/org/prebid/server/auction/AmpRequestFactory.java b/src/main/java/org/prebid/server/auction/AmpRequestFactory.java index adcb24a701c..4b7a3130c41 100644 --- a/src/main/java/org/prebid/server/auction/AmpRequestFactory.java +++ b/src/main/java/org/prebid/server/auction/AmpRequestFactory.java @@ -121,7 +121,7 @@ public Future fromRequest(RoutingContext routingContext, long st */ private Future>> createBidRequest(RoutingContext context, String tagId) { final List errors = new ArrayList<>(); - return storedRequestProcessor.processAmpRequest(tagId) + return storedRequestProcessor.processAmpRequest(context.request().getParam(ACCOUNT_REQUEST_PARAM), tagId) .map(bidRequest -> validateStoredBidRequest(tagId, bidRequest)) .map(bidRequest -> fillExplicitParameters(bidRequest, context)) .map(bidRequest -> overrideParameters(bidRequest, context.request(), errors)) @@ -249,8 +249,7 @@ private static Integer debugFromQueryStringParam(RoutingContext context) { /** * Extracts parameters from http request and overrides corresponding attributes in {@link BidRequest}. */ - private BidRequest overrideParameters(BidRequest bidRequest, HttpServerRequest request, - List errors) { + private BidRequest overrideParameters(BidRequest bidRequest, HttpServerRequest request, List errors) { final String requestConsentParam = request.getParam(CONSENT_PARAM); final String requestGdprConsentParam = request.getParam(GDPR_CONSENT_PARAM); final String consentString = ObjectUtils.firstNonNull(requestConsentParam, requestGdprConsentParam); @@ -635,11 +634,14 @@ private ExtRequestTargeting createTargetingWithDefaults(ExtRequestPrebid prebid) final boolean includeBidderKeys = isTargetingNull || targeting.getIncludebidderkeys() == null || targeting.getIncludebidderkeys(); + final Boolean includeFormat = !isTargetingNull ? targeting.getIncludeformat() : null; + return ExtRequestTargeting.builder() .pricegranularity(outgoingPriceGranularityNode) .mediatypepricegranularity(mediaTypePriceGranularity) .includewinners(includeWinners) .includebidderkeys(includeBidderKeys) + .includeformat(includeFormat) .build(); } } diff --git a/src/main/java/org/prebid/server/auction/AuctionRequestFactory.java b/src/main/java/org/prebid/server/auction/AuctionRequestFactory.java index 6fd98ecfd1c..7160ae670ee 100644 --- a/src/main/java/org/prebid/server/auction/AuctionRequestFactory.java +++ b/src/main/java/org/prebid/server/auction/AuctionRequestFactory.java @@ -49,11 +49,10 @@ import org.prebid.server.proto.openrtb.ext.request.ExtRequestPrebidChannel; import org.prebid.server.proto.openrtb.ext.request.ExtRequestTargeting; import org.prebid.server.proto.openrtb.ext.request.ExtSite; -import org.prebid.server.proto.openrtb.ext.request.ExtUser; -import org.prebid.server.proto.openrtb.ext.request.ExtUserDigiTrust; import org.prebid.server.proto.openrtb.ext.response.BidType; import org.prebid.server.settings.ApplicationSettings; import org.prebid.server.settings.model.Account; +import org.prebid.server.settings.model.AccountStatus; import org.prebid.server.util.HttpUtil; import org.prebid.server.validation.RequestValidator; import org.prebid.server.validation.model.ValidationResult; @@ -200,7 +199,7 @@ Future toAuctionContext(RoutingContext routingContext, return accountFrom(bidRequest, timeout, routingContext) .compose(account -> privacyEnforcementService.contextFromBidRequest( - bidRequest, account, requestTypeMetric, timeout) + bidRequest, account, requestTypeMetric, timeout, errors) .map(privacyContext -> AuctionContext.builder() .routingContext(routingContext) .uidsCookie(uidsCookieService.parseFromRequest(routingContext)) @@ -253,7 +252,7 @@ private BidRequest parseRequest(RoutingContext context, List errors) { * updated by values derived from headers and other request attributes. */ private Future updateBidRequest(RoutingContext context, BidRequest bidRequest) { - return storedRequestProcessor.processStoredRequests(bidRequest) + return storedRequestProcessor.processStoredRequests(accountIdFrom(bidRequest), bidRequest) .map(resolvedBidRequest -> fillImplicitParameters(resolvedBidRequest, context, timeoutResolver)) .map(this::validateRequest) .map(interstitialProcessor::process); @@ -278,7 +277,6 @@ BidRequest fillImplicitParameters(BidRequest bidRequest, RoutingContext context, final Site populatedSite = bidRequest.getApp() != null ? null : populateSite(site, request); final User user = bidRequest.getUser(); - final User populatedUser = populateUser(user); final Source source = bidRequest.getSource(); final Source populatedSource = populateSource(source); @@ -299,14 +297,13 @@ BidRequest fillImplicitParameters(BidRequest bidRequest, RoutingContext context, final ExtRequest populatedExt = populateRequestExt( ext, bidRequest, ObjectUtils.defaultIfNull(populatedImps, imps)); - if (populatedDevice != null || populatedSite != null || populatedUser != null || populatedSource != null + if (populatedDevice != null || populatedSite != null || populatedSource != null || populatedImps != null || resolvedAt != null || resolvedCurrencies != null || resolvedTmax != null || populatedExt != null) { result = bidRequest.toBuilder() .device(populatedDevice != null ? populatedDevice : device) .site(populatedSite != null ? populatedSite : site) - .user(populatedUser != null ? populatedUser : user) .source(populatedSource != null ? populatedSource : source) .imp(populatedImps != null ? populatedImps : imps) .at(resolvedAt != null ? resolvedAt : at) @@ -351,13 +348,20 @@ private Device populateDevice(Device device, HttpServerRequest request) { logWarnIfNoIp(resolvedIp, resolvedIpv6); final String ua = device != null ? device.getUa() : null; + final Integer dnt = resolveDntHeader(request); if (!Objects.equals(deviceIp, resolvedIp) || !Objects.equals(deviceIpv6, resolvedIpv6) - || StringUtils.isBlank(ua)) { + || StringUtils.isBlank(ua) || dnt != null) { final Device.DeviceBuilder builder = device == null ? Device.builder() : device.toBuilder(); - builder.ua(StringUtils.isNotBlank(ua) ? ua : paramsExtractor.uaFrom(request)); + + if (StringUtils.isBlank(ua)) { + builder.ua(paramsExtractor.uaFrom(request)); + } + if (dnt != null) { + builder.dnt(dnt); + } builder .ip(resolvedIp) @@ -369,6 +373,11 @@ private Device populateDevice(Device device, HttpServerRequest request) { return null; } + private Integer resolveDntHeader(HttpServerRequest request) { + final String dnt = request.getHeader(HttpUtil.DNT_HEADER.toString()); + return StringUtils.equalsAny(dnt, "0", "1") ? Integer.valueOf(dnt) : null; + } + private String sanitizeIp(String ip, IpAddress.IP version) { final IpAddress ipAddress = ip != null ? ipAddressHelper.toIpAddress(ip) : null; return ipAddress != null && ipAddress.getVersion() == version ? ipAddress.getIp() : null; @@ -438,33 +447,6 @@ private Site populateSite(Site site, HttpServerRequest request) { return result; } - /** - * Populates the request body's 'user' section from the incoming http request if the original is partially filled. - */ - private User populateUser(User user) { - final ExtUser ext = userExtOrNull(user); - - if (ext != null) { - return user.toBuilder().ext(ext).build(); - } - return null; - } - - /** - * Returns updated {@link ExtUser} or null if no updates needed. - */ - private ExtUser userExtOrNull(User user) { - final ExtUser extUser = user != null ? user.getExt() : null; - - final ExtUserDigiTrust digitrust = extUser != null ? extUser.getDigitrust() : null; - if (digitrust != null && digitrust.getPref() == null) { - return extUser.toBuilder() - .digitrust(ExtUserDigiTrust.of(digitrust.getId(), digitrust.getKeyv(), 0)) - .build(); - } - return null; - } - /** * Returns {@link Source} with updated source.tid or null if nothing changed. */ @@ -589,6 +571,7 @@ private ExtRequestTargeting targetingOrNull(ExtRequestPrebid prebid, Set accountFrom(BidRequest bidRequest, Timeout timeout, Rout return blankAccountId ? responseForEmptyAccount(routingContext) : applicationSettings.getAccountById(accountId, timeout) - .recover(exception -> accountFallback(exception, accountId, routingContext)); + .compose(this::ensureAccountActive, exception -> accountFallback(exception, accountId, routingContext)); } /** @@ -862,6 +845,15 @@ private Future responseForUnknownAccount(String accountId) { : Future.succeededFuture(Account.empty(accountId)); } + private Future ensureAccountActive(Account account) { + final String accountId = account.getId(); + + return account.getStatus() == AccountStatus.inactive + ? Future.failedFuture( + new UnauthorizedAccountException(String.format("Account %s is inactive", accountId), accountId)) + : Future.succeededFuture(account); + } + private BidRequest enrichBidRequestWithAccountAndPrivacyData( BidRequest bidRequest, Account account, PrivacyContext privacyContext) { diff --git a/src/main/java/org/prebid/server/auction/BidResponseCreator.java b/src/main/java/org/prebid/server/auction/BidResponseCreator.java index a5fcdc9ac2d..ff7e0c0fa35 100644 --- a/src/main/java/org/prebid/server/auction/BidResponseCreator.java +++ b/src/main/java/org/prebid/server/auction/BidResponseCreator.java @@ -222,7 +222,7 @@ private Future cacheBidsAndCreateResponse(List bidd auctionContext, cacheInfo, eventsContext) - .compose(cacheResult -> videoStoredDataResult(bidRequest.getImp(), auctionContext.getTimeout()) + .compose(cacheResult -> videoStoredDataResult(auctionContext) .map(videoStoredDataResult -> toBidResponse( bidderResponses, auctionContext, @@ -280,14 +280,19 @@ private ExtBidResponse toExtBidResponse(List bidderResponses, private static void removeRedundantBids(BidderResponse bidderResponse) { final List responseBidderBids = bidderResponse.getSeatBid().getBids(); + if (responseBidderBids.size() < 2) { // no reason for removing if only one bid was responded + return; + } + final Map> impIdToBidderBid = responseBidderBids.stream() .collect(Collectors.groupingBy(bidderBid -> bidderBid.getBid().getImpid())); - final List mostValuableBids = impIdToBidderBid.values().stream() + final Set mostValuableBids = impIdToBidderBid.values().stream() .map(BidResponseCreator::mostValuableBid) - .collect(Collectors.toList()); + .collect(Collectors.toSet()); - responseBidderBids.retainAll(mostValuableBids); + responseBidderBids.clear(); + responseBidderBids.addAll(mostValuableBids); } private static BidderBid mostValuableBid(List bidderBids) { @@ -517,7 +522,8 @@ private Map> toExtBidderErrors(List errors.putAll(extractBidderErrors(bidderResponses)); errors.putAll(extractDeprecatedBiddersErrors(bidRequest)); - errors.putAll(extractPrebidErrors(cacheResult, videoStoredDataResult, auctionContext)); + errors.putAll(extractPrebidErrors(videoStoredDataResult, auctionContext)); + errors.putAll(extractCacheErrors(cacheResult)); if (MapUtils.isNotEmpty(bidErrors)) { addBidErrors(errors, bidErrors); } @@ -559,37 +565,21 @@ private Map> extractDeprecatedBiddersErrors(BidRequ } /** - * Returns a singleton map with "prebid" as a key and list of {@link ExtBidderError}s cache errors as a value. + * Returns a singleton map with "prebid" as a key and list of {@link ExtBidderError}s errors as a value. */ - private static Map> extractPrebidErrors(CacheServiceResult cacheResult, - VideoStoredDataResult videoStoredDataResult, + private static Map> extractPrebidErrors(VideoStoredDataResult videoStoredDataResult, AuctionContext auctionContext) { - final List cacheErrors = extractCacheErrors(cacheResult); final List storedErrors = extractStoredErrors(videoStoredDataResult); final List contextErrors = extractContextErrors(auctionContext); - if (cacheErrors.isEmpty() && storedErrors.isEmpty() && contextErrors.isEmpty()) { + if (storedErrors.isEmpty() && contextErrors.isEmpty()) { return Collections.emptyMap(); } - final List collectedErrors = Stream.concat(contextErrors.stream(), - Stream.concat(storedErrors.stream(), cacheErrors.stream())) + final List collectedErrors = Stream.concat(contextErrors.stream(), storedErrors.stream()) .collect(Collectors.toList()); return Collections.singletonMap(PREBID_EXT, collectedErrors); } - /** - * Returns a list of {@link ExtBidderError}s of cache errors. - */ - private static List extractCacheErrors(CacheServiceResult cacheResult) { - final Throwable error = cacheResult.getError(); - if (error != null) { - final ExtBidderError extBidderError = ExtBidderError.of(BidderError.Type.generic.getCode(), - error.getMessage()); - return Collections.singletonList(extBidderError); - } - return Collections.emptyList(); - } - /** * Returns a list of {@link ExtBidderError}s of stored request errors. */ @@ -612,6 +602,19 @@ private static List extractContextErrors(AuctionContext auctionC .collect(Collectors.toList()); } + /** + * Returns a singleton map with "cache" as a key and list of {@link ExtBidderError}s cache errors as a value. + */ + private static Map> extractCacheErrors(CacheServiceResult cacheResult) { + final Throwable error = cacheResult.getError(); + if (error != null) { + final ExtBidderError extBidderError = ExtBidderError.of(BidderError.Type.generic.getCode(), + error.getMessage()); + return Collections.singletonMap(CACHE, Collections.singletonList(extBidderError)); + } + return Collections.emptyMap(); + } + /** * Adds bid errors: if value by key exists - add errors to its list, otherwise - add an entry. */ @@ -700,9 +703,14 @@ private BidResponse toBidResponse(List bidderResponses, .build(); } - private Future videoStoredDataResult(List imps, Timeout timeout) { + private Future videoStoredDataResult(AuctionContext auctionContext) { + final List imps = auctionContext.getBidRequest().getImp(); + final String accountId = auctionContext.getAccount().getId(); + final Timeout timeout = auctionContext.getTimeout(); + final List errors = new ArrayList<>(); final List storedVideoInjectableImps = new ArrayList<>(); + for (Imp imp : imps) { try { if (checkEchoVideoAttrs(imp)) { @@ -713,7 +721,7 @@ private Future videoStoredDataResult(List imps, Time } } - return storedRequestProcessor.videoStoredDataResult(storedVideoInjectableImps, errors, timeout) + return storedRequestProcessor.videoStoredDataResult(accountId, storedVideoInjectableImps, errors, timeout) .otherwise(throwable -> VideoStoredDataResult.of(Collections.emptyMap(), Collections.singletonList(throwable.getMessage()))); } @@ -828,7 +836,8 @@ private Bid toBid(BidderBid bidderBid, final TargetingKeywordsCreator keywordsCreator = resolveKeywordsCreator(bidType, targeting, isApp, bidRequest, account); - targetingKeywords = keywordsCreator.makeFor(bid, bidder, isWinningBid, cacheId, videoCacheId); + targetingKeywords = keywordsCreator.makeFor(bid, bidder, isWinningBid, cacheId, bidType.getName(), + videoCacheId); } else { targetingKeywords = null; } @@ -1045,6 +1054,7 @@ private TargetingKeywordsCreator createKeywordsCreator(ExtRequestTargeting targe parsePriceGranularity(priceGranularity), targeting.getIncludewinners(), targeting.getIncludebidderkeys(), + BooleanUtils.isTrue(targeting.getIncludeformat()), isApp, resolveTruncateAttrChars(targeting, account), cacheHost, diff --git a/src/main/java/org/prebid/server/auction/ExchangeService.java b/src/main/java/org/prebid/server/auction/ExchangeService.java index 7b3426e4258..dbd39b5c921 100644 --- a/src/main/java/org/prebid/server/auction/ExchangeService.java +++ b/src/main/java/org/prebid/server/auction/ExchangeService.java @@ -153,18 +153,19 @@ public Future holdAuction(AuctionContext context) { .compose(impsRequiredRequest -> extractBidderRequests(context, impsRequiredRequest, aliases)) .map(bidderRequests -> updateRequestMetric( bidderRequests, uidsCookie, aliases, publisherId, context.getRequestTypeMetric())) - .compose(bidderRequests -> CompositeFuture.join(bidderRequests.stream() - .map(bidderRequest -> requestBids( - bidderRequest, - auctionTimeout(timeout, cacheInfo.isDoCaching()), - debugEnabled, - aliases)) - .collect(Collectors.toList()))) + .compose(bidderRequests -> CompositeFuture.join( + bidderRequests.stream() + .map(bidderRequest -> requestBids( + bidderRequest, + auctionTimeout(timeout, cacheInfo.isDoCaching()), + debugEnabled, + aliases)) + .collect(Collectors.toList()))) // send all the requests to the bidders and gathers results .map(CompositeFuture::list) .map(bidderResponses -> storedResponseProcessor.mergeWithBidderResponses( bidderResponses, storedResponse, bidRequest.getImp())) - .map(bidderResponses -> validateAndAdjustBids(bidRequest, bidderResponses)) + .map(bidderResponses -> validateAndAdjustBids(bidderResponses, context, aliases)) .map(bidderResponses -> updateMetricsFromResponses(bidderResponses, publisherId, aliases)) // produce response from bidder results .compose(bidderResponses -> bidResponseCreator.create( @@ -798,8 +799,10 @@ private static BigDecimal bidAdjustmentForBidder(BidRequest bidRequest, String b * Passes the request to a corresponding bidder and wraps response in {@link BidderResponse} which also holds * recorded response time. */ - private Future requestBids( - BidderRequest bidderRequest, Timeout timeout, boolean debugEnabled, BidderAliases aliases) { + private Future requestBids(BidderRequest bidderRequest, + Timeout timeout, + boolean debugEnabled, + BidderAliases aliases) { final String bidderName = bidderRequest.getBidder(); final Bidder bidder = bidderCatalog.bidderByName(aliases.resolveBidder(bidderName)); @@ -809,10 +812,12 @@ private Future requestBids( .map(seatBid -> BidderResponse.of(bidderName, seatBid, responseTime(startTime))); } - private List validateAndAdjustBids(BidRequest bidRequest, List bidderResponses) { + private List validateAndAdjustBids( + List bidderResponses, AuctionContext auctionContext, BidderAliases aliases) { + return bidderResponses.stream() - .map(bidderResponse -> validBidderResponse(bidderResponse, bidRequest.getCur())) - .map(bidderResponse -> applyBidPriceChanges(bidderResponse, bidRequest)) + .map(bidderResponse -> validBidderResponse(bidderResponse, auctionContext, aliases)) + .map(bidderResponse -> applyBidPriceChanges(bidderResponse, auctionContext.getBidRequest())) .collect(Collectors.toList()); } @@ -823,28 +828,37 @@ private List validateAndAdjustBids(BidRequest bidRequest, List * Returns input argument as the result if no errors found or creates new {@link BidderResponse} otherwise. */ - private BidderResponse validBidderResponse(BidderResponse bidderResponse, List requestCurrencies) { - final BidderSeatBid seatBid = bidderResponse.getSeatBid(); - final List bids = seatBid.getBids(); + private BidderResponse validBidderResponse( + BidderResponse bidderResponse, AuctionContext auctionContext, BidderAliases aliases) { - final List validBids = new ArrayList<>(bids.size()); + final BidRequest bidRequest = auctionContext.getBidRequest(); + final BidderSeatBid seatBid = bidderResponse.getSeatBid(); final List errors = new ArrayList<>(seatBid.getErrors()); + final List requestCurrencies = bidRequest.getCur(); if (requestCurrencies.size() > 1) { errors.add(BidderError.badInput( String.format("Cur parameter contains more than one currency. %s will be used", requestCurrencies.get(0)))); } - for (BidderBid bid : bids) { - final ValidationResult validationResult = responseBidValidator.validate(bid.getBid()); + final List bids = seatBid.getBids(); + final List validBids = new ArrayList<>(bids.size()); + + for (final BidderBid bid : bids) { + final ValidationResult validationResult = + responseBidValidator.validate(bid, bidderResponse.getBidder(), auctionContext, aliases); + + if (validationResult.hasWarnings()) { + addAsBidderErrors(validationResult.getWarnings(), errors); + } + if (validationResult.hasErrors()) { - for (String error : validationResult.getErrors()) { - errors.add(BidderError.generic(error)); - } - } else { - validBids.add(bid); + addAsBidderErrors(validationResult.getErrors(), errors); + continue; } + + validBids.add(bid); } return errors.isEmpty() @@ -852,6 +866,10 @@ private BidderResponse validBidderResponse(BidderResponse bidderResponse, List messages, List errors) { + messages.stream().map(BidderError::generic).forEach(errors::add); + } + /** * Performs changes on {@link Bid}s price depends on different between adServerCurrency and bidCurrency, * and adjustment factor. Will drop bid if currency conversion is needed but not possible. @@ -878,8 +896,8 @@ private BidderResponse applyBidPriceChanges(BidderResponse bidderResponse, BidRe final String bidCurrency = bidderBid.getBidCurrency(); final BigDecimal price = bid.getPrice(); try { - final BigDecimal priceInAdServerCurrency = currencyService.convertCurrency(price, bidRequest, - adServerCurrency, bidCurrency); + final BigDecimal priceInAdServerCurrency = currencyService.convertCurrency( + price, bidRequest, adServerCurrency, StringUtils.stripToNull(bidCurrency)); final BigDecimal adjustedPrice = adjustPrice(priceAdjustmentFactor, priceInAdServerCurrency); @@ -888,9 +906,7 @@ private BidderResponse applyBidPriceChanges(BidderResponse bidderResponse, BidRe } updatedBidderBids.add(bidderBid); } catch (PreBidException e) { - errors.add(BidderError.generic( - String.format("Unable to covert bid currency %s to desired ad server currency %s. %s", - bidCurrency, adServerCurrency, e.getMessage()))); + errors.add(BidderError.generic(e.getMessage())); } } diff --git a/src/main/java/org/prebid/server/auction/FpdResolver.java b/src/main/java/org/prebid/server/auction/FpdResolver.java index ba6643be2b7..2eab1a9229d 100644 --- a/src/main/java/org/prebid/server/auction/FpdResolver.java +++ b/src/main/java/org/prebid/server/auction/FpdResolver.java @@ -10,6 +10,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.prebid.server.exception.InvalidRequestException; import org.prebid.server.json.JacksonMapper; +import org.prebid.server.json.JsonMerger; import org.prebid.server.proto.openrtb.ext.request.ExtApp; import org.prebid.server.proto.openrtb.ext.request.ExtBidderConfig; import org.prebid.server.proto.openrtb.ext.request.ExtBidderConfigFpd; @@ -21,7 +22,6 @@ import org.prebid.server.proto.openrtb.ext.request.ExtSite; import org.prebid.server.proto.openrtb.ext.request.ExtUser; import org.prebid.server.proto.request.Targeting; -import org.prebid.server.util.JsonMergeUtil; import java.util.ArrayList; import java.util.Arrays; @@ -53,12 +53,11 @@ public class FpdResolver { "privacypolicy", "mobile")); private final JacksonMapper jacksonMapper; - private final JsonMergeUtil jsonMergeUtil; + private final JsonMerger jsonMerger; - public FpdResolver(JacksonMapper jacksonMapper) { + public FpdResolver(JacksonMapper jacksonMapper, JsonMerger jsonMerger) { this.jacksonMapper = Objects.requireNonNull(jacksonMapper); - - this.jsonMergeUtil = new JsonMergeUtil(jacksonMapper); + this.jsonMerger = Objects.requireNonNull(jsonMerger); } public User resolveUser(User originUser, ObjectNode fpdUser) { @@ -183,7 +182,7 @@ public ObjectNode resolveImpExt(ObjectNode impExt, ObjectNode targeting) { : null; final ObjectNode resolvedData = extImpContextData != null - ? (ObjectNode) jsonMergeUtil.merge(targeting, extImpContextData) + ? (ObjectNode) jsonMerger.merge(targeting, extImpContextData) : targeting; return extImpContext != null && extImpContext.isObject() @@ -253,7 +252,7 @@ private ObjectNode mergeExtData(JsonNode fpdData, JsonNode originData) { } if (originData != null && originData.isObject()) { - return (ObjectNode) jsonMergeUtil.merge(fpdData, originData); + return (ObjectNode) jsonMerger.merge(fpdData, originData); } return fpdData.isObject() ? (ObjectNode) fpdData : null; } diff --git a/src/main/java/org/prebid/server/auction/InterstitialProcessor.java b/src/main/java/org/prebid/server/auction/InterstitialProcessor.java index b80b887ec0b..bf4b3507858 100644 --- a/src/main/java/org/prebid/server/auction/InterstitialProcessor.java +++ b/src/main/java/org/prebid/server/auction/InterstitialProcessor.java @@ -5,11 +5,11 @@ import com.iab.openrtb.request.Device; import com.iab.openrtb.request.Format; import com.iab.openrtb.request.Imp; +import org.apache.commons.collections4.CollectionUtils; import org.prebid.server.exception.InvalidRequestException; import org.prebid.server.proto.openrtb.ext.request.ExtDevice; import org.prebid.server.proto.openrtb.ext.request.ExtDeviceInt; import org.prebid.server.proto.openrtb.ext.request.ExtDevicePrebid; -import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/prebid/server/auction/OrtbTypesResolver.java b/src/main/java/org/prebid/server/auction/OrtbTypesResolver.java index fbe5eaf63b5..9773811950d 100644 --- a/src/main/java/org/prebid/server/auction/OrtbTypesResolver.java +++ b/src/main/java/org/prebid/server/auction/OrtbTypesResolver.java @@ -12,7 +12,7 @@ import org.apache.commons.lang3.StringUtils; import org.prebid.server.exception.InvalidRequestException; import org.prebid.server.json.JacksonMapper; -import org.prebid.server.util.JsonMergeUtil; +import org.prebid.server.json.JsonMerger; import java.util.ArrayList; import java.util.Arrays; @@ -69,11 +69,11 @@ public class OrtbTypesResolver { } private final JacksonMapper jacksonMapper; - private final JsonMergeUtil jsonMergeUtil; + private final JsonMerger jsonMerger; - public OrtbTypesResolver(JacksonMapper jacksonMapper) { + public OrtbTypesResolver(JacksonMapper jacksonMapper, JsonMerger jsonMerger) { this.jacksonMapper = Objects.requireNonNull(jacksonMapper); - this.jsonMergeUtil = new JsonMergeUtil(jacksonMapper); + this.jsonMerger = Objects.requireNonNull(jsonMerger); } /** @@ -254,7 +254,7 @@ public void normalizeDataExtension(ObjectNode containerNode, String containerNam final JsonNode extData = containerNode.path(EXT).path(DATA); final JsonNode ext = containerNode.get(EXT); if (!extData.isNull() && !extData.isMissingNode()) { - final JsonNode resolvedExtData = jsonMergeUtil.merge(extData, data); + final JsonNode resolvedExtData = jsonMerger.merge(extData, data); ((ObjectNode) ext).set(DATA, resolvedExtData); } else { copyDataToExtData(containerNode, containerName, nodePrefix, warnings, data); diff --git a/src/main/java/org/prebid/server/auction/PrivacyEnforcementService.java b/src/main/java/org/prebid/server/auction/PrivacyEnforcementService.java index f9f3cb6f1c3..ab09449e78f 100644 --- a/src/main/java/org/prebid/server/auction/PrivacyEnforcementService.java +++ b/src/main/java/org/prebid/server/auction/PrivacyEnforcementService.java @@ -3,9 +3,11 @@ import com.iab.openrtb.request.BidRequest; import com.iab.openrtb.request.Device; import com.iab.openrtb.request.Geo; +import com.iab.openrtb.request.Site; import com.iab.openrtb.request.User; import io.vertx.core.Future; import io.vertx.core.http.HttpServerRequest; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.BooleanUtils; import org.prebid.server.auction.model.AuctionContext; @@ -20,6 +22,7 @@ import org.prebid.server.privacy.gdpr.TcfDefinerService; import org.prebid.server.privacy.gdpr.VendorIdResolver; import org.prebid.server.privacy.gdpr.model.PrivacyEnforcementAction; +import org.prebid.server.privacy.gdpr.model.RequestLogInfo; import org.prebid.server.privacy.gdpr.model.TcfContext; import org.prebid.server.privacy.gdpr.model.TcfResponse; import org.prebid.server.privacy.model.Privacy; @@ -29,6 +32,7 @@ import org.prebid.server.proto.openrtb.ext.request.ExtUser; import org.prebid.server.proto.request.CookieSyncRequest; import org.prebid.server.settings.model.Account; +import org.prebid.server.settings.model.AccountGdprConfig; import org.prebid.server.util.HttpUtil; import java.text.DecimalFormat; @@ -62,13 +66,15 @@ public class PrivacyEnforcementService { private final IpAddressHelper ipAddressHelper; private final Metrics metrics; private final boolean ccpaEnforce; + private final boolean lmtEnforce; public PrivacyEnforcementService(BidderCatalog bidderCatalog, PrivacyExtractor privacyExtractor, TcfDefinerService tcfDefinerService, IpAddressHelper ipAddressHelper, Metrics metrics, - boolean ccpaEnforce) { + boolean ccpaEnforce, + boolean lmtEnforce) { this.bidderCatalog = Objects.requireNonNull(bidderCatalog); this.privacyExtractor = Objects.requireNonNull(privacyExtractor); @@ -76,12 +82,13 @@ public PrivacyEnforcementService(BidderCatalog bidderCatalog, this.ipAddressHelper = Objects.requireNonNull(ipAddressHelper); this.metrics = Objects.requireNonNull(metrics); this.ccpaEnforce = ccpaEnforce; + this.lmtEnforce = lmtEnforce; } Future contextFromBidRequest( - BidRequest bidRequest, Account account, MetricName requestType, Timeout timeout) { + BidRequest bidRequest, Account account, MetricName requestType, Timeout timeout, List errors) { - final Privacy privacy = privacyExtractor.validPrivacyFrom(bidRequest); + final Privacy privacy = privacyExtractor.validPrivacyFrom(bidRequest, errors); final Device device = bidRequest.getDevice(); final String ipAddress = device != null ? device.getIp() : null; @@ -96,18 +103,28 @@ Future contextFromBidRequest( final String effectiveIpAddress = isLmtEnabled(device) ? ipAddressHelper.maskIpv4(ipAddress) : ipAddress; + final AccountGdprConfig accountGdpr = account.getGdpr(); + final String accountId = account.getId(); + final RequestLogInfo requestLogInfo = requestLogInfo(requestType, bidRequest, accountId); + return tcfDefinerService.resolveTcfContext( - privacy, country, effectiveIpAddress, account.getGdpr(), requestType, timeout) + privacy, country, effectiveIpAddress, accountGdpr, requestType, requestLogInfo, timeout) .map(tcfContext -> PrivacyContext.of(privacy, tcfContext, tcfContext.getIpAddress())); } - public Future contextFromLegacyRequest(PreBidRequestContext preBidRequestContext, Account account) { + public Future contextFromLegacyRequest( + PreBidRequestContext preBidRequestContext, Account account) { + final Privacy privacy = privacyExtractor.validPrivacyFrom(preBidRequestContext.getPreBidRequest()); + final AccountGdprConfig accountGdpr = account.getGdpr(); + final String accountId = account.getId(); + final RequestLogInfo requestLogInfo = requestLogInfo(MetricName.legacy, null, accountId); return tcfDefinerService.resolveTcfContext( privacy, preBidRequestContext.getIp(), - account.getGdpr(), + accountGdpr, + requestLogInfo, preBidRequestContext.getTimeout()) .map(tcfContext -> PrivacyContext.of(privacy, tcfContext)); } @@ -117,8 +134,11 @@ public Future contextFromSetuidRequest( final Privacy privacy = privacyExtractor.validPrivacyFromSetuidRequest(httpRequest); final String ipAddress = HttpUtil.ipFrom(httpRequest); + final AccountGdprConfig accountGdpr = account.getGdpr(); + final String accountId = account.getId(); + final RequestLogInfo requestLogInfo = requestLogInfo(MetricName.setuid, null, accountId); - return tcfDefinerService.resolveTcfContext(privacy, ipAddress, account.getGdpr(), timeout) + return tcfDefinerService.resolveTcfContext(privacy, ipAddress, accountGdpr, requestLogInfo, timeout) .map(tcfContext -> PrivacyContext.of(privacy, tcfContext)); } @@ -127,11 +147,24 @@ public Future contextFromCookieSyncRequest( final Privacy privacy = privacyExtractor.validPrivacyFrom(cookieSyncRequest); final String ipAddress = HttpUtil.ipFrom(httpRequest); + final AccountGdprConfig accountGdpr = account.getGdpr(); + final String accountId = account.getId(); + final RequestLogInfo requestLogInfo = requestLogInfo(MetricName.cookiesync, null, accountId); - return tcfDefinerService.resolveTcfContext(privacy, ipAddress, account.getGdpr(), timeout) + return tcfDefinerService.resolveTcfContext(privacy, ipAddress, accountGdpr, requestLogInfo, timeout) .map(tcfContext -> PrivacyContext.of(privacy, tcfContext)); } + private static RequestLogInfo requestLogInfo(MetricName requestType, BidRequest bidRequest, String accountId) { + if (Objects.equals(requestType, MetricName.openrtb2web)) { + final Site site = bidRequest.getSite(); + final String refUrl = site != null ? site.getRef() : null; + return RequestLogInfo.of(requestType, refUrl, accountId); + } + + return RequestLogInfo.of(requestType, null, accountId); + } + Future> mask(AuctionContext auctionContext, Map bidderToUser, List bidders, @@ -159,9 +192,9 @@ Future> mask(AuctionContext auctionContext, return getBidderToEnforcementAction(privacyContext.getTcfContext(), biddersToApplyTcf, aliases, account) .map(bidderToEnforcement -> updatePrivacyMetrics( - bidderToEnforcement, aliases, requestType, device)) + bidderToEnforcement, aliases, requestType, bidderToUser, device)) .map(bidderToEnforcement -> getBidderToPrivacyResult( - biddersToApplyTcf, bidderToUser, device, bidderToEnforcement)) + bidderToEnforcement, biddersToApplyTcf, bidderToUser, device)) .map(gdprResult -> merge(ccpaResult, gdprResult)); } @@ -286,7 +319,7 @@ private Future> getBidderToEnforcementActi TcfContext tcfContext, Set bidders, BidderAliases aliases, Account account) { return tcfDefinerService.resultForBidderNames( - new HashSet<>(bidders), VendorIdResolver.of(aliases), tcfContext, account.getGdpr()) + Collections.unmodifiableSet(bidders), VendorIdResolver.of(aliases), tcfContext, account.getGdpr()) .map(tcfResponse -> mapTcfResponseToEachBidder(tcfResponse, bidders)); } @@ -311,7 +344,7 @@ private Set extractCcpaEnforcedBidders(List bidders, BidRequest return ccpaEnforcedBidders; } - private Map mapTcfResponseToEachBidder( + private static Map mapTcfResponseToEachBidder( TcfResponse tcfResponse, Set bidders) { final Map bidderNameToAction = tcfResponse.getActions(); @@ -326,39 +359,78 @@ private Map updatePrivacyMetrics( Map bidderToEnforcement, BidderAliases aliases, MetricName requestType, + Map bidderToUser, Device device) { + // Metrics should represent real picture of the bidding process, so if bidder request is blocked + // by privacy then no reason to increment another metrics, like geo masked, etc. for (final Map.Entry bidderEnforcement : bidderToEnforcement.entrySet()) { - final String bidder = aliases.resolveBidder(bidderEnforcement.getKey()); + final String bidder = bidderEnforcement.getKey(); final PrivacyEnforcementAction enforcement = bidderEnforcement.getValue(); + final boolean requestBlocked = enforcement.isBlockBidderRequest(); + + final User user = bidderToUser.get(bidder); + boolean userIdRemoved = enforcement.isRemoveUserIds(); + if (requestBlocked || (userIdRemoved && !shouldMaskUser(user))) { + userIdRemoved = false; + } + + boolean geoMasked = enforcement.isMaskGeo(); + if (requestBlocked || (geoMasked && !shouldMaskGeo(user, device))) { + geoMasked = false; + } + + final boolean analyticsBlocked = !requestBlocked && enforcement.isBlockAnalyticsReport(); + metrics.updateAuctionTcfMetrics( - bidder, + aliases.resolveBidder(bidder), requestType, - enforcement.isRemoveUserIds(), - enforcement.isMaskGeo(), - enforcement.isBlockBidderRequest(), - enforcement.isBlockAnalyticsReport()); + userIdRemoved, + geoMasked, + analyticsBlocked, + requestBlocked); } - if (isLmtEnabled(device)) { + if (lmtEnforce && isLmtEnabled(device)) { metrics.updatePrivacyLmtMetric(); } return bidderToEnforcement; } + /** + * Returns true if {@link User} has sensitive privacy information that can be masked. + */ + private static boolean shouldMaskUser(User user) { + if (user == null) { + return false; + } + if (user.getId() != null || user.getBuyeruid() != null) { + return true; + } + final ExtUser extUser = user.getExt(); + return extUser != null && (CollectionUtils.isNotEmpty(extUser.getEids())); + } + + /** + * Returns true if {@link User} or {@link Device} has {@link Geo} information that can be masked. + */ + private static boolean shouldMaskGeo(User user, Device device) { + return (user != null && user.getGeo() != null) || (device != null && device.getGeo() != null); + } + /** * Returns {@link Map}<{@link String}, {@link BidderPrivacyResult}>, where bidder name mapped to masked * {@link BidderPrivacyResult}. Masking depends on GDPR and COPPA. */ private List getBidderToPrivacyResult( + Map bidderToEnforcement, Set bidders, Map bidderToUser, - Device device, - Map bidderToEnforcement) { + Device device) { - final boolean isLmtEnabled = isLmtEnabled(device); + final boolean isLmtEnabled = lmtEnforce && isLmtEnabled(device); return bidderToUser.entrySet().stream() .filter(entry -> bidders.contains(entry.getKey())) .map(bidderUserEntry -> createBidderPrivacyResult( @@ -373,11 +445,12 @@ private List getBidderToPrivacyResult( /** * Returns {@link BidderPrivacyResult} with GDPR masking. */ - private BidderPrivacyResult createBidderPrivacyResult(User user, - Device device, - String bidder, - boolean isLmtEnabled, - Map bidderToEnforcement) { + private BidderPrivacyResult createBidderPrivacyResult( + User user, + Device device, + String bidder, + boolean isLmtEnabled, + Map bidderToEnforcement) { final PrivacyEnforcementAction privacyEnforcementAction = bidderToEnforcement.get(bidder); final boolean blockBidderRequest = privacyEnforcementAction.isBlockBidderRequest(); @@ -477,11 +550,11 @@ private static Float maskGeoCoordinate(Float coordinate) { } /** - * Returns masked digitrust and eids of user ext. + * Returns masked eids of user ext. */ - private ExtUser maskUserExt(ExtUser userExt) { + private static ExtUser maskUserExt(ExtUser userExt) { return userExt != null - ? nullIfEmpty(userExt.toBuilder().eids(null).digitrust(null).build()) + ? nullIfEmpty(userExt.toBuilder().eids(null).build()) : null; } diff --git a/src/main/java/org/prebid/server/auction/StoredRequestProcessor.java b/src/main/java/org/prebid/server/auction/StoredRequestProcessor.java index 86a74d7d218..37260870277 100644 --- a/src/main/java/org/prebid/server/auction/StoredRequestProcessor.java +++ b/src/main/java/org/prebid/server/auction/StoredRequestProcessor.java @@ -5,12 +5,14 @@ import com.iab.openrtb.request.Imp; import com.iab.openrtb.request.Video; import io.vertx.core.Future; +import io.vertx.core.file.FileSystem; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.prebid.server.exception.InvalidRequestException; import org.prebid.server.execution.Timeout; import org.prebid.server.execution.TimeoutFactory; import org.prebid.server.json.JacksonMapper; +import org.prebid.server.json.JsonMerger; import org.prebid.server.metric.Metrics; import org.prebid.server.proto.openrtb.ext.request.ExtImp; import org.prebid.server.proto.openrtb.ext.request.ExtImpPrebid; @@ -20,7 +22,6 @@ import org.prebid.server.settings.ApplicationSettings; import org.prebid.server.settings.model.StoredDataResult; import org.prebid.server.settings.model.VideoStoredDataResult; -import org.prebid.server.util.JsonMergeUtil; import java.util.ArrayList; import java.util.Collections; @@ -39,25 +40,48 @@ public class StoredRequestProcessor { private final long defaultTimeout; + private final BidRequest defaultBidRequest; private final ApplicationSettings applicationSettings; private final TimeoutFactory timeoutFactory; private final Metrics metrics; private final JacksonMapper mapper; - private JsonMergeUtil jsonMergeUtil; + private final JsonMerger jsonMerger; - public StoredRequestProcessor(long defaultTimeout, - ApplicationSettings applicationSettings, - Metrics metrics, - TimeoutFactory timeoutFactory, - JacksonMapper mapper) { + private StoredRequestProcessor(long defaultTimeout, + BidRequest defaultBidRequest, + ApplicationSettings applicationSettings, + Metrics metrics, + TimeoutFactory timeoutFactory, + JacksonMapper mapper, + JsonMerger jsonMerger) { this.defaultTimeout = defaultTimeout; - this.applicationSettings = Objects.requireNonNull(applicationSettings); - this.timeoutFactory = Objects.requireNonNull(timeoutFactory); - this.metrics = Objects.requireNonNull(metrics); - this.mapper = Objects.requireNonNull(mapper); + this.defaultBidRequest = defaultBidRequest; + this.applicationSettings = applicationSettings; + this.timeoutFactory = timeoutFactory; + this.metrics = metrics; + this.mapper = mapper; + this.jsonMerger = jsonMerger; + } - jsonMergeUtil = new JsonMergeUtil(mapper); + public static StoredRequestProcessor create(long defaultTimeout, + String defaultBidRequestPath, + FileSystem fileSystem, + ApplicationSettings applicationSettings, + Metrics metrics, + TimeoutFactory timeoutFactory, + JacksonMapper mapper, + JsonMerger jsonMerger) { + + return new StoredRequestProcessor( + defaultTimeout, + readBidRequest( + defaultBidRequestPath, Objects.requireNonNull(fileSystem), Objects.requireNonNull(mapper)), + Objects.requireNonNull(applicationSettings), + Objects.requireNonNull(metrics), + Objects.requireNonNull(timeoutFactory), + Objects.requireNonNull(mapper), + Objects.requireNonNull(jsonMerger)); } /** @@ -66,7 +90,7 @@ public StoredRequestProcessor(long defaultTimeout, * fetched jsons from source. In case any error happen during the process, returns failedFuture with * InvalidRequestException {@link InvalidRequestException} as cause. */ - Future processStoredRequests(BidRequest bidRequest) { + Future processStoredRequests(String accountId, BidRequest bidRequest) { final Map bidRequestToStoredRequestId; final Map impToStoredRequestId; try { @@ -86,30 +110,21 @@ Future processStoredRequests(BidRequest bidRequest) { } final Future storedDataFuture = - applicationSettings.getStoredData(requestIds, impIds, timeout(bidRequest)) + applicationSettings.getStoredData(accountId, requestIds, impIds, timeout(bidRequest)) .compose(storedDataResult -> updateMetrics(storedDataResult, requestIds, impIds)); - return storedRequestsToBidRequest(storedDataFuture, bidRequest, - bidRequestToStoredRequestId.get(bidRequest), impToStoredRequestId); - } - - private Future updateMetrics(StoredDataResult storedDataResult, Set requestIds, - Set impIds) { - requestIds.forEach( - id -> metrics.updateStoredRequestMetric(storedDataResult.getStoredIdToRequest().containsKey(id))); - impIds.forEach(id -> metrics.updateStoredImpsMetric(storedDataResult.getStoredIdToImp().containsKey(id))); - - return Future.succeededFuture(storedDataResult); + return storedRequestsToBidRequest( + storedDataFuture, bidRequest, bidRequestToStoredRequestId.get(bidRequest), impToStoredRequestId); } /** * Fetches AMP request from the source. */ - Future processAmpRequest(String ampRequestId) { - final BidRequest bidRequest = BidRequest.builder().build(); + Future processAmpRequest(String accountId, String ampRequestId) { + final BidRequest bidRequest = defaultBidRequest != null ? defaultBidRequest : BidRequest.builder().build(); final Future ampStoredDataFuture = applicationSettings.getAmpStoredData( - Collections.singleton(ampRequestId), Collections.emptySet(), timeout(bidRequest)) + accountId, Collections.singleton(ampRequestId), Collections.emptySet(), timeout(bidRequest)) .compose(storedDataResult -> updateMetrics( storedDataResult, Collections.singleton(ampRequestId), Collections.emptySet())); @@ -119,20 +134,39 @@ Future processAmpRequest(String ampRequestId) { /** * Fetches stored request.video and map existing values to imp.id. */ - Future videoStoredDataResult(List imps, List errors, Timeout timeout) { + Future videoStoredDataResult(String accountId, List imps, List errors, + Timeout timeout) { final Map storedIdToImpId = mapStoredRequestHolderToStoredRequestId(imps, this::getStoredRequestFromImp) .entrySet().stream() .collect(Collectors.toMap(Map.Entry::getValue, impIdToStoredId -> impIdToStoredId.getKey().getId())); - return applicationSettings.getStoredData(Collections.emptySet(), storedIdToImpId.keySet(), timeout) + return applicationSettings.getStoredData(accountId, Collections.emptySet(), storedIdToImpId.keySet(), timeout) .map(storedDataResult -> makeVideoStoredDataResult(storedDataResult, storedIdToImpId, errors)); } + private Future updateMetrics(StoredDataResult storedDataResult, Set requestIds, + Set impIds) { + requestIds.forEach( + id -> metrics.updateStoredRequestMetric(storedDataResult.getStoredIdToRequest().containsKey(id))); + impIds.forEach(id -> metrics.updateStoredImpsMetric(storedDataResult.getStoredIdToImp().containsKey(id))); + + return Future.succeededFuture(storedDataResult); + } + + private static BidRequest readBidRequest( + String defaultBidRequestPath, FileSystem fileSystem, JacksonMapper mapper) { + + return StringUtils.isNotBlank(defaultBidRequestPath) + ? mapper.decodeValue(fileSystem.readFileBlocking(defaultBidRequestPath), BidRequest.class) + : null; + } + private VideoStoredDataResult makeVideoStoredDataResult(StoredDataResult storedDataResult, Map storedIdToImpId, List errors) { + final Map storedIdToStoredImp = storedDataResult.getStoredIdToImp(); final Map impIdToStoredVideo = new HashMap<>(); @@ -170,8 +204,10 @@ private Video parseVideoFromImp(String storedJson) { } private Future storedRequestsToBidRequest(Future storedDataFuture, - BidRequest bidRequest, String storedBidRequestId, + BidRequest bidRequest, + String storedBidRequestId, Map impsToStoredRequestId) { + return storedDataFuture .recover(exception -> Future.failedFuture(new InvalidRequestException( String.format("Stored request fetching failed: %s", exception.getMessage())))) @@ -185,21 +221,31 @@ private Future storedRequestsToBidRequest(Future s /** * Runs {@link BidRequest} and {@link Imp}s merge processes. */ - private BidRequest mergeBidRequestAndImps(BidRequest bidRequest, String storedRequestId, - Map impToStoredId, StoredDataResult storedDataResult) { - return mergeBidRequestImps(mergeBidRequest(bidRequest, storedRequestId, storedDataResult), - impToStoredId, storedDataResult); + private BidRequest mergeBidRequestAndImps(BidRequest bidRequest, + String storedRequestId, + Map impToStoredId, + StoredDataResult storedDataResult) { + + return mergeBidRequestImps( + mergeBidRequest(mergeDefaultRequest(bidRequest), storedRequestId, storedDataResult), + impToStoredId, + storedDataResult); + } + + private BidRequest mergeDefaultRequest(BidRequest bidRequest) { + return jsonMerger.merge(bidRequest, defaultBidRequest, BidRequest.class); } /** * Merges original request with request from stored request source. Values from original request * has higher priority than stored request values. */ - private BidRequest mergeBidRequest(BidRequest originalRequest, String storedRequestId, - StoredDataResult storedDataResult) { + private BidRequest mergeBidRequest( + BidRequest originalRequest, String storedRequestId, StoredDataResult storedDataResult) { + final String storedRequest = storedDataResult.getStoredIdToRequest().get(storedRequestId); return StringUtils.isNotBlank(storedRequestId) - ? jsonMergeUtil.merge(originalRequest, storedRequest, storedRequestId, BidRequest.class) + ? jsonMerger.merge(originalRequest, storedRequest, storedRequestId, BidRequest.class) : originalRequest; } @@ -207,8 +253,9 @@ private BidRequest mergeBidRequest(BidRequest originalRequest, String storedRequ * Merges {@link Imp}s from original request with Imps from stored request source. Values from original request * has higher priority than stored request values. */ - private BidRequest mergeBidRequestImps(BidRequest bidRequest, Map impToStoredId, - StoredDataResult storedDataResult) { + private BidRequest mergeBidRequestImps( + BidRequest bidRequest, Map impToStoredId, StoredDataResult storedDataResult) { + if (impToStoredId.isEmpty()) { return bidRequest; } @@ -218,7 +265,7 @@ private BidRequest mergeBidRequestImps(BidRequest bidRequest, Map i final String storedRequestId = impToStoredId.get(imp); if (storedRequestId != null) { final String storedImp = storedDataResult.getStoredIdToImp().get(storedRequestId); - final Imp mergedImp = jsonMergeUtil.merge(imp, storedImp, storedRequestId, Imp.class); + final Imp mergedImp = jsonMerger.merge(imp, storedImp, storedRequestId, Imp.class); mergedImps.set(i, mergedImp); } } @@ -226,10 +273,10 @@ private BidRequest mergeBidRequestImps(BidRequest bidRequest, Map i } /** - * Maps object to its StoredRequestId if exists. If object's extension contains storedRequest field, expected that - * it includes id too, in another case error about missed id in stored request will be added to error list. - * Gathers all errors into list, and in case if it is not empty, throws {@link InvalidRequestException} with - * list of errors. + * Maps object to its StoredRequestId if exists. If object's extension contains storedRequest field, expected + * that it includes id too, in another case error about missed id in stored request will be added to error list. + * Gathers all errors into list, and in case if it is not empty, throws {@link InvalidRequestException} with list + * of errors. */ private Map mapStoredRequestHolderToStoredRequestId( List storedRequestHolders, Function storedRequestExtractor) { diff --git a/src/main/java/org/prebid/server/auction/TargetingKeywordsCreator.java b/src/main/java/org/prebid/server/auction/TargetingKeywordsCreator.java index 8ea9ea42d92..1ddc9b9221a 100644 --- a/src/main/java/org/prebid/server/auction/TargetingKeywordsCreator.java +++ b/src/main/java/org/prebid/server/auction/TargetingKeywordsCreator.java @@ -6,6 +6,7 @@ import org.prebid.server.exception.PreBidException; import org.prebid.server.proto.openrtb.ext.request.ExtPriceGranularity; import org.prebid.server.proto.response.Bid; +import org.prebid.server.proto.response.MediaType; import java.math.BigDecimal; import java.util.ArrayList; @@ -76,9 +77,15 @@ public class TargetingKeywordsCreator { */ private static final String HB_CACHE_PATH_KEY = "hb_cache_path"; + /** + * Stores bid's format. For example "video" or "banner". + */ + private static final String HB_FORMAT_KEY = "hb_format"; + private final PriceGranularity priceGranularity; private final boolean includeWinners; private final boolean includeBidderKeys; + private final boolean includeFormat; private final boolean isApp; private final int truncateAttrChars; private final String cacheHost; @@ -88,6 +95,7 @@ public class TargetingKeywordsCreator { private TargetingKeywordsCreator(PriceGranularity priceGranularity, boolean includeWinners, boolean includeBidderKeys, + boolean includeFormat, boolean isApp, int truncateAttrChars, String cacheHost, @@ -97,6 +105,7 @@ private TargetingKeywordsCreator(PriceGranularity priceGranularity, this.priceGranularity = priceGranularity; this.includeWinners = includeWinners; this.includeBidderKeys = includeBidderKeys; + this.includeFormat = includeFormat; this.isApp = isApp; this.truncateAttrChars = truncateAttrChars; this.cacheHost = cacheHost; @@ -110,6 +119,7 @@ private TargetingKeywordsCreator(PriceGranularity priceGranularity, public static TargetingKeywordsCreator create(ExtPriceGranularity extPriceGranularity, boolean includeWinners, boolean includeBidderKeys, + boolean includeFormat, boolean isApp, int truncateAttrChars, String cacheHost, @@ -120,6 +130,7 @@ public static TargetingKeywordsCreator create(ExtPriceGranularity extPriceGranul PriceGranularity.createFromExtPriceGranularity(extPriceGranularity), includeWinners, includeBidderKeys, + includeFormat, isApp, truncateAttrChars, cacheHost, @@ -133,6 +144,7 @@ public static TargetingKeywordsCreator create(ExtPriceGranularity extPriceGranul public static TargetingKeywordsCreator create(String stringPriceGranularity, boolean includeWinners, boolean includeBidderKeys, + boolean includeFormat, boolean isApp, int truncateAttrChars) { @@ -140,6 +152,7 @@ public static TargetingKeywordsCreator create(String stringPriceGranularity, convertToCustomPriceGranularity(stringPriceGranularity), includeWinners, includeBidderKeys, + includeFormat, isApp, truncateAttrChars, null, @@ -169,6 +182,7 @@ private static PriceGranularity convertToCustomPriceGranularity(String stringPri * Creates map of keywords for the given {@link Bid}. */ public Map makeFor(Bid bid, boolean winningBid) { + final MediaType mediaType = bid.getMediaType(); return truncateKeys(makeFor( bid.getBidder(), winningBid, @@ -178,6 +192,7 @@ public Map makeFor(Bid bid, boolean winningBid) { bid.getHeight(), bid.getCacheId(), null, + mediaType != null ? mediaType.name() : null, bid.getDealId())); } @@ -188,6 +203,7 @@ Map makeFor(com.iab.openrtb.response.Bid bid, String bidder, boolean winningBid, String cacheId, + String format, String vastCacheId) { final Map keywords = makeFor( @@ -199,6 +215,7 @@ Map makeFor(com.iab.openrtb.response.Bid bid, bid.getH(), cacheId, vastCacheId, + format, bid.getDealid()); if (resolver == null) { @@ -222,6 +239,7 @@ private Map makeFor(String bidder, Integer height, String cacheId, String vastCacheId, + String format, String dealId) { final KeywordMap keywordMap = new KeywordMap(bidder, winningBid, includeWinners, includeBidderKeys, @@ -247,6 +265,9 @@ private Map makeFor(String bidder, keywordMap.put(HB_CACHE_HOST_KEY, cacheHost); keywordMap.put(HB_CACHE_PATH_KEY, cachePath); } + if (StringUtils.isNotBlank(format) && includeFormat) { + keywordMap.put(HB_FORMAT_KEY, format); + } if (StringUtils.isNotBlank(dealId)) { keywordMap.put(HB_DEAL_KEY, dealId); } diff --git a/src/main/java/org/prebid/server/auction/VideoRequestFactory.java b/src/main/java/org/prebid/server/auction/VideoRequestFactory.java index 9970725e58a..556eedcb9c8 100644 --- a/src/main/java/org/prebid/server/auction/VideoRequestFactory.java +++ b/src/main/java/org/prebid/server/auction/VideoRequestFactory.java @@ -1,7 +1,10 @@ package org.prebid.server.auction; +import com.iab.openrtb.request.App; import com.iab.openrtb.request.BidRequest; import com.iab.openrtb.request.Device; +import com.iab.openrtb.request.Publisher; +import com.iab.openrtb.request.Site; import com.iab.openrtb.request.video.BidRequestVideo; import com.iab.openrtb.request.video.Pod; import com.iab.openrtb.request.video.PodError; @@ -10,6 +13,7 @@ import io.vertx.core.buffer.Buffer; import io.vertx.ext.web.RoutingContext; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.prebid.server.auction.model.AuctionContext; import org.prebid.server.auction.model.WithPodErrors; @@ -17,6 +21,8 @@ import org.prebid.server.json.DecodeException; import org.prebid.server.json.JacksonMapper; import org.prebid.server.metric.MetricName; +import org.prebid.server.proto.openrtb.ext.request.ExtPublisher; +import org.prebid.server.proto.openrtb.ext.request.ExtPublisherPrebid; import org.prebid.server.util.HttpUtil; import java.util.ArrayList; @@ -36,10 +42,13 @@ public class VideoRequestFactory { private final TimeoutResolver timeoutResolver; private final JacksonMapper mapper; - public VideoRequestFactory(int maxRequestSize, boolean enforceStoredRequest, + public VideoRequestFactory(int maxRequestSize, + boolean enforceStoredRequest, VideoStoredRequestProcessor storedRequestProcessor, - AuctionRequestFactory auctionRequestFactory, TimeoutResolver timeoutResolver, + AuctionRequestFactory auctionRequestFactory, + TimeoutResolver timeoutResolver, JacksonMapper mapper) { + this.enforceStoredRequest = enforceStoredRequest; this.maxRequestSize = maxRequestSize; this.storedRequestProcessor = Objects.requireNonNull(storedRequestProcessor); @@ -77,6 +86,38 @@ public Future> fromRequest(RoutingContext routingC .map(auctionContext -> WithPodErrors.of(auctionContext, bidRequestToPodError.getPodErrors()))); } + /** + * Extracts publisher id either from {@link BidRequestVideo}.app.publisher + * or {@link BidRequestVideo}.site.publisher. If neither is present returns empty string. + */ + private String accountIdFrom(BidRequestVideo bidRequestVideo) { + final App app = bidRequestVideo.getApp(); + final Publisher appPublisher = app != null ? app.getPublisher() : null; + final Site site = bidRequestVideo.getSite(); + final Publisher sitePublisher = site != null ? site.getPublisher() : null; + + final Publisher publisher = ObjectUtils.defaultIfNull(appPublisher, sitePublisher); + final String publisherId = publisher != null ? resolvePublisherId(publisher) : null; + return ObjectUtils.defaultIfNull(publisherId, StringUtils.EMPTY); + } + + /** + * Resolves what value should be used as a publisher id - either taken from publisher.ext.parentAccount + * or publisher.id in this respective priority. + */ + private String resolvePublisherId(Publisher publisher) { + final String parentAccountId = parentAccountIdFromExtPublisher(publisher.getExt()); + return ObjectUtils.defaultIfNull(parentAccountId, publisher.getId()); + } + + /** + * Parses publisher.ext and returns parentAccount value from it. Returns null if any parsing error occurs. + */ + private String parentAccountIdFromExtPublisher(ExtPublisher extPublisher) { + final ExtPublisherPrebid extPublisherPrebid = extPublisher != null ? extPublisher.getPrebid() : null; + return extPublisherPrebid != null ? StringUtils.stripToNull(extPublisherPrebid.getParentAccount()) : null; + } + /** * Parses request body to {@link BidRequestVideo}. *

@@ -137,7 +178,9 @@ private Future> createBidRequest(RoutingContext routin BidRequestVideo bidRequestVideo, String storedVideoId, Set podConfigIds) { - return storedRequestProcessor.processVideoRequest(storedVideoId, podConfigIds, bidRequestVideo) + + return storedRequestProcessor.processVideoRequest( + accountIdFrom(bidRequestVideo), storedVideoId, podConfigIds, bidRequestVideo) .map(bidRequestToErrors -> fillImplicitParameters(routingContext, bidRequestToErrors)) .map(this::validateRequest); } diff --git a/src/main/java/org/prebid/server/auction/VideoResponseFactory.java b/src/main/java/org/prebid/server/auction/VideoResponseFactory.java index 2a9083d2385..752b632c2a1 100644 --- a/src/main/java/org/prebid/server/auction/VideoResponseFactory.java +++ b/src/main/java/org/prebid/server/auction/VideoResponseFactory.java @@ -88,7 +88,7 @@ private List adPodsWithTargetingFrom(List bids) { final List adPods = new ArrayList<>(); for (Bid bid : bids) { final Map targeting = targeting(bid); - if (targeting.get("hb_uuid") == null) { + if (findByPrefix(targeting, "hb_uuid") == null) { continue; } final String impId = bid.getImpid(); @@ -99,9 +99,9 @@ private List adPodsWithTargetingFrom(List bids) { final Integer podId = Integer.parseInt(podIdString); final ExtResponseVideoTargeting videoTargeting = ExtResponseVideoTargeting.of( - targeting.get("hb_pb"), - targeting.get("hb_pb_cat_dur"), - targeting.get("hb_uuid")); + findByPrefix(targeting, "hb_pb"), + findByPrefix(targeting, "hb_pb_cat_dur"), + findByPrefix(targeting, "hb_uuid")); ExtAdPod adPod = adPods.stream() .filter(extAdPod -> extAdPod.getPodid().equals(podId)) @@ -130,6 +130,14 @@ private Map targeting(Bid bid) { return targeting != null ? targeting : Collections.emptyMap(); } + private static String findByPrefix(Map keyToValue, String prefix) { + return keyToValue.entrySet().stream() + .filter(keyAndValue -> keyAndValue.getKey().startsWith(prefix)) + .map(Map.Entry::getValue) + .findFirst() + .orElse(null); + } + private static List adPodsWithErrors(List podErrors) { return podErrors.stream() .map(podError -> ExtAdPod.of(podError.getPodId(), null, podError.getPodErrors())) diff --git a/src/main/java/org/prebid/server/auction/VideoStoredRequestProcessor.java b/src/main/java/org/prebid/server/auction/VideoStoredRequestProcessor.java index 1a82530aa56..65f95ba330f 100644 --- a/src/main/java/org/prebid/server/auction/VideoStoredRequestProcessor.java +++ b/src/main/java/org/prebid/server/auction/VideoStoredRequestProcessor.java @@ -16,6 +16,7 @@ import com.iab.openrtb.request.video.PodError; import com.iab.openrtb.request.video.Podconfig; import io.vertx.core.Future; +import io.vertx.core.file.FileSystem; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; import org.apache.commons.collections4.CollectionUtils; @@ -27,6 +28,7 @@ import org.prebid.server.exception.InvalidRequestException; import org.prebid.server.execution.TimeoutFactory; import org.prebid.server.json.JacksonMapper; +import org.prebid.server.json.JsonMerger; import org.prebid.server.metric.Metrics; import org.prebid.server.proto.openrtb.ext.ExtIncludeBrandCategory; import org.prebid.server.proto.openrtb.ext.request.ExtRequest; @@ -36,13 +38,11 @@ import org.prebid.server.proto.openrtb.ext.request.ExtRequestTargeting; import org.prebid.server.settings.ApplicationSettings; import org.prebid.server.settings.model.StoredDataResult; -import org.prebid.server.util.JsonMergeUtil; import org.prebid.server.validation.VideoRequestValidator; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -59,55 +59,102 @@ public class VideoStoredRequestProcessor { private static final String DEFAULT_CURRENCY = "USD"; private static final String DEFAULT_BUYERUID = "appnexus"; - private final ApplicationSettings applicationSettings; - private final VideoRequestValidator validator; private final boolean enforceStoredRequest; private final List blacklistedAccounts; + private final long defaultTimeout; + private final String currency; private final BidRequest defaultBidRequest; + private final ApplicationSettings applicationSettings; + private final VideoRequestValidator validator; private final Metrics metrics; private final TimeoutResolver timeoutResolver; private final TimeoutFactory timeoutFactory; - private final long defaultTimeout; - private final String currency; private final JacksonMapper mapper; - private JsonMergeUtil jsonMergeUtil; - - public VideoStoredRequestProcessor(ApplicationSettings applicationSettings, VideoRequestValidator validator, - boolean enforceStoredRequest, List blacklistedAccounts, - BidRequest defaultBidRequest, Metrics metrics, TimeoutFactory timeoutFactory, - TimeoutResolver timeoutResolver, long defaultTimeout, String adServerCurrency, - JacksonMapper mapper) { - this.applicationSettings = Objects.requireNonNull(applicationSettings); - this.validator = Objects.requireNonNull(validator); + private final JsonMerger jsonMerger; + + private VideoStoredRequestProcessor(boolean enforceStoredRequest, + List blacklistedAccounts, + long defaultTimeout, + String adServerCurrency, + BidRequest defaultBidRequest, + ApplicationSettings applicationSettings, + VideoRequestValidator validator, + Metrics metrics, + TimeoutFactory timeoutFactory, + TimeoutResolver timeoutResolver, + JacksonMapper mapper, + JsonMerger jsonMerger) { + this.enforceStoredRequest = enforceStoredRequest; this.blacklistedAccounts = blacklistedAccounts; - this.defaultBidRequest = Objects.requireNonNull(defaultBidRequest); - this.timeoutFactory = Objects.requireNonNull(timeoutFactory); - this.timeoutResolver = Objects.requireNonNull(timeoutResolver); - this.metrics = Objects.requireNonNull(metrics); this.defaultTimeout = defaultTimeout; this.currency = StringUtils.isBlank(adServerCurrency) ? DEFAULT_CURRENCY : adServerCurrency; - this.mapper = Objects.requireNonNull(mapper); + this.defaultBidRequest = defaultBidRequest; + this.applicationSettings = applicationSettings; + this.validator = validator; + this.metrics = metrics; + this.timeoutFactory = timeoutFactory; + this.timeoutResolver = timeoutResolver; + this.mapper = mapper; + this.jsonMerger = jsonMerger; + } - jsonMergeUtil = new JsonMergeUtil(mapper); + public static VideoStoredRequestProcessor create(boolean enforceStoredRequest, + List blacklistedAccounts, + long defaultTimeout, + String adServerCurrency, + String defaultBidRequestPath, + FileSystem fileSystem, + ApplicationSettings applicationSettings, + VideoRequestValidator validator, + Metrics metrics, + TimeoutFactory timeoutFactory, + TimeoutResolver timeoutResolver, + JacksonMapper mapper, + JsonMerger jsonMerger) { + + return new VideoStoredRequestProcessor( + enforceStoredRequest, + Objects.requireNonNull(blacklistedAccounts), + defaultTimeout, + adServerCurrency, + readBidRequest( + defaultBidRequestPath, Objects.requireNonNull(fileSystem), Objects.requireNonNull(mapper)), + Objects.requireNonNull(applicationSettings), + Objects.requireNonNull(validator), + Objects.requireNonNull(metrics), + Objects.requireNonNull(timeoutFactory), + Objects.requireNonNull(timeoutResolver), + Objects.requireNonNull(mapper), + Objects.requireNonNull(jsonMerger)); } /** * Fetches ParsedStoredDataResult<BidRequestVideo, Imp> from stored request. */ - Future> processVideoRequest(String storedBidRequestId, Set podIds, + Future> processVideoRequest(String accountId, String storedBidRequestId, + Set podIds, BidRequestVideo receivedRequest) { - final Set storedRequestIds = new HashSet<>(); - if (StringUtils.isNotBlank(storedBidRequestId)) { - storedRequestIds.add(storedBidRequestId); - } - return applicationSettings.getVideoStoredData(storedRequestIds, podIds, timeoutFactory.create(defaultTimeout)) + final Set storedRequestIds = StringUtils.isNotBlank(storedBidRequestId) + ? Collections.singleton(storedBidRequestId) + : Collections.emptySet(); + + return applicationSettings.getVideoStoredData(accountId, storedRequestIds, podIds, + timeoutFactory.create(defaultTimeout)) .compose(storedDataResult -> updateMetrics(storedDataResult, storedRequestIds, podIds)) .map(storedData -> mergeToBidRequest(storedData, receivedRequest, storedBidRequestId)) .recover(exception -> Future.failedFuture(new InvalidRequestException( String.format("Stored request fetching failed: %s", exception.getMessage())))); } + private static BidRequest readBidRequest( + String defaultBidRequestPath, FileSystem fileSystem, JacksonMapper mapper) { + + return StringUtils.isNotBlank(defaultBidRequestPath) + ? mapper.decodeValue(fileSystem.readFileBlocking(defaultBidRequestPath), BidRequest.class) + : null; + } + private Future updateMetrics(StoredDataResult storedDataResult, Set requestIds, Set impIds) { requestIds.forEach( @@ -142,7 +189,7 @@ private BidRequestVideo mergeBidRequest(BidRequestVideo originalRequest, String } return StringUtils.isNotBlank(storedRequest) - ? jsonMergeUtil.merge(originalRequest, storedRequest, storedRequestId, BidRequestVideo.class) + ? jsonMerger.merge(originalRequest, storedRequest, storedRequestId, BidRequestVideo.class) : originalRequest; } @@ -248,7 +295,9 @@ private static Video updateVideo(Video video, Integer maxDuration, Integer minDu } private BidRequest mergeWithDefaultBidRequest(BidRequestVideo validatedVideoRequest, List imps) { - final BidRequest.BidRequestBuilder bidRequestBuilder = defaultBidRequest.toBuilder(); + final BidRequest.BidRequestBuilder bidRequestBuilder = + defaultBidRequest != null ? defaultBidRequest.toBuilder() : BidRequest.builder(); + final Site site = validatedVideoRequest.getSite(); if (site != null) { final Site.SiteBuilder siteBuilder = site.toBuilder(); diff --git a/src/main/java/org/prebid/server/auction/model/AuctionContext.java b/src/main/java/org/prebid/server/auction/model/AuctionContext.java index 1870839a7a5..6e72ea05484 100644 --- a/src/main/java/org/prebid/server/auction/model/AuctionContext.java +++ b/src/main/java/org/prebid/server/auction/model/AuctionContext.java @@ -1,6 +1,5 @@ package org.prebid.server.auction.model; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.iab.openrtb.request.BidRequest; import io.vertx.ext.web.RoutingContext; import lombok.Builder; @@ -20,15 +19,12 @@ @Value public class AuctionContext { - @JsonIgnore RoutingContext routingContext; - @JsonIgnore UidsCookie uidsCookie; BidRequest bidRequest; - @JsonIgnore Timeout timeout; Account account; diff --git a/src/main/java/org/prebid/server/bidder/Bidder.java b/src/main/java/org/prebid/server/bidder/Bidder.java index 51acd8c1b2d..089fa2f19d3 100644 --- a/src/main/java/org/prebid/server/bidder/Bidder.java +++ b/src/main/java/org/prebid/server/bidder/Bidder.java @@ -7,6 +7,7 @@ import org.prebid.server.bidder.model.HttpRequest; import org.prebid.server.bidder.model.Result; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -34,5 +35,19 @@ public interface Bidder { /** * Extracts targeting from bidder-specific extension. It is safe to assume that {@code ext} is not null. */ - Map extractTargeting(ObjectNode ext); + default Map extractTargeting(ObjectNode ext) { + return Collections.emptyMap(); + } + + /** + * This method is much the same as {@link #makeHttpRequests}, except it is fed the bidder request + * that timed out, and expects that only one notification "request" will be generated. A use case for multiple + * timeout notifications has not been anticipated. + *

+ * Do note that if {@link #makeHttpRequests} returns multiple requests, and more than one of these times out, + * this method will be called once for each timed out request. + */ + default HttpRequest makeTimeoutNotification(HttpRequest httpRequest) { + return null; + } } diff --git a/src/main/java/org/prebid/server/bidder/BidderErrorNotifier.java b/src/main/java/org/prebid/server/bidder/BidderErrorNotifier.java new file mode 100644 index 00000000000..57f4330db92 --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/BidderErrorNotifier.java @@ -0,0 +1,93 @@ +package org.prebid.server.bidder; + +import io.vertx.core.logging.Logger; +import io.vertx.core.logging.LoggerFactory; +import org.prebid.server.bidder.model.BidderError; +import org.prebid.server.bidder.model.HttpCall; +import org.prebid.server.bidder.model.HttpRequest; +import org.prebid.server.log.ConditionalLogger; +import org.prebid.server.metric.Metrics; +import org.prebid.server.vertx.http.HttpClient; +import org.prebid.server.vertx.http.model.HttpClientResponse; + +import java.util.Objects; + +public class BidderErrorNotifier { + + private static final Logger logger = LoggerFactory.getLogger(BidderErrorNotifier.class); + private static final ConditionalLogger conditionalLogger = new ConditionalLogger(logger); + + private final int timeoutNotificationTimeoutMs; + private final boolean logTimeoutNotificationResult; + private final boolean logTimeoutNotificationFailureOnly; + private final double logTimeoutNotificationSamplingRate; + private final HttpClient httpClient; + private final Metrics metrics; + + public BidderErrorNotifier(int timeoutNotificationTimeoutMs, + boolean logTimeoutNotificationResult, + boolean logTimeoutNotificationFailureOnly, + double logTimeoutNotificationSamplingRate, + HttpClient httpClient, + Metrics metrics) { + + this.timeoutNotificationTimeoutMs = timeoutNotificationTimeoutMs; + this.logTimeoutNotificationResult = logTimeoutNotificationResult; + this.logTimeoutNotificationFailureOnly = logTimeoutNotificationFailureOnly; + this.logTimeoutNotificationSamplingRate = logTimeoutNotificationSamplingRate; + this.httpClient = Objects.requireNonNull(httpClient); + this.metrics = Objects.requireNonNull(metrics); + } + + public HttpCall processTimeout(HttpCall httpCall, Bidder bidder) { + final BidderError error = httpCall.getError(); + + if (error != null && error.getType() == BidderError.Type.timeout) { + final HttpRequest timeoutNotification = bidder.makeTimeoutNotification(httpCall.getRequest()); + if (timeoutNotification != null) { + httpClient.request( + timeoutNotification.getMethod(), + timeoutNotification.getUri(), + timeoutNotification.getHeaders(), + timeoutNotification.getBody(), + timeoutNotificationTimeoutMs) + .map(response -> handleTimeoutNotificationSuccess(response, timeoutNotification)) + .otherwise(exception -> handleTimeoutNotificationFailure(exception, timeoutNotification)); + } + } + + return httpCall; + } + + private Void handleTimeoutNotificationSuccess(HttpClientResponse response, HttpRequest timeoutNotification) { + final boolean isSuccessful = response.getStatusCode() >= 200 && response.getStatusCode() < 300; + + metrics.updateTimeoutNotificationMetric(isSuccessful); + + if (logTimeoutNotificationResult && !(logTimeoutNotificationFailureOnly && isSuccessful)) { + conditionalLogger.warn( + String.format( + "Notified bidder about timeout. Status code: %s. Request body: %s", + response.getStatusCode(), + timeoutNotification.getBody()), + logTimeoutNotificationSamplingRate); + } + + return null; + } + + private Void handleTimeoutNotificationFailure(Throwable exception, HttpRequest timeoutNotification) { + metrics.updateTimeoutNotificationMetric(false); + + if (logTimeoutNotificationResult) { + conditionalLogger.warn( + String.format( + "Error occurred while notifying bidder about timeout. Error message: %s. Request body: %s", + exception.getMessage(), + timeoutNotification.getBody()), + logTimeoutNotificationSamplingRate); + } + + return null; + } +} diff --git a/src/main/java/org/prebid/server/bidder/DisabledBidder.java b/src/main/java/org/prebid/server/bidder/DisabledBidder.java index 1719bcb1669..dda95ee859e 100644 --- a/src/main/java/org/prebid/server/bidder/DisabledBidder.java +++ b/src/main/java/org/prebid/server/bidder/DisabledBidder.java @@ -8,7 +8,6 @@ import org.prebid.server.bidder.model.HttpRequest; import org.prebid.server.bidder.model.Result; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; @@ -26,7 +25,7 @@ public DisabledBidder(String errorMessage) { @Override public Result>> makeHttpRequests(BidRequest request) { - return Result.of(Collections.emptyList(), Collections.singletonList(BidderError.badInput(errorMessage))); + return Result.withError(BidderError.badInput(errorMessage)); } @Override diff --git a/src/main/java/org/prebid/server/bidder/HttpAdapterConnector.java b/src/main/java/org/prebid/server/bidder/HttpAdapterConnector.java index ca97442d900..c4b38892f0a 100644 --- a/src/main/java/org/prebid/server/bidder/HttpAdapterConnector.java +++ b/src/main/java/org/prebid/server/bidder/HttpAdapterConnector.java @@ -256,16 +256,16 @@ private static Result> bidsWithError(Adapter adapter, Ada ExchangeCall exchangeCall, Integer responseTime) { final BidderError error = exchangeCall.getError(); if (error != null) { - return Result.emptyWithError(error); + return Result.withError(error); } try { final List bids = adapter.extractBids(adapterRequest, exchangeCall).stream() .map(bidBuilder -> bidBuilder.responseTimeMs(responseTime)) .map(Bid.BidBuilder::build) .collect(Collectors.toList()); - return Result.of(bids, Collections.emptyList()); + return Result.withValues(bids); } catch (PreBidException e) { - return Result.emptyWithError(BidderError.badServerResponse(e.getMessage())); + return Result.withError(BidderError.badServerResponse(e.getMessage())); } } diff --git a/src/main/java/org/prebid/server/bidder/HttpBidderRequester.java b/src/main/java/org/prebid/server/bidder/HttpBidderRequester.java index 095f9a23a82..3bf117fb2bc 100644 --- a/src/main/java/org/prebid/server/bidder/HttpBidderRequester.java +++ b/src/main/java/org/prebid/server/bidder/HttpBidderRequester.java @@ -44,16 +44,17 @@ public class HttpBidderRequester { private static final Logger logger = LoggerFactory.getLogger(HttpBidderRequester.class); - private static final int NOTIFICATION_TIMEOUT_MS = 200; - private final HttpClient httpClient; private final BidderRequestCompletionTrackerFactory completionTrackerFactory; + private final BidderErrorNotifier bidderErrorNotifier; public HttpBidderRequester(HttpClient httpClient, - BidderRequestCompletionTrackerFactory completionTrackerFactory) { + BidderRequestCompletionTrackerFactory completionTrackerFactory, + BidderErrorNotifier bidderErrorNotifier) { this.httpClient = Objects.requireNonNull(httpClient); this.completionTrackerFactory = completionTrackerFactoryOrFallback(completionTrackerFactory); + this.bidderErrorNotifier = Objects.requireNonNull(bidderErrorNotifier); } /** @@ -76,8 +77,9 @@ public Future requestBids( final ResultBuilder resultBuilder = new ResultBuilder<>(httpRequests, bidderErrors, completionTracker); final List> httpRequestFutures = httpRequests.stream() - .map(httpRequest -> doRequest(httpRequest, timeout, bidder)) + .map(httpRequest -> doRequest(httpRequest, timeout)) .map(httpCallFuture -> httpCallFuture + .map(httpCall -> bidderErrorNotifier.processTimeout(httpCall, bidder)) .map(httpCall -> processHttpCall(bidder, bidRequest, resultBuilder, httpCall))) .collect(Collectors.toList()); @@ -105,7 +107,7 @@ private Future emptyBidderSeatBidWithErrors(List bid /** * Makes an HTTP request and returns {@link Future} that will be eventually completed with success or error result. */ - private Future> doRequest(HttpRequest httpRequest, Timeout timeout, Bidder bidder) { + private Future> doRequest(HttpRequest httpRequest, Timeout timeout) { final long remainingTimeout = timeout.remaining(); if (remainingTimeout <= 0) { return failResponse(new TimeoutException("Timeout has been exceeded"), httpRequest); @@ -114,8 +116,7 @@ private Future> doRequest(HttpRequest httpRequest, Timeout ti return httpClient.request(httpRequest.getMethod(), httpRequest.getUri(), httpRequest.getHeaders(), httpRequest.getBody(), remainingTimeout) .compose(response -> processResponse(response, httpRequest)) - .recover(exception -> failResponse(exception, httpRequest)) - .map(httpCall -> notifyTimeoutBidder(bidder, httpCall)); + .recover(exception -> failResponse(exception, httpRequest)); } /** @@ -135,30 +136,6 @@ private static Future> failResponse(Throwable exception, HttpReq HttpCall.failure(httpRequest, BidderError.create(exception.getMessage(), errorType))); } - /** - * Calls when bidder's exchange responds with timeout and sends notification if bidder supports it. - */ - private HttpCall notifyTimeoutBidder(Bidder bidder, HttpCall httpCall) { - final BidderError bidderError = httpCall.getError(); - final BidderError.Type errorType = bidderError != null ? bidderError.getType() : null; - - if (errorType == BidderError.Type.timeout && bidder instanceof TimeoutBidder) { - final TimeoutBidder timeoutBidder = (TimeoutBidder) bidder; - final HttpRequest timeoutNotification = timeoutBidder.makeTimeoutNotification(httpCall.getRequest()); - - if (timeoutNotification != null) { - httpClient.request( - timeoutNotification.getMethod(), - timeoutNotification.getUri(), - timeoutNotification.getHeaders(), - timeoutNotification.getBody(), - NOTIFICATION_TIMEOUT_MS); - } - } - - return httpCall; - } - /** * Produces {@link Future} with {@link HttpCall} containing request, response and possible error description * (if status code indicates an error). @@ -193,18 +170,25 @@ private Void processHttpCall(Bidder bidder, } private static Result> makeBids(Bidder bidder, HttpCall httpCall, BidRequest bidRequest) { - if (httpCall.getError() != null || !isOkOrNoContent(httpCall)) { - return null; - } - return bidder.makeBids(toHttpCallWithSafeResponseBody(httpCall), bidRequest); + + return httpCall.getError() != null + ? null + : makeResult(bidder, httpCall, bidRequest); } /** - * Returns true if response HTTP status code is equal to 200 or 204, otherwise false. + * Returns result based on response status code */ - private static boolean isOkOrNoContent(HttpCall httpCall) { + private static Result> makeResult(Bidder bidder, HttpCall httpCall, + BidRequest bidRequest) { final int statusCode = httpCall.getResponse().getStatusCode(); - return statusCode == HttpResponseStatus.OK.code() || statusCode == HttpResponseStatus.NO_CONTENT.code(); + if (statusCode == HttpResponseStatus.NO_CONTENT.code()) { + return Result.empty(); + } + if (statusCode != HttpResponseStatus.OK.code()) { + return null; + } + return bidder.makeBids(toHttpCallWithSafeResponseBody(httpCall), bidRequest); } /** diff --git a/src/main/java/org/prebid/server/bidder/OpenrtbAdapter.java b/src/main/java/org/prebid/server/bidder/OpenrtbAdapter.java index 35b77d13c70..d718f33023b 100644 --- a/src/main/java/org/prebid/server/bidder/OpenrtbAdapter.java +++ b/src/main/java/org/prebid/server/bidder/OpenrtbAdapter.java @@ -11,8 +11,6 @@ import com.iab.openrtb.request.User; import com.iab.openrtb.request.Video; import com.iab.openrtb.response.BidResponse; -import io.netty.handler.codec.http.HttpHeaderValues; -import io.vertx.core.MultiMap; import org.apache.commons.collections4.CollectionUtils; import org.prebid.server.auction.model.AdUnitBid; import org.prebid.server.auction.model.PreBidRequestContext; @@ -21,7 +19,6 @@ import org.prebid.server.proto.openrtb.ext.request.ExtUser; import org.prebid.server.proto.request.PreBidRequest; import org.prebid.server.proto.response.MediaType; -import org.prebid.server.util.HttpUtil; import java.util.Collections; import java.util.HashSet; @@ -145,12 +142,6 @@ protected static Set allowedMediaTypes(AdUnitBid adUnitBid, Set imps) { if (CollectionUtils.isEmpty(imps)) { throw new PreBidException("openRTB bids need at least one Imp"); @@ -170,7 +161,8 @@ protected static AdUnitBid lookupBid(List adUnitBids, String adUnitCo * Extracts bids from response, returns empty stream in case of missing bid response or seat bids */ protected static Stream responseBidStream(BidResponse bidResponse) { - return bidResponse == null || bidResponse.getSeatbid() == null ? Stream.empty() + return bidResponse == null || CollectionUtils.isEmpty(bidResponse.getSeatbid()) + ? Stream.empty() : bidResponse.getSeatbid().stream() .filter(Objects::nonNull) .filter(seatBid -> seatBid.getBid() != null) diff --git a/src/main/java/org/prebid/server/bidder/OpenrtbBidder.java b/src/main/java/org/prebid/server/bidder/OpenrtbBidder.java index f0795ff9768..7bd54d26d7e 100644 --- a/src/main/java/org/prebid/server/bidder/OpenrtbBidder.java +++ b/src/main/java/org/prebid/server/bidder/OpenrtbBidder.java @@ -1,6 +1,5 @@ package org.prebid.server.bidder; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.iab.openrtb.request.BidRequest; import com.iab.openrtb.request.Imp; import com.iab.openrtb.response.BidResponse; @@ -23,14 +22,11 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; public abstract class OpenrtbBidder implements Bidder { - private static final String DEFAULT_BID_CURRENCY = "USD"; - private final String endpointUrl; private final RequestCreationStrategy requestCreationStrategy; private final Class extType; @@ -52,7 +48,7 @@ public final Result>> makeHttpRequests(BidRequest b try { validateRequest(bidRequest); } catch (PreBidException e) { - return Result.emptyWithError(BidderError.badInput(e.getMessage())); + return Result.withError(BidderError.badInput(e.getMessage())); } final List errors = new ArrayList<>(); @@ -67,7 +63,7 @@ public final Result>> makeHttpRequests(BidRequest b } } if (modifiedImpsWithExts.isEmpty()) { - return Result.of(Collections.emptyList(), errors); + return Result.withErrors(errors); } return Result.of(createHttpRequests(bidRequest, modifiedImpsWithExts), errors); @@ -211,14 +207,14 @@ protected void modifyRequest(BidRequest bidRequest, BidRequest.BidRequestBuilder public final Result> makeBids(HttpCall httpCall, BidRequest bidRequest) { try { final BidResponse bidResponse = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); - return Result.of(extractBids(httpCall.getRequest().getPayload(), bidResponse), Collections.emptyList()); + return Result.withValues(extractBids(httpCall.getRequest().getPayload(), bidResponse)); } catch (DecodeException | PreBidException e) { - return Result.emptyWithError(BidderError.badServerResponse(e.getMessage())); + return Result.withError(BidderError.badServerResponse(e.getMessage())); } } private List extractBids(BidRequest bidRequest, BidResponse bidResponse) { - if (bidResponse == null || bidResponse.getSeatbid() == null) { + if (bidResponse == null || CollectionUtils.isEmpty(bidResponse.getSeatbid())) { return Collections.emptyList(); } return bidsFromResponse(bidRequest, bidResponse); @@ -230,8 +226,7 @@ private List bidsFromResponse(BidRequest bidRequest, BidResponse bidR .map(SeatBid::getBid) .filter(Objects::nonNull) .flatMap(Collection::stream) - .map(bid -> BidderBid.of(bid, getBidType(bid.getImpid(), bidRequest.getImp()), - getBidCurrency(bidRequest.getCur(), bidResponse.getCur()))) + .map(bid -> BidderBid.of(bid, getBidType(bid.getImpid(), bidRequest.getImp()), bidResponse.getCur())) .collect(Collectors.toList()); } @@ -264,32 +259,6 @@ protected BidType getBidType(String impId, List imps) { return bidType; } - /** - * A hook for defining a bid currency. - *

- * By default - USD. - * - * @return - bid currency - */ - protected String getBidCurrency(List requestCurrencies, String responseCurrency) { - final String result; - - if (responseCurrency != null) { - result = responseCurrency; - } else if (CollectionUtils.isNotEmpty(requestCurrencies)) { - result = requestCurrencies.get(0); - } else { - result = DEFAULT_BID_CURRENCY; - } - - return result; - } - - @Override - public final Map extractTargeting(ObjectNode ext) { - return Collections.emptyMap(); - } - public enum RequestCreationStrategy { SINGLE_REQUEST, REQUEST_PER_IMP diff --git a/src/main/java/org/prebid/server/bidder/TimeoutBidder.java b/src/main/java/org/prebid/server/bidder/TimeoutBidder.java deleted file mode 100644 index 1e4a7701944..00000000000 --- a/src/main/java/org/prebid/server/bidder/TimeoutBidder.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.prebid.server.bidder; - -import org.prebid.server.bidder.model.HttpRequest; - -/** - * TimeoutBidder is used to identify bidders that support timeout notifications. - */ -public interface TimeoutBidder extends Bidder { - - /** - * makeTimeoutNotification method much the same as makeRequests, except it is fed the bidder request that timed out, - * and expects that only one notification "request" will be generated. A use case for multiple timeout notifications - * has not been anticipated. - *

- * Do note that if makeRequests returns multiple requests, and more than one of these times out, - * makeTimeoutNotification will be called once for each timed out request. - */ - HttpRequest makeTimeoutNotification(HttpRequest httpRequest); -} diff --git a/src/main/java/org/prebid/server/bidder/acuityads/AcuityadsBidder.java b/src/main/java/org/prebid/server/bidder/acuityads/AcuityadsBidder.java new file mode 100644 index 00000000000..64ee46778d3 --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/acuityads/AcuityadsBidder.java @@ -0,0 +1,173 @@ +package org.prebid.server.bidder.acuityads; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Device; +import com.iab.openrtb.request.Imp; +import com.iab.openrtb.response.Bid; +import com.iab.openrtb.response.BidResponse; +import com.iab.openrtb.response.SeatBid; +import io.vertx.core.MultiMap; +import io.vertx.core.http.HttpMethod; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.prebid.server.bidder.Bidder; +import org.prebid.server.bidder.model.BidderBid; +import org.prebid.server.bidder.model.BidderError; +import org.prebid.server.bidder.model.HttpCall; +import org.prebid.server.bidder.model.HttpRequest; +import org.prebid.server.bidder.model.Result; +import org.prebid.server.exception.PreBidException; +import org.prebid.server.json.DecodeException; +import org.prebid.server.json.JacksonMapper; +import org.prebid.server.proto.openrtb.ext.ExtPrebid; +import org.prebid.server.proto.openrtb.ext.request.acuity.ExtImpAcuityads; +import org.prebid.server.proto.openrtb.ext.response.BidType; +import org.prebid.server.util.HttpUtil; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +/** + * Acuityads {@link Bidder} implementation. + */ +public class AcuityadsBidder implements Bidder { + + private static final TypeReference> ACUITYADS_EXT_TYPE_REFERENCE = + new TypeReference>() { + }; + private static final String OPENRTB_VERSION = "2.5"; + private static final String URL_HOST_MACRO = "{{Host}}"; + private static final String URL_ACCOUNT_ID_MACRO = "{{AccountID}}"; + + private final String endpointUrl; + private final JacksonMapper mapper; + + public AcuityadsBidder(String endpointUrl, JacksonMapper mapper) { + this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); + this.mapper = Objects.requireNonNull(mapper); + } + + @Override + public Result>> makeHttpRequests(BidRequest request) { + final ExtImpAcuityads extImpAcuityads; + final String url; + + try { + extImpAcuityads = parseImpExt(request.getImp().get(0)); + url = resolveEndpoint(extImpAcuityads.getHost(), extImpAcuityads.getAccountId()); + } catch (PreBidException e) { + return Result.withError(BidderError.badInput(e.getMessage())); + } + + final BidRequest outgoingRequest = request.toBuilder() + .imp(removeFirstImpExt(request.getImp())) + .build(); + + return Result.of(Collections.singletonList( + HttpRequest.builder() + .method(HttpMethod.POST) + .uri(url) + .headers(resolveHeaders(request.getDevice())) + .payload(outgoingRequest) + .body(mapper.encode(outgoingRequest)) + .build()), + Collections.emptyList()); + } + + private ExtImpAcuityads parseImpExt(Imp imp) { + final ExtImpAcuityads extImpAcuityads; + try { + extImpAcuityads = mapper.mapper().convertValue(imp.getExt(), ACUITYADS_EXT_TYPE_REFERENCE).getBidder(); + } catch (IllegalArgumentException e) { + throw new PreBidException("ext.bidder not provided"); + } + if (extImpAcuityads == null) { + throw new PreBidException("ext.bidder not provided"); + } + if (StringUtils.isBlank(extImpAcuityads.getHost())) { + throw new PreBidException("Missed host param"); + } + if (StringUtils.isBlank(extImpAcuityads.getAccountId())) { + throw new PreBidException("Missed accountId param"); + } + return extImpAcuityads; + } + + private String resolveEndpoint(String host, String accountId) { + return endpointUrl + .replace(URL_HOST_MACRO, StringUtils.stripToEmpty(host)) + .replace(URL_ACCOUNT_ID_MACRO, StringUtils.stripToEmpty(accountId)); + } + + private static List removeFirstImpExt(List imps) { + return IntStream.range(0, imps.size()) + .mapToObj(impIndex -> impIndex == 0 + ? imps.get(impIndex).toBuilder().ext(null).build() + : imps.get(impIndex)) + .collect(Collectors.toList()); + } + + private static MultiMap resolveHeaders(Device device) { + final MultiMap headers = HttpUtil.headers(); + HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.X_OPENRTB_VERSION_HEADER, OPENRTB_VERSION); + + if (device != null) { + HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.USER_AGENT_HEADER, device.getUa()); + HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.X_FORWARDED_FOR_HEADER, device.getIpv6()); + HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.X_FORWARDED_FOR_HEADER, device.getIp()); + } + return headers; + } + + @Override + public Result> makeBids(HttpCall httpCall, BidRequest bidRequest) { + try { + final BidResponse bidResponse = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); + return Result.of(extractBids(httpCall.getRequest().getPayload(), bidResponse), Collections.emptyList()); + } catch (DecodeException | PreBidException e) { + return Result.withError(BidderError.badServerResponse(e.getMessage())); + } + } + + private static List extractBids(BidRequest bidRequest, BidResponse bidResponse) { + if (bidResponse == null) { + throw new PreBidException("Bad Server Response"); + } + if (CollectionUtils.isEmpty(bidResponse.getSeatbid())) { + throw new PreBidException("Empty SeatBid array"); + } + return bidsFromResponse(bidRequest, bidResponse); + } + + private static List bidsFromResponse(BidRequest bidRequest, BidResponse bidResponse) { + final SeatBid firstSeatBid = bidResponse.getSeatbid().get(0); + final List bids = firstSeatBid.getBid(); + + if (CollectionUtils.isEmpty(bids)) { + throw new PreBidException("Empty bids array"); + } + + return bids.stream() + .filter(Objects::nonNull) + .map(bid -> BidderBid.of(bid, getBidType(bid.getImpid(), bidRequest.getImp()), bidResponse.getCur())) + .collect(Collectors.toList()); + } + + private static BidType getBidType(String impId, List imps) { + for (Imp imp : imps) { + if (imp.getId().equals(impId)) { + if (imp.getVideo() != null) { + return BidType.video; + } + if (imp.getXNative() != null) { + return BidType.xNative; + } + } + } + return BidType.banner; + } +} diff --git a/src/main/java/org/prebid/server/bidder/adform/AdformAdapter.java b/src/main/java/org/prebid/server/bidder/adform/AdformAdapter.java index 18b6ca38d8d..a12902ecdbd 100644 --- a/src/main/java/org/prebid/server/bidder/adform/AdformAdapter.java +++ b/src/main/java/org/prebid/server/bidder/adform/AdformAdapter.java @@ -14,7 +14,6 @@ import org.prebid.server.auction.model.PreBidRequestContext; import org.prebid.server.bidder.Adapter; import org.prebid.server.bidder.adform.model.AdformBid; -import org.prebid.server.bidder.adform.model.AdformDigitrust; import org.prebid.server.bidder.adform.model.AdformParams; import org.prebid.server.bidder.adform.model.UrlParameters; import org.prebid.server.bidder.model.AdapterHttpRequest; @@ -53,7 +52,7 @@ public AdformAdapter(String cookieFamilyName, String endpointUrl, JacksonMapper this.mapper = Objects.requireNonNull(mapper); this.requestUtil = new AdformRequestUtil(); - this.httpUtil = new AdformHttpUtil(mapper); + this.httpUtil = new AdformHttpUtil(); } /** @@ -73,7 +72,7 @@ public List> makeHttpRequests(AdapterRequest adapterReq HttpMethod.GET, getUrl(preBidRequestContext, adformParams, extUser), null, - headers(preBidRequestContext, requestUtil.getAdformDigitrust(extUser)))); + headers(preBidRequestContext))); } @Override @@ -198,14 +197,13 @@ private String getUrlFromParams(List adformParams) { /** * Creates adform headers, which stores adform request parameters */ - private MultiMap headers(PreBidRequestContext preBidRequestContext, AdformDigitrust adformDigitrust) { + private MultiMap headers(PreBidRequestContext preBidRequestContext) { return httpUtil.buildAdformHeaders( VERSION, ObjectUtils.defaultIfNull(preBidRequestContext.getUa(), ""), ObjectUtils.defaultIfNull(preBidRequestContext.getIp(), ""), preBidRequestContext.getReferer(), - preBidRequestContext.getUidsCookie().uidFrom(cookieFamilyName), - adformDigitrust); + preBidRequestContext.getUidsCookie().uidFrom(cookieFamilyName)); } /** diff --git a/src/main/java/org/prebid/server/bidder/adform/AdformBidder.java b/src/main/java/org/prebid/server/bidder/adform/AdformBidder.java index e55f66b607d..548234336af 100644 --- a/src/main/java/org/prebid/server/bidder/adform/AdformBidder.java +++ b/src/main/java/org/prebid/server/bidder/adform/AdformBidder.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.iab.openrtb.request.BidRequest; import com.iab.openrtb.request.Device; import com.iab.openrtb.request.Imp; @@ -34,7 +33,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -62,7 +60,7 @@ public AdformBidder(String endpointUrl, JacksonMapper mapper) { this.mapper = Objects.requireNonNull(mapper); this.requestUtil = new AdformRequestUtil(); - this.httpUtil = new AdformHttpUtil(mapper); + this.httpUtil = new AdformHttpUtil(); } /** @@ -78,7 +76,7 @@ public Result>> makeHttpRequests(BidRequest request) { final List errors = extImpAdformsResult.getErrors(); if (extImpAdforms.isEmpty()) { - return Result.of(Collections.emptyList(), errors); + return Result.withErrors(errors); } final String currency = resolveRequestCurrency(request.getCur()); @@ -100,8 +98,8 @@ public Result>> makeHttpRequests(BidRequest request) { .secure(getSecure(imps)) .gdprApplies(requestUtil.getGdprApplies(request.getRegs())) .consent(requestUtil.getConsent(extUser)) - .currency(currency) .eids(requestUtil.getEids(extUser, mapper)) + .currency(currency) .url(getUrl(extImpAdforms)) .build()); @@ -110,8 +108,7 @@ public Result>> makeHttpRequests(BidRequest request) { getUserAgent(device), getIp(device), getReferer(request.getSite()), - getUserId(user), - requestUtil.getAdformDigitrust(extUser)); + getUserId(user)); return Result.of(Collections.singletonList( HttpRequest.builder() @@ -147,14 +144,9 @@ public Result> makeBids(HttpCall httpCall, BidRequest bidR httpResponse.getBody(), mapper.mapper().getTypeFactory().constructCollectionType(List.class, AdformBid.class)); } catch (JsonProcessingException e) { - return Result.emptyWithError(BidderError.badServerResponse(e.getMessage())); + return Result.withError(BidderError.badServerResponse(e.getMessage())); } - return Result.of(toBidderBid(adformBids, bidRequest.getImp()), Collections.emptyList()); - } - - @Override - public Map extractTargeting(ObjectNode ext) { - return Collections.emptyMap(); + return Result.withValues(toBidderBid(adformBids, bidRequest.getImp())); } /** @@ -298,24 +290,43 @@ private List toBidderBid(List adformBids, List imps) for (int i = 0; i < adformBids.size(); i++) { final AdformBid adformBid = adformBids.get(i); - if (StringUtils.isEmpty(adformBid.getBanner()) || !Objects.equals(adformBid.getResponse(), BANNER)) { + final String adm = resolveAdm(adformBid); + if (StringUtils.isBlank(adm)) { continue; } + final BidType bidType = resolveBidType(adformBid.getResponse()); final Imp imp = imps.get(i); bidderBids.add(BidderBid.of(Bid.builder() .id(imp.getId()) .impid(imp.getId()) .price(adformBid.getWinBid()) - .adm(adformBid.getBanner()) + .adm(adm) .w(adformBid.getWidth()) .h(adformBid.getHeight()) .dealid(adformBid.getDealId()) .crid(adformBid.getWinCrid()) .build(), - BidType.banner, + bidType, currency)); } return bidderBids; } + + private String resolveAdm(AdformBid adformBid) { + if (Objects.equals(adformBid.getResponse(), "banner")) { + return adformBid.getBanner(); + } + + if (Objects.equals(adformBid.getResponse(), "vast_content")) { + return adformBid.getVastContent(); + } + + return ""; + } + + private BidType resolveBidType(String response) { + return Objects.equals(response, BANNER) + ? BidType.banner : BidType.video; + } } diff --git a/src/main/java/org/prebid/server/bidder/adform/AdformHttpUtil.java b/src/main/java/org/prebid/server/bidder/adform/AdformHttpUtil.java index e57f0b28dbd..0824215ffae 100644 --- a/src/main/java/org/prebid/server/bidder/adform/AdformHttpUtil.java +++ b/src/main/java/org/prebid/server/bidder/adform/AdformHttpUtil.java @@ -4,17 +4,13 @@ import io.vertx.core.MultiMap; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.prebid.server.bidder.adform.model.AdformDigitrust; import org.prebid.server.bidder.adform.model.UrlParameters; -import org.prebid.server.json.EncodeException; -import org.prebid.server.json.JacksonMapper; import org.prebid.server.util.HttpUtil; import java.util.ArrayList; import java.util.Base64; import java.util.List; import java.util.Locale; -import java.util.Objects; import java.util.stream.Collectors; /** @@ -30,10 +26,7 @@ class AdformHttpUtil { private static final Locale LOCALE = Locale.US; - private final JacksonMapper mapper; - - AdformHttpUtil(JacksonMapper mapper) { - this.mapper = Objects.requireNonNull(mapper); + AdformHttpUtil() { } /** @@ -43,8 +36,7 @@ MultiMap buildAdformHeaders(String version, String userAgent, String ip, String referer, - String userId, - AdformDigitrust adformDigitrust) { + String userId) { final MultiMap headers = MultiMap.caseInsensitiveMultiMap() .add(HttpUtil.CONTENT_TYPE_HEADER, HttpUtil.APPLICATION_JSON_CONTENT_TYPE) @@ -61,18 +53,6 @@ MultiMap buildAdformHeaders(String version, cookieValues.add(String.format("uid=%s", userId)); } - if (adformDigitrust != null) { - try { - final String adformDigitrustEncoded = Base64.getUrlEncoder().withoutPadding() - .encodeToString(mapper.encode(adformDigitrust).getBytes()); - // Cookie name and structure are described here: - // https://github.com/digi-trust/dt-cdn/wiki/Cookies-for-Platforms - cookieValues.add(String.format("DigiTrust.v1.identity=%s", adformDigitrustEncoded)); - } catch (EncodeException e) { - // do not add digitrust to cookie header and just ignore this exception - } - } - if (CollectionUtils.isNotEmpty(cookieValues)) { headers.add(HttpUtil.COOKIE_HEADER, String.join(";", cookieValues)); } diff --git a/src/main/java/org/prebid/server/bidder/adform/AdformRequestUtil.java b/src/main/java/org/prebid/server/bidder/adform/AdformRequestUtil.java index 3a5dec5e5e0..12b93922912 100644 --- a/src/main/java/org/prebid/server/bidder/adform/AdformRequestUtil.java +++ b/src/main/java/org/prebid/server/bidder/adform/AdformRequestUtil.java @@ -3,12 +3,9 @@ import com.iab.openrtb.request.Regs; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; -import org.prebid.server.bidder.adform.model.AdformDigitrust; -import org.prebid.server.bidder.adform.model.AdformDigitrustPrivacy; import org.prebid.server.json.JacksonMapper; import org.prebid.server.proto.openrtb.ext.request.ExtRegs; import org.prebid.server.proto.openrtb.ext.request.ExtUser; -import org.prebid.server.proto.openrtb.ext.request.ExtUserDigiTrust; import org.prebid.server.proto.openrtb.ext.request.ExtUserEid; import org.prebid.server.proto.openrtb.ext.request.ExtUserEidUid; @@ -24,8 +21,6 @@ */ class AdformRequestUtil { - private static final int DIGITRUST_VERSION = 1; - /** * Retrieves gdpr from regs.ext.gdpr and in case of any exception or invalid values returns empty string. */ @@ -44,20 +39,6 @@ String getConsent(ExtUser extUser) { return ObjectUtils.defaultIfNull(gdprConsent, ""); } - /** - * Creates {@link AdformDigitrust} from user.extUser.digitrust, if something wrong, returns null. - */ - AdformDigitrust getAdformDigitrust(ExtUser extUser) { - final ExtUserDigiTrust extUserDigiTrust = extUser != null ? extUser.getDigitrust() : null; - return extUserDigiTrust != null - ? AdformDigitrust.of( - extUserDigiTrust.getId(), - DIGITRUST_VERSION, - extUserDigiTrust.getKeyv(), - AdformDigitrustPrivacy.of(extUserDigiTrust.getPref() != 0)) - : null; - } - /** * Retrieves eids from user.ext.eids and in case of any exception or invalid values return empty collection. */ @@ -79,6 +60,6 @@ String getEids(ExtUser extUser, JacksonMapper mapper) { return ObjectUtils .defaultIfNull(Base64.getUrlEncoder().withoutPadding().encodeToString(encodedEids.getBytes()), - ""); + ""); } } diff --git a/src/main/java/org/prebid/server/bidder/adform/model/AdformBid.java b/src/main/java/org/prebid/server/bidder/adform/model/AdformBid.java index f6fc6789f9f..64729679896 100644 --- a/src/main/java/org/prebid/server/bidder/adform/model/AdformBid.java +++ b/src/main/java/org/prebid/server/bidder/adform/model/AdformBid.java @@ -24,4 +24,6 @@ public class AdformBid { String dealId; String winCrid; + + String vastContent; } diff --git a/src/main/java/org/prebid/server/bidder/adform/model/AdformDigitrust.java b/src/main/java/org/prebid/server/bidder/adform/model/AdformDigitrust.java deleted file mode 100644 index d6dbe48a2a8..00000000000 --- a/src/main/java/org/prebid/server/bidder/adform/model/AdformDigitrust.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.prebid.server.bidder.adform.model; - -import lombok.AllArgsConstructor; -import lombok.Value; - -@AllArgsConstructor(staticName = "of") -@Value -public class AdformDigitrust { - - String id; - - Integer version; - - Integer keyv; - - AdformDigitrustPrivacy privacy; -} diff --git a/src/main/java/org/prebid/server/bidder/adgeneration/AdgenerationBidder.java b/src/main/java/org/prebid/server/bidder/adgeneration/AdgenerationBidder.java index 7ab45c530fb..51c862e820d 100644 --- a/src/main/java/org/prebid/server/bidder/adgeneration/AdgenerationBidder.java +++ b/src/main/java/org/prebid/server/bidder/adgeneration/AdgenerationBidder.java @@ -1,7 +1,6 @@ package org.prebid.server.bidder.adgeneration; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.iab.openrtb.request.BidRequest; import com.iab.openrtb.request.Device; import com.iab.openrtb.request.Format; @@ -9,7 +8,6 @@ import com.iab.openrtb.request.Site; import com.iab.openrtb.request.Source; import com.iab.openrtb.response.Bid; -import io.netty.handler.codec.http.HttpResponseStatus; import io.vertx.core.MultiMap; import io.vertx.core.http.HttpMethod; import org.apache.commons.collections4.CollectionUtils; @@ -32,9 +30,7 @@ import org.prebid.server.util.HttpUtil; import java.util.ArrayList; -import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -65,7 +61,7 @@ public AdgenerationBidder(String endpointUrl, JacksonMapper mapper) { @Override public Result>> makeHttpRequests(BidRequest request) { if (CollectionUtils.isEmpty(request.getImp())) { - return Result.emptyWithError(BidderError.badInput("No impression in the bid request")); + return Result.withError(BidderError.badInput("No impression in the bid request")); } final List errors = new ArrayList<>(); @@ -167,20 +163,15 @@ private MultiMap resolveHeaders(Device device) { @Override public Result> makeBids(HttpCall httpCall, BidRequest bidRequest) { - final int statusCode = httpCall.getResponse().getStatusCode(); - if (statusCode == HttpResponseStatus.NO_CONTENT.code()) { - return Result.empty(); - } - try { final AdgenerationResponse adgenerationResponse = decodeBodyToBidResponse(httpCall.getResponse()); if (CollectionUtils.isEmpty(adgenerationResponse.getResults())) { - return Result.emptyWithError(BidderError.badServerResponse("Results object in BidResponse is empty")); + return Result.withError(BidderError.badServerResponse("Results object in BidResponse is empty")); } return resultWithBidderBids(bidRequest, adgenerationResponse); } catch (PreBidException e) { - return Result.emptyWithError(BidderError.badServerResponse(e.getMessage())); + return Result.withError(BidderError.badServerResponse(e.getMessage())); } } @@ -211,7 +202,7 @@ private Result> resultWithBidderBids(BidRequest bidRequest, .dealid(adgenerationResponse.getDealid()) .build(); final BidderBid bidderBid = BidderBid.of(updatedBid, BidType.banner, getCurrency(bidRequest)); - return Result.of(Collections.singletonList(bidderBid), Collections.emptyList()); + return Result.withValue(bidderBid); } } return null; @@ -247,9 +238,4 @@ private String removeWrapper(String ad) { ? "" : ad.replace("", "").replaceFirst("", "").trim(); } - - @Override - public Map extractTargeting(ObjectNode ext) { - return Collections.emptyMap(); - } } diff --git a/src/main/java/org/prebid/server/bidder/adhese/AdheseBidder.java b/src/main/java/org/prebid/server/bidder/adhese/AdheseBidder.java index 9c558a998b3..6e4c55f666c 100644 --- a/src/main/java/org/prebid/server/bidder/adhese/AdheseBidder.java +++ b/src/main/java/org/prebid/server/bidder/adhese/AdheseBidder.java @@ -3,14 +3,16 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Device; import com.iab.openrtb.request.Imp; import com.iab.openrtb.request.Site; import com.iab.openrtb.request.User; import com.iab.openrtb.response.Bid; +import com.iab.openrtb.response.BidResponse; import com.iab.openrtb.response.SeatBid; -import io.netty.handler.codec.http.HttpResponseStatus; +import io.vertx.core.MultiMap; +import io.vertx.core.http.HttpHeaders; import io.vertx.core.http.HttpMethod; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -18,10 +20,14 @@ import org.prebid.server.bidder.adhese.model.AdheseBid; import org.prebid.server.bidder.adhese.model.AdheseOriginData; import org.prebid.server.bidder.adhese.model.AdheseResponseExt; +import org.prebid.server.bidder.adhese.model.Cpm; +import org.prebid.server.bidder.adhese.model.CpmValues; +import org.prebid.server.bidder.adhese.model.Prebid; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderError; import org.prebid.server.bidder.model.HttpCall; import org.prebid.server.bidder.model.HttpRequest; +import org.prebid.server.bidder.model.HttpResponse; import org.prebid.server.bidder.model.Result; import org.prebid.server.exception.PreBidException; import org.prebid.server.json.DecodeException; @@ -33,7 +39,6 @@ import org.prebid.server.util.HttpUtil; import java.math.BigDecimal; -import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -41,16 +46,19 @@ import java.util.TreeMap; import java.util.stream.Collectors; +/** + * Adhese {@link Bidder} implementation. + */ public class AdheseBidder implements Bidder { private static final TypeReference> ADHESE_EXT_TYPE_REFERENCE = new TypeReference>() { }; - private static final String DEFAULT_BID_CURRENCY = "USD"; - private static final String ORIGIN = "JERLICIA"; - private static final String QUERY_PARAMETER_GDPR = "/xt"; - private static final String QUERY_PARAMETER_REFERER = "/xf"; + private static final String ORIGIN_BID = "JERLICIA"; + private static final String GDPR_QUERY_PARAMETER = "/xt"; + private static final String REFERER_QUERY_PARAMETER = "/xf"; + private static final String IFA_QUERY_PARAMETER = "/xz"; private final String endpointUrl; private final JacksonMapper mapper; @@ -63,29 +71,36 @@ public AdheseBidder(String endpointUrl, JacksonMapper mapper) { @Override public Result>> makeHttpRequests(BidRequest request) { if (CollectionUtils.isEmpty(request.getImp())) { - return Result.emptyWithError(BidderError.badInput("No impression in the bid request")); + return Result.withError(BidderError.badInput("No impression in the bid request")); } - ExtImpAdhese extImpAdhese; + final ExtImpAdhese extImpAdhese; try { extImpAdhese = parseImpExt(request.getImp().get(0)); } catch (PreBidException e) { - return Result.emptyWithError(BidderError.badInput(e.getMessage())); + return Result.withError(BidderError.badInput(e.getMessage())); } - final String uri = buildUrl(request, endpointUrl, extImpAdhese); + final String uri = buildUrl(request, extImpAdhese); return Result.of(Collections.singletonList( HttpRequest.builder() - .method(HttpMethod.GET) + .method(HttpMethod.POST) .uri(uri) - .body(null) - .headers(HttpUtil.headers()) - .payload(null) + .headers(replaceHeaders(request.getDevice())) .build()), Collections.emptyList()); } + private MultiMap replaceHeaders(Device device) { + MultiMap headers = HttpUtil.headers(); + if (device != null) { + HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.USER_AGENT_HEADER, device.getUa()); + HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpHeaders.createOptimized("X-Real-IP"), device.getIp()); + } + return headers; + } + private ExtImpAdhese parseImpExt(Imp imp) { try { return mapper.mapper().convertValue(imp.getExt(), ADHESE_EXT_TYPE_REFERENCE).getBidder(); @@ -94,83 +109,128 @@ private ExtImpAdhese parseImpExt(Imp imp) { } } - private String buildUrl(BidRequest request, String endpointUrl, ExtImpAdhese extImpAdhese) { - final String uri = endpointUrl.replace("{{AccountId}}", extImpAdhese.getAccount()); - final String slotParameter = String.format("/sl%s-%s", HttpUtil.encodeUrl(extImpAdhese.getLocation()), - HttpUtil.encodeUrl(extImpAdhese.getFormat())); + private String buildUrl(BidRequest request, ExtImpAdhese extImpAdhese) { + return String.format("%s%s%s%s%s%s", + getUrl(extImpAdhese), + getSlotParameter(extImpAdhese), + getTargetParameters(extImpAdhese), + getGdprParameter(request.getUser()), + getRefererParameter(request.getSite()), + getIfaParameter(request.getDevice())); + } - return String.format("%s%s%s%s%s", uri, slotParameter, getTargetParameters(extImpAdhese), - getGdprParameter(request.getUser()), getRefererParameter(request.getSite())); + private String getUrl(ExtImpAdhese extImpAdhese) { + return endpointUrl.replace("{{AccountId}}", extImpAdhese.getAccount()); + } + + private static String getSlotParameter(ExtImpAdhese extImpAdhese) { + return String.format("/sl%s-%s", + HttpUtil.encodeUrl(extImpAdhese.getLocation()), + HttpUtil.encodeUrl(extImpAdhese.getFormat())); } private String getTargetParameters(ExtImpAdhese extImpAdhese) { - final JsonNode keywords = extImpAdhese.getKeywords(); - if (keywords == null || keywords.isNull()) { + final JsonNode targets = extImpAdhese.getTargets(); + if (targets == null || targets.isNull()) { return ""; } - final Map> targetParameters = parseTargetParametersAndSort(extImpAdhese.getKeywords()); + final Map> targetParameters = parseTargetParametersAndSort(targets); return targetParameters.entrySet().stream() - .map(stringListEntry -> createPartOrUrl(stringListEntry.getKey(), stringListEntry.getValue())) + .map(entry -> createPartOrUrl(entry.getKey(), entry.getValue())) .collect(Collectors.joining()); } - private Map> parseTargetParametersAndSort(JsonNode keywords) { - return keywords != null ? new TreeMap<>( - mapper.mapper().convertValue(keywords, new TypeReference>>() { - })) : null; + private Map> parseTargetParametersAndSort(JsonNode targets) { + return new TreeMap<>( + mapper.mapper().convertValue(targets, new TypeReference>>() { + })); } - private String createPartOrUrl(String key, List values) { + private static String createPartOrUrl(String key, List values) { final String formattedValues = String.join(";", values); return String.format("/%s%s", HttpUtil.encodeUrl(key), formattedValues); } - private String getGdprParameter(User user) { + private static String getGdprParameter(User user) { final ExtUser extUser = user != null ? user.getExt() : null; final String consent = extUser != null ? extUser.getConsent() : null; - return StringUtils.isNotBlank(consent) ? String.format("%s%s", QUERY_PARAMETER_GDPR, consent) : ""; + return StringUtils.isNotBlank(consent) + ? String.format("%s%s", GDPR_QUERY_PARAMETER, consent) + : ""; } - private String getRefererParameter(Site site) { + private static String getRefererParameter(Site site) { final String page = site != null ? site.getPage() : null; return StringUtils.isNotBlank(page) - ? String.format("%s%s", QUERY_PARAMETER_REFERER, HttpUtil.encodeUrl(page)) + ? String.format("%s%s", REFERER_QUERY_PARAMETER, HttpUtil.encodeUrl(page)) + : ""; + } + + private static String getIfaParameter(Device device) { + final String ifa = device != null ? device.getIfa() : null; + return StringUtils.isNotBlank(ifa) + ? String.format("%s%s", IFA_QUERY_PARAMETER, HttpUtil.encodeUrl(ifa)) : ""; } @Override public Result> makeBids(HttpCall httpCall, BidRequest bidRequest) { - final int statusCode = httpCall.getResponse().getStatusCode(); - if (statusCode == HttpResponseStatus.NO_CONTENT.code()) { + final HttpResponse httpResponse = httpCall.getResponse(); + + final JsonNode bodyNode; + try { + bodyNode = mapper.decodeValue(httpResponse.getBody(), JsonNode.class); + } catch (DecodeException e) { + return Result.withError(BidderError.badServerResponse(e.getMessage())); + } + if (!bodyNode.isArray()) { + return Result.withError(BidderError.badServerResponse("Unexpected response body")); + } + if (bodyNode.size() == 0) { return Result.empty(); } - final List adheseBid; - final List adheseResponseExt; - final List adheseOriginData; - final AdheseBid firstAdheseBid; - Bid bid; + final JsonNode bidNode = bodyNode.get(0); + final AdheseBid adheseBid; try { - adheseBid = decodeBodyToBidList(httpCall, AdheseBid.class); - firstAdheseBid = adheseBid.get(0); - if (Objects.equals(firstAdheseBid.getOrigin(), ORIGIN)) { - adheseResponseExt = decodeBodyToBidList(httpCall, AdheseResponseExt.class); - adheseOriginData = decodeBodyToBidList(httpCall, AdheseOriginData.class); - bid = convertAdheseBid(firstAdheseBid, adheseResponseExt.get(0), adheseOriginData.get(0)); - } else { - bid = convertAdheseOpenRtbBid(firstAdheseBid); - } + adheseBid = toObjectOfType(bidNode, AdheseBid.class); } catch (PreBidException e) { - return Result.emptyWithError(BidderError.badServerResponse(e.getMessage())); + return Result.withError(BidderError.badServerResponse(e.getMessage())); } - final BigDecimal price = new BigDecimal(firstAdheseBid.getExtension().getPrebid().getCpm().getAmount()); - final Integer width = Integer.valueOf(firstAdheseBid.getWidth()); - final Integer height = Integer.valueOf(firstAdheseBid.getHeight()); + final Bid bid; + if (Objects.equals(adheseBid.getOrigin(), ORIGIN_BID)) { + final AdheseResponseExt responseExt; + final AdheseOriginData originData; + try { + responseExt = toObjectOfType(bidNode, AdheseResponseExt.class); + originData = toObjectOfType(bidNode, AdheseOriginData.class); + } catch (PreBidException e) { + return Result.withError(BidderError.badServerResponse(e.getMessage())); + } + bid = convertAdheseBid(adheseBid, responseExt, originData); + } else { + bid = convertAdheseOpenRtbBid(adheseBid); + } + if (bid == null) { + return Result.withError(BidderError.badServerResponse("Response resulted in an empty seatBid array")); + } - final Bid updateBid = bid != null - ? Bid.builder() + final BigDecimal price; + final Integer width; + final Integer height; + try { + price = getPrice(adheseBid); + width = Integer.valueOf(adheseBid.getWidth()); + height = Integer.valueOf(adheseBid.getHeight()); + } catch (NumberFormatException e) { + return Result.withError(BidderError.badServerResponse(e.getMessage())); + } + + final Bid updatedBid = Bid.builder() + .id("1") // hardcoded because it is not provided and should be not empty value + .impid(bidRequest.getImp().get(0).getId()) .price(price) .w(width) .h(height) @@ -178,42 +238,27 @@ public Result> makeBids(HttpCall httpCall, BidRequest bidR .crid(bid.getCrid()) .adm(bid.getAdm()) .ext(bid.getExt()) - .build() - : null; - - if (updateBid == null) { - return Result.emptyWithError(BidderError - .badServerResponse("Response resulted in an empty seatBid array. %s.")); - } + .build(); - /** - * Used ImpId from Imp of bidRequest, because it is not provided and should be not empty value - */ - final List errors = new ArrayList<>(); - return Result.of(Collections.singletonList(makeBid(updateBid, bidRequest.getImp().get(0).getId(), errors)), - errors); + final BidderBid bidderBid = BidderBid.of(updatedBid, getBidType(bid.getAdm()), getCurrency(adheseBid)); + return Result.of(Collections.singletonList(bidderBid), Collections.emptyList()); } - private List decodeBodyToBidList(HttpCall httpCall, Class bidClassName) { + private T toObjectOfType(JsonNode jsonNode, Class clazz) { try { - return mapper.mapper().readValue( - httpCall.getResponse().getBody(), - mapper.mapper().getTypeFactory().constructCollectionType(List.class, bidClassName)); - } catch (DecodeException | JsonProcessingException e) { + return mapper.mapper().treeToValue(jsonNode, clazz); + } catch (JsonProcessingException e) { throw new PreBidException(e.getMessage(), e); } } private Bid convertAdheseBid(AdheseBid adheseBid, AdheseResponseExt adheseResponseExt, AdheseOriginData adheseOriginData) { - final ObjectNode adheseExtJson = mapper.mapper().valueToTree(adheseOriginData); - return Bid.builder() - .id("1") .dealid(adheseResponseExt.getOrderId()) .crid(adheseResponseExt.getId()) .adm(getAdMarkup(adheseBid, adheseResponseExt)) - .ext(adheseExtJson) + .ext(mapper.mapper().valueToTree(adheseOriginData)) .build(); } @@ -235,35 +280,37 @@ private String getAdMarkup(AdheseBid adheseBid, AdheseResponseExt adheseResponse } private Bid convertAdheseOpenRtbBid(AdheseBid adheseBid) { - final List seatbid = adheseBid.getOriginData().getSeatbid(); - return CollectionUtils.isNotEmpty(seatbid) - && CollectionUtils.isNotEmpty(seatbid.get(0).getBid()) - ? Bid.builder().adm(adheseBid.getBody()).build() - : null; + final BidResponse originData = adheseBid.getOriginData(); + final List seatBids = originData != null ? originData.getSeatbid() : null; + + return CollectionUtils.emptyIfNull(seatBids).stream() + .filter(Objects::nonNull) + .flatMap(seatBid -> seatBid.getBid().stream()) + .filter(Objects::nonNull) + .findFirst() + .map(bid -> bid.toBuilder().adm(adheseBid.getBody()).build()) + .orElse(null); } - private static BidderBid makeBid(Bid bid, String impId, List errors) { - /** - * Hardcoded bidId =1, because it is not provided and should be not empty value - */ - try { - final BidType bidType = getBidType(bid.getAdm()); - final Bid updateBid = bid.toBuilder().id("1").impid(impId).build(); - return BidderBid.of(updateBid, bidType, DEFAULT_BID_CURRENCY); - } catch (PreBidException e) { - errors.add(BidderError.badInput(e.getMessage())); - return null; - } + private static BigDecimal getPrice(AdheseBid adheseBid) { + final CpmValues cpmValues = getCpmValues(adheseBid.getExtension()); + final String amount = cpmValues != null ? cpmValues.getAmount() : null; + return new BigDecimal(StringUtils.stripToEmpty(amount)); + } + + private static String getCurrency(AdheseBid adheseBid) { + final CpmValues cpmValues = getCpmValues(adheseBid.getExtension()); + return cpmValues != null ? StringUtils.stripToNull(cpmValues.getCurrency()) : null; + } + + private static CpmValues getCpmValues(Prebid prebid) { + final Cpm cpm = prebid != null ? prebid.getPrebid() : null; + return cpm != null ? cpm.getCpm() : null; } private static BidType getBidType(String bidAdm) { - return (StringUtils.isNotBlank(bidAdm) && StringUtils.containsAny(bidAdm, " extractTargeting(ObjectNode ext) { - return Collections.emptyMap(); - } } diff --git a/src/main/java/org/prebid/server/bidder/adkernel/AdkernelBidder.java b/src/main/java/org/prebid/server/bidder/adkernel/AdkernelBidder.java index 8c283cd9778..7558256f61d 100644 --- a/src/main/java/org/prebid/server/bidder/adkernel/AdkernelBidder.java +++ b/src/main/java/org/prebid/server/bidder/adkernel/AdkernelBidder.java @@ -1,7 +1,6 @@ package org.prebid.server.bidder.adkernel; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.iab.openrtb.request.App; import com.iab.openrtb.request.BidRequest; import com.iab.openrtb.request.Imp; @@ -10,6 +9,7 @@ import com.iab.openrtb.response.SeatBid; import io.vertx.core.MultiMap; import io.vertx.core.http.HttpMethod; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.prebid.server.bidder.Bidder; import org.prebid.server.bidder.model.BidderBid; @@ -43,8 +43,6 @@ public class AdkernelBidder implements Bidder { new TypeReference>() { }; - private static final String DEFAULT_BID_CURRENCY = "USD"; - private final String endpointTemplate; private final JacksonMapper mapper; @@ -59,16 +57,14 @@ public Result>> makeHttpRequests(BidRequest request final Map> pubToImps = new HashMap<>(); for (Imp imp : request.getImp()) { try { - validateImp(imp); - final ExtImpAdkernel extImpAdkernel = parseAndValidateImpExt(imp); - dispatchImpression(imp, extImpAdkernel, pubToImps); + processImp(imp, pubToImps); } catch (PreBidException e) { errors.add(BidderError.badInput(e.getMessage())); } } if (hasNoImpressions(pubToImps)) { - return Result.of(null, errors); + return Result.withErrors(errors); } final BidRequest.BidRequestBuilder requestBuilder = request.toBuilder(); @@ -79,6 +75,12 @@ public Result>> makeHttpRequests(BidRequest request return Result.of(httpRequests, errors); } + private void processImp(Imp imp, Map> pubToImps) { + validateImp(imp); + final ExtImpAdkernel extImpAdkernel = parseAndValidateImpExt(imp); + dispatchImpression(imp, extImpAdkernel, pubToImps); + } + private static void validateImp(Imp imp) { if (imp.getBanner() == null && imp.getVideo() == null) { throw new PreBidException(String.format( @@ -106,16 +108,14 @@ private ExtImpAdkernel parseAndValidateImpExt(Imp imp) { return extImpAdkernel; } - //Group impressions by AdKernel-specific parameters `zoneId` & `host` private static void dispatchImpression(Imp imp, ExtImpAdkernel extImpAdkernel, Map> pubToImp) { pubToImp.putIfAbsent(extImpAdkernel, new ArrayList<>()); pubToImp.get(extImpAdkernel).add(compatImpression(imp)); } - //Alter impression info to comply with adkernel platform requirements private static Imp compatImpression(Imp imp) { - final Imp.ImpBuilder impBuilder = imp.toBuilder().ext(null) //do not forward ext to adkernel platform + final Imp.ImpBuilder impBuilder = imp.toBuilder().ext(null) .audio(null) .xNative(null); return imp.getBanner() != null ? impBuilder.video(null).build() : impBuilder.build(); @@ -123,8 +123,7 @@ private static Imp compatImpression(Imp imp) { private static boolean hasNoImpressions(Map> pubToImps) { return pubToImps.values().stream() - .mapToLong(Collection::size) - .sum() == 0; + .allMatch(CollectionUtils::isEmpty); } private HttpRequest createHttpRequest(Map.Entry> extAndImp, @@ -133,7 +132,7 @@ private HttpRequest createHttpRequest(Map.Entry createHttpRequest(Map.Entry imps, BidRequest.BidRequestBuilder requestBuilder, Site site, App app) { + private static BidRequest createBidRequest(List imps, + BidRequest.BidRequestBuilder requestBuilder, + Site site, + App app) { requestBuilder.imp(imps); @@ -164,9 +165,9 @@ private static BidRequest createBidRequest( public Result> makeBids(HttpCall httpCall, BidRequest bidRequest) { try { final BidResponse bidResponse = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); - return Result.of(extractBids(httpCall.getRequest().getPayload(), bidResponse), Collections.emptyList()); + return Result.withValues(extractBids(httpCall.getRequest().getPayload(), bidResponse)); } catch (DecodeException | PreBidException e) { - return Result.emptyWithError(BidderError.badServerResponse(e.getMessage())); + return Result.withError(BidderError.badServerResponse(e.getMessage())); } } @@ -184,13 +185,10 @@ private static List bidsFromResponse(BidRequest bidRequest, BidRespon return bidResponse.getSeatbid().stream() .map(SeatBid::getBid) .flatMap(Collection::stream) - .map(bid -> BidderBid.of(bid, getType(bid.getImpid(), bidRequest.getImp()), DEFAULT_BID_CURRENCY)) + .map(bid -> BidderBid.of(bid, getType(bid.getImpid(), bidRequest.getImp()), bidResponse.getCur())) .collect(Collectors.toList()); } - /** - * Figures out which media type this bid is for. - */ private static BidType getType(String impId, List imps) { for (Imp imp : imps) { if (imp.getId().equals(impId) && imp.getBanner() != null) { @@ -199,9 +197,4 @@ private static BidType getType(String impId, List imps) { } return BidType.video; } - - @Override - public Map extractTargeting(ObjectNode ext) { - return Collections.emptyMap(); - } } diff --git a/src/main/java/org/prebid/server/bidder/adkerneladn/AdkernelAdnBidder.java b/src/main/java/org/prebid/server/bidder/adkerneladn/AdkernelAdnBidder.java index eca5e25bb55..91d95e67ae2 100644 --- a/src/main/java/org/prebid/server/bidder/adkerneladn/AdkernelAdnBidder.java +++ b/src/main/java/org/prebid/server/bidder/adkerneladn/AdkernelAdnBidder.java @@ -1,7 +1,6 @@ package org.prebid.server.bidder.adkerneladn; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.iab.openrtb.request.App; import com.iab.openrtb.request.Banner; import com.iab.openrtb.request.BidRequest; @@ -13,6 +12,8 @@ import io.vertx.core.MultiMap; import io.vertx.core.http.HttpMethod; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; import org.prebid.server.bidder.Bidder; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderError; @@ -27,8 +28,6 @@ import org.prebid.server.proto.openrtb.ext.response.BidType; import org.prebid.server.util.HttpUtil; -import java.net.MalformedURLException; -import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -46,8 +45,9 @@ public class AdkernelAdnBidder implements Bidder { private static final TypeReference> ADKERNELADN_EXT_TYPE_REFERENCE = new TypeReference>() { }; - - private static final String DEFAULT_BID_CURRENCY = "USD"; + private static final String DEFAULT_DOMAIN = "tag.adkernel.com"; + private static final String URL_HOST_MACRO = "{{Host}}"; + private static final String URL_PUBLISHER_ID_MACRO = "{{PublisherID}}"; private final String endpointUrl; private final JacksonMapper mapper; @@ -59,39 +59,36 @@ public AdkernelAdnBidder(String endpointUrl, JacksonMapper mapper) { @Override public Result>> makeHttpRequests(BidRequest bidRequest) { - final List imps = bidRequest.getImp(); - + final List validImps = bidRequest.getImp(); final List errors = new ArrayList<>(); - final List> httpRequests = new ArrayList<>(); - try { - final List impExts = getAndValidateImpExt(imps); - final Map> pubToImps = dispatchImpressions(imps, impExts); - httpRequests.addAll(buildAdapterRequests(bidRequest, pubToImps, endpointUrl)); - } catch (PreBidException e) { - errors.add(BidderError.badInput(e.getMessage())); - } - return Result.of(httpRequests, errors); - } + final Map impWithExts = getAndValidateImpExt(validImps, errors); + final Map> pubToImps = dispatchImpressions(impWithExts, errors); + if (MapUtils.isEmpty(pubToImps)) { + return Result.withErrors(errors); + } - private static MultiMap headers() { - return HttpUtil.headers() - .add("x-openrtb-version", "2.5"); + return Result.of(buildAdapterRequests(bidRequest, pubToImps), errors); } - private List getAndValidateImpExt(List imps) { - return imps.stream() - .map(AdkernelAdnBidder::validateImp) - .map(this::parseAndValidateAdkernelAdnExt) - .collect(Collectors.toList()); + private Map getAndValidateImpExt(List imps, List errors) { + final Map validImpsWithExts = new HashMap<>(); + for (Imp imp : imps) { + try { + validateImp(imp); + validImpsWithExts.put(imp, parseAndValidateAdkernelAdnExt(imp)); + } catch (PreBidException e) { + errors.add(BidderError.badInput(e.getMessage())); + } + } + return validImpsWithExts; } - private static Imp validateImp(Imp imp) { + private static void validateImp(Imp imp) { if (imp.getBanner() == null && imp.getVideo() == null) { throw new PreBidException(String.format("Invalid imp with id=%s. Expected imp.banner or imp.video", imp.getId())); } - return imp; } private ExtImpAdkernelAdn parseAndValidateAdkernelAdnExt(Imp imp) { @@ -108,41 +105,42 @@ private ExtImpAdkernelAdn parseAndValidateAdkernelAdnExt(Imp imp) { return adkernelAdnExt; } - /** - * Group impressions by AdKernel-specific parameters `pubId` & `host`. - */ - private static Map> dispatchImpressions(List imps, - List impExts) { + private static Map> dispatchImpressions(Map impsWithExts, + List errors) { final Map> result = new HashMap<>(); - for (int i = 0; i < imps.size(); i++) { - final Imp imp = compatImpression(imps.get(i)); - final ExtImpAdkernelAdn impExt = impExts.get(i); + for (Imp key : impsWithExts.keySet()) { + final Imp imp; + try { + imp = compatImpression(key); + } catch (PreBidException e) { + errors.add(BidderError.badInput(e.getMessage())); + continue; + } + final ExtImpAdkernelAdn impExt = impsWithExts.get(key); result.putIfAbsent(impExt, new ArrayList<>()); result.get(impExt).add(imp); } + return result; } - /** - * Alter impression info to comply with adkernel platform requirements. - */ private static Imp compatImpression(Imp imp) { final Imp.ImpBuilder impBuilder = imp.toBuilder(); - impBuilder.ext(null); // do not forward ext to adkernel platform + impBuilder.ext(null); final Banner banner = imp.getBanner(); if (banner != null) { - return compatBannerImpression(impBuilder, banner); + compatBannerImpression(impBuilder, banner); } - return impBuilder.audio(null) + return impBuilder + .audio(null) .xNative(null) .build(); } - private static Imp compatBannerImpression(Imp.ImpBuilder impBuilder, Banner compatBanner) { + private static void compatBannerImpression(Imp.ImpBuilder impBuilder, Banner compatBanner) { if (compatBanner.getW() == null && compatBanner.getH() == null) { - // As banner.w/h are required fields for adkernel adn platform - take the first format entry final List compatBannerFormat = compatBanner.getFormat(); if (CollectionUtils.isEmpty(compatBannerFormat)) { @@ -164,32 +162,32 @@ private static Imp compatBannerImpression(Imp.ImpBuilder impBuilder, Banner comp impBuilder.banner(bannerBuilder.build()); } - return impBuilder.video(null) - .audio(null) - .xNative(null) - .build(); + impBuilder.video(null); } private List> buildAdapterRequests(BidRequest preBidRequest, - Map> pubToImps, - String endpointUrl) { + Map> pubToImps) { final List> result = new ArrayList<>(); for (Map.Entry> entry : pubToImps.entrySet()) { - final BidRequest outgoingRequest = createBidRequest(preBidRequest, entry.getValue()); - final String body = mapper.encode(outgoingRequest); - result.add(HttpRequest.builder() - .method(HttpMethod.POST) - .uri(buildEndpoint(entry.getKey(), endpointUrl)) - .body(body) - .headers(headers()) - .payload(outgoingRequest) - .build()); + result.add(createRequest(entry.getKey(), entry.getValue(), preBidRequest)); } return result; } + private HttpRequest createRequest(ExtImpAdkernelAdn extImp, List imps, BidRequest preBidRequest) { + final BidRequest outgoingRequest = createBidRequest(preBidRequest, imps); + final String body = mapper.encode(outgoingRequest); + return HttpRequest.builder() + .method(HttpMethod.POST) + .uri(buildEndpoint(extImp)) + .body(body) + .headers(headers()) + .payload(outgoingRequest) + .build(); + } + private static BidRequest createBidRequest(BidRequest preBidRequest, List imps) { final BidRequest.BidRequestBuilder bidRequestBuilder = preBidRequest.toBuilder() .imp(imps); @@ -206,36 +204,27 @@ private static BidRequest createBidRequest(BidRequest preBidRequest, List i return bidRequestBuilder.build(); } - /** - * Builds endpoint url based on adapter-specific pub settings from imp.ext. - */ - private static String buildEndpoint(ExtImpAdkernelAdn impExt, String endpointUrl) { - final String updatedEndpointUrl; + private String buildEndpoint(ExtImpAdkernelAdn impExt) { + final String impHost = impExt.getHost(); + final String host = StringUtils.isNotBlank(impHost) ? impHost : DEFAULT_DOMAIN; - if (impExt.getHost() != null) { - final URL url; - try { - url = new URL(endpointUrl); - } catch (MalformedURLException e) { - throw new PreBidException( - String.format("Error occurred while parsing AdkernelAdn endpoint url: %s", endpointUrl), e); - } - final String currentHostAndPort = url.getHost() + (url.getPort() == -1 ? "" : ":" + url.getPort()); - updatedEndpointUrl = endpointUrl.replace(currentHostAndPort, impExt.getHost()); - } else { - updatedEndpointUrl = endpointUrl; - } + return endpointUrl + .replace(URL_HOST_MACRO, host) + .replace(URL_PUBLISHER_ID_MACRO, impExt.getPubId().toString()); + } - return String.format("%s%s", updatedEndpointUrl, impExt.getPubId()); + private static MultiMap headers() { + return HttpUtil.headers() + .add(HttpUtil.X_OPENRTB_VERSION_HEADER, "2.5"); } @Override public Result> makeBids(HttpCall httpCall, BidRequest bidRequest) { try { final BidResponse bidResponse = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); - return Result.of(extractBids(httpCall.getRequest().getPayload(), bidResponse), Collections.emptyList()); + return Result.withValues(extractBids(httpCall.getRequest().getPayload(), bidResponse)); } catch (DecodeException | PreBidException e) { - return Result.emptyWithError(BidderError.badServerResponse(e.getMessage())); + return Result.withError(BidderError.badServerResponse(e.getMessage())); } } @@ -252,14 +241,13 @@ private static List extractBids(BidRequest bidRequest, BidResponse bi private static List bidsFromResponse(BidRequest bidRequest, BidResponse bidResponse) { return bidResponse.getSeatbid().stream() .map(SeatBid::getBid) + .filter(Objects::nonNull) .flatMap(Collection::stream) - .map(bid -> BidderBid.of(bid, getType(bid.getImpid(), bidRequest.getImp()), DEFAULT_BID_CURRENCY)) + .filter(Objects::nonNull) + .map(bid -> BidderBid.of(bid, getType(bid.getImpid(), bidRequest.getImp()), bidResponse.getCur())) .collect(Collectors.toList()); } - /** - * Figures out which media type this bid is for. - */ private static BidType getType(String impId, List imps) { for (Imp imp : imps) { if (imp.getId().equals(impId) && imp.getBanner() != null) { @@ -268,9 +256,4 @@ private static BidType getType(String impId, List imps) { } return BidType.video; } - - @Override - public Map extractTargeting(ObjectNode ext) { - return Collections.emptyMap(); - } } diff --git a/src/main/java/org/prebid/server/bidder/adman/AdmanBidder.java b/src/main/java/org/prebid/server/bidder/adman/AdmanBidder.java index 45634bf5a4d..229d937d20c 100644 --- a/src/main/java/org/prebid/server/bidder/adman/AdmanBidder.java +++ b/src/main/java/org/prebid/server/bidder/adman/AdmanBidder.java @@ -3,8 +3,12 @@ import com.iab.openrtb.request.Imp; import org.prebid.server.bidder.Bidder; import org.prebid.server.bidder.OpenrtbBidder; +import org.prebid.server.exception.PreBidException; import org.prebid.server.json.JacksonMapper; import org.prebid.server.proto.openrtb.ext.request.adman.ExtImpAdman; +import org.prebid.server.proto.openrtb.ext.response.BidType; + +import java.util.List; /** * Adman {@link Bidder} implementation. @@ -21,4 +25,17 @@ protected Imp modifyImp(Imp imp, ExtImpAdman impExt) { .tagid(impExt.getTagId()) .build(); } + + @Override + protected BidType getBidType(String impId, List imps) { + for (Imp imp : imps) { + if (imp.getId().equals(impId)) { + if (imp.getBanner() == null && imp.getVideo() != null) { + return BidType.video; + } + return BidType.banner; + } + } + throw new PreBidException(String.format("Failed to find impression %s", impId)); + } } diff --git a/src/main/java/org/prebid/server/bidder/admixer/AdmixerBidder.java b/src/main/java/org/prebid/server/bidder/admixer/AdmixerBidder.java index df76f0f9504..0ab9489dc9c 100644 --- a/src/main/java/org/prebid/server/bidder/admixer/AdmixerBidder.java +++ b/src/main/java/org/prebid/server/bidder/admixer/AdmixerBidder.java @@ -7,9 +7,9 @@ import com.iab.openrtb.request.Imp; import com.iab.openrtb.response.BidResponse; import com.iab.openrtb.response.SeatBid; -import io.netty.handler.codec.http.HttpResponseStatus; import io.vertx.core.http.HttpMethod; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.prebid.server.bidder.Bidder; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderError; @@ -42,8 +42,6 @@ public class AdmixerBidder implements Bidder { new TypeReference>() { }; - private static final String DEFAULT_BID_CURRENCY = "USD"; - private final String endpointUrl; private final JacksonMapper mapper; @@ -57,11 +55,6 @@ public Result>> makeHttpRequests(BidRequest request final List errors = new ArrayList<>(); final List validImps = new ArrayList<>(); - if (CollectionUtils.isEmpty(request.getImp())) { - errors.add(BidderError.badInput("No valid impressions in the bid request")); - return Result.of(Collections.emptyList(), errors); - } - for (Imp imp : request.getImp()) { try { final ExtImpAdmixer extImp = parseImpExt(imp); @@ -86,21 +79,25 @@ public Result>> makeHttpRequests(BidRequest request } private ExtImpAdmixer parseImpExt(Imp imp) { + final ExtImpAdmixer extImpAdmixer; try { - return mapper.mapper().convertValue(imp.getExt(), ADMIXER_EXT_TYPE_REFERENCE).getBidder(); + extImpAdmixer = mapper.mapper().convertValue(imp.getExt(), ADMIXER_EXT_TYPE_REFERENCE).getBidder(); } catch (IllegalArgumentException e) { - throw new PreBidException(e.getMessage(), e); + throw new PreBidException(String.format("Wrong Admixer bidder ext in imp with id : %s", imp.getId())); } - } - - private Imp processImp(Imp imp, ExtImpAdmixer extImpAdmixer) { - if (extImpAdmixer.getZone().length() != 36) { + if (StringUtils.length(extImpAdmixer.getZone()) != 36) { throw new PreBidException("ZoneId must be UUID/GUID"); } + return extImpAdmixer; + } + + private Imp processImp(Imp imp, ExtImpAdmixer extImpAdmixer) { + final Double extImpFloor = extImpAdmixer.getCustomFloor(); + final BigDecimal customFloor = extImpFloor != null ? BigDecimal.valueOf(extImpFloor) : BigDecimal.ZERO; return imp.toBuilder() .tagid(extImpAdmixer.getZone()) - .bidfloor(BigDecimal.valueOf(extImpAdmixer.getCustomFloor())) + .bidfloor(customFloor) .ext(makeImpExt(extImpAdmixer.getCustomParams())) .build(); } @@ -113,29 +110,26 @@ private ObjectNode makeImpExt(Map customParams) { @Override public Result> makeBids(HttpCall httpCall, BidRequest bidRequest) { - final int statusCode = httpCall.getResponse().getStatusCode(); - if (statusCode == HttpResponseStatus.NO_CONTENT.code()) { - return Result.empty(); - } - final BidResponse bidResponse; try { bidResponse = decodeBodyToBidResponse(httpCall); } catch (PreBidException e) { - return Result.emptyWithError(BidderError.badServerResponse(e.getMessage())); + return Result.withError(BidderError.badServerResponse(e.getMessage())); } - if (CollectionUtils.isEmpty(bidResponse.getSeatbid()) + if (bidResponse == null + || CollectionUtils.isEmpty(bidResponse.getSeatbid()) || CollectionUtils.isEmpty(bidResponse.getSeatbid().get(0).getBid())) { - return Result.of(Collections.emptyList(), Collections.emptyList()); + return Result.empty(); } final List bidderBids = bidResponse.getSeatbid().stream() .map(SeatBid::getBid) .flatMap(Collection::stream) - .map(bid -> BidderBid.of(bid, getBidType(bid.getImpid(), bidRequest.getImp()), DEFAULT_BID_CURRENCY)) + .map(bid -> BidderBid.of(bid, getBidType(bid.getImpid(), bidRequest.getImp()), bidResponse.getCur())) .collect(Collectors.toList()); - return Result.of(bidderBids, Collections.emptyList()); + + return Result.withValues(bidderBids); } private BidResponse decodeBodyToBidResponse(HttpCall httpCall) { @@ -162,9 +156,4 @@ private static BidType getBidType(String impId, List imps) { } return BidType.banner; } - - @Override - public Map extractTargeting(ObjectNode ext) { - return Collections.emptyMap(); - } } diff --git a/src/main/java/org/prebid/server/bidder/adocean/AdoceanBidder.java b/src/main/java/org/prebid/server/bidder/adocean/AdoceanBidder.java index f8c6b1ace92..e3234f169af 100644 --- a/src/main/java/org/prebid/server/bidder/adocean/AdoceanBidder.java +++ b/src/main/java/org/prebid/server/bidder/adocean/AdoceanBidder.java @@ -1,12 +1,14 @@ package org.prebid.server.bidder.adocean; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.node.ObjectNode; +import com.iab.openrtb.request.Banner; import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Device; +import com.iab.openrtb.request.Format; import com.iab.openrtb.request.Imp; +import com.iab.openrtb.request.Site; import com.iab.openrtb.request.User; import com.iab.openrtb.response.Bid; -import io.netty.handler.codec.http.HttpResponseStatus; import io.vertx.core.MultiMap; import io.vertx.core.http.HttpMethod; import org.apache.commons.collections4.CollectionUtils; @@ -36,18 +38,23 @@ import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; +import java.util.TreeSet; import java.util.stream.Collectors; +/** + * Adocean {@link Bidder} implementation. + */ public class AdoceanBidder implements Bidder { private static final TypeReference> ADOCEAN_EXT_TYPE_REFERENCE = new TypeReference>() { }; - private static final String VERSION = "1.0.0"; + private static final String VERSION = "1.1.0"; private static final int MAX_URI_LENGTH = 8000; private static final String DEFAULT_BID_CURRENCY = "USD"; private static final String MEASUREMENT_CODE_TEMPLATE = " \",\"impid\":\"uuid\",\"ttl\":300,\"crid\":\"94395500\",\"w\":300,\"price\":2.942808,\"adid\":\"94395500\",\"h\":250}]}],\"cur\":\"USD\"}", "status": 200 } @@ -104,11 +104,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -129,10 +124,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/beintoo/test-beintoo-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/beintoo/test-beintoo-bid-request.json index 23914b4b674..7948350ea6e 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/beintoo/test-beintoo-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/beintoo/test-beintoo-bid-request.json @@ -31,14 +31,9 @@ "ifa": "ifaId" }, "user": { - "buyeruid" : "BT-UID", - "ext" : { - "consent" : "consentValue", - "digitrust" : { - "id" : "id", - "keyv" : 123, - "pref" : 0 - } + "buyeruid": "BT-UID", + "ext": { + "consent": "consentValue" } }, "at": 1, @@ -58,10 +53,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, @@ -87,4 +78,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-request.json b/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-request.json new file mode 100644 index 00000000000..1897bb6f6a3 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-request.json @@ -0,0 +1,65 @@ +{ + "id": "tid", + "imp": [ + { + "id": "impId001", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "between": { + "host": "127.0.0.1" + } + } + } + ], + "device": { + "pxratio": 4.2, + "dnt": 2, + "language": "en", + "ifa": "ifaId" + }, + "site": { + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 5000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000 + } + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-response.json b/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-response.json new file mode 100644 index 00000000000..0e8a1ffcae8 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-response.json @@ -0,0 +1,58 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "id": "bid001", + "impid": "impId001", + "price": 3.33, + "adm": "adm001", + "adid": "adid001", + "cid": "cid001", + "crid": "crid001", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner", + "targeting": { + "hb_pb": "3.30", + "hb_size_between": "300x250", + "hb_bidder_between": "between", + "hb_cache_path": "{{ cache.path }}", + "hb_size": "300x250", + "hb_cache_host_between": "{{ cache.host }}", + "hb_cache_path_between": "{{ cache.path }}", + "hb_cache_id_between": "f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "hb_bidder": "between", + "hb_cache_id": "f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "hb_pb_between": "3.30", + "hb_cache_host": "{{ cache.host }}" + }, + "cache": { + "bids": { + "url": "{{ cache.resource_url }}f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "cacheId": "f0ab9105-cb21-4e59-b433-70f5ad6671cb" + } + } + } + } + } + ], + "seat": "between", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "between": "{{ between.response_time_ms }}", + "cache": "{{ cache.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 1000 + }, + "tmaxrequest": 5000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-request.json new file mode 100644 index 00000000000..04c8803045c --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-request.json @@ -0,0 +1,80 @@ +{ + "id": "tid", + "imp": [ + { + "id": "impId001", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "bidder": { + "host": "127.0.0.1" + } + } + } + ], + "site": { + "domain": "example.com", + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "userAgent", + "dnt": 2, + "ip": "193.168.244.1", + "pxratio": 4.2, + "language": "en", + "ifa": "ifaId" + }, + "user": { + "buyeruid" : "BTW-UID" + }, + "at": 1, + "tmax": 5000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000, + "channel" : { + "name" : "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-response.json new file mode 100644 index 00000000000..95a93284e04 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-response.json @@ -0,0 +1,20 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "id": "bid001", + "impid": "impId001", + "price": 3.33, + "adid": "adid001", + "crid": "crid001", + "cid": "cid001", + "adm": "adm001", + "h": 250, + "w": 300 + } + ] + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/between/test-cache-between-request.json b/src/test/resources/org/prebid/server/it/openrtb2/between/test-cache-between-request.json new file mode 100644 index 00000000000..60845624d51 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/between/test-cache-between-request.json @@ -0,0 +1,18 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "id": "bid001", + "impid": "impId001", + "price": 3.33, + "adm": "adm001", + "adid": "adid001", + "cid": "cid001", + "crid": "crid001", + "w": 300, + "h": 250 + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/between/test-cache-between-response.json b/src/test/resources/org/prebid/server/it/openrtb2/between/test-cache-between-response.json new file mode 100644 index 00000000000..93d0b8de2cd --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/between/test-cache-between-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "f0ab9105-cb21-4e59-b433-70f5ad6671cb" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-auction-brightroll-request.json b/src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-auction-brightroll-request.json index 04f41fb4842..f9c81a3f876 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-auction-brightroll-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-auction-brightroll-request.json @@ -64,12 +64,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-brightroll-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-brightroll-bid-request-1.json index 0d324c864f2..71c0a0389fe 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-brightroll-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/brightroll/test-brightroll-bid-request-1.json @@ -3,7 +3,7 @@ "imp": [ { "id": "impId17", - "bidfloor": 0.30, + "bidfloor": 0.65, "banner": { "w": 300, "h": 250, @@ -52,11 +52,6 @@ "user": { "buyeruid": "BR-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-auction-colossus-request.json b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-auction-colossus-request.json new file mode 100644 index 00000000000..26b4a36e63d --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-auction-colossus-request.json @@ -0,0 +1,83 @@ +{ + "id": "tid", + "imp": [ + { + "id": "impId001", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "colossus": { + "TagID": "first-tagid" + } + } + }, + { + "id": "impId002", + "video": { + "mimes": [ + "video/mp4" + ], + "w": 640, + "h": 480 + }, + "ext": { + "colossus": { + "TagID": "second-tagid" + } + } + } + ], + "device": { + "pxratio": 4.2, + "dnt": 2, + "language": "en", + "ifa": "ifaId" + }, + "site": { + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 5000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {}, + "vastxml": { + "ttlseconds": 120 + } + }, + "auctiontimestamp": 1000 + } + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-auction-colossus-response.json b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-auction-colossus-response.json new file mode 100644 index 00000000000..092d59b8a0b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-auction-colossus-response.json @@ -0,0 +1,105 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "id": "bid001", + "impid": "impId001", + "price": 1.25, + "adm": "adm001", + "crid": "crid001", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner", + "targeting": { + "hb_pb": "1.20", + "hb_cache_id_colossus": "9092799c-93b0-4e11-a232-2c0151d5d275", + "hb_cache_path_colossus": "{{ cache.path }}", + "hb_cache_path": "{{ cache.path }}", + "hb_pb_colossus": "1.20", + "hb_size": "300x250", + "hb_bidder_colossus": "colossus", + "hb_size_colossus": "300x250", + "hb_bidder": "colossus", + "hb_cache_id": "9092799c-93b0-4e11-a232-2c0151d5d275", + "hb_cache_host": "{{ cache.host }}", + "hb_cache_host_colossus": "{{ cache.host }}" + }, + "cache": { + "bids": { + "url": "{{ cache.resource_url }}9092799c-93b0-4e11-a232-2c0151d5d275", + "cacheId": "9092799c-93b0-4e11-a232-2c0151d5d275" + } + } + } + } + }, + { + "id": "bid01", + "impid": "impId002", + "price": 2.25, + "adm": "adm002", + "adid": "29681110", + "adomain": [ + "video-example.com" + ], + "cid": "1001", + "crid": "crid002", + "cat": [ + "IAB2" + ], + "w": 640, + "h": 480, + "exp": 120, + "ext": { + "prebid": { + "type": "video", + "targeting": { + "hb_cache_id_colossus": "83cdc325-c816-4d2e-bf2c-9213a70671dd", + "hb_cache_path_colossus": "{{ cache.path }}", + "hb_size_colossus": "640x480", + "hb_cache_id": "83cdc325-c816-4d2e-bf2c-9213a70671dd", + "hb_uuid_colossus": "99dc3357-34ac-4819-9f68-0820039a542f", + "hb_pb": "2.20", + "hb_cache_path": "{{ cache.path }}", + "hb_uuid": "99dc3357-34ac-4819-9f68-0820039a542f", + "hb_pb_colossus": "2.20", + "hb_size": "640x480", + "hb_bidder_colossus": "colossus", + "hb_bidder": "colossus", + "hb_cache_host": "{{ cache.host }}", + "hb_cache_host_colossus": "{{ cache.host }}" + }, + "cache": { + "bids": { + "url": "{{ cache.resource_url }}83cdc325-c816-4d2e-bf2c-9213a70671dd", + "cacheId": "83cdc325-c816-4d2e-bf2c-9213a70671dd" + }, + "vastXml": { + "url": "{{ cache.resource_url }}99dc3357-34ac-4819-9f68-0820039a542f", + "cacheId": "99dc3357-34ac-4819-9f68-0820039a542f" + } + } + } + } + } + ], + "seat": "colossus", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "colossus": "{{ colossus.response_time_ms }}", + "cache": "{{ cache.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 1000 + }, + "tmaxrequest": 5000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-cache-colossus-request.json b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-cache-colossus-request.json new file mode 100644 index 00000000000..58471d39985 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-cache-colossus-request.json @@ -0,0 +1,41 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "id": "bid001", + "impid": "impId001", + "price": 1.25, + "adm": "adm001", + "crid": "crid001", + "w": 300, + "h": 250 + } + }, + { + "type": "json", + "value": { + "id": "bid01", + "impid": "impId002", + "price": 2.25, + "adm": "adm002", + "adid": "29681110", + "adomain": [ + "video-example.com" + ], + "cid": "1001", + "crid": "crid002", + "cat": [ + "IAB2" + ], + "w": 640, + "h": 480 + } + }, + { + "type": "xml", + "value": "adm002", + "expiry": 120 + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-cache-colossus-response.json b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-cache-colossus-response.json new file mode 100644 index 00000000000..c6317eb6c8c --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-cache-colossus-response.json @@ -0,0 +1,13 @@ +{ + "responses": [ + { + "uuid": "9092799c-93b0-4e11-a232-2c0151d5d275" + }, + { + "uuid": "83cdc325-c816-4d2e-bf2c-9213a70671dd" + }, + { + "uuid": "99dc3357-34ac-4819-9f68-0820039a542f" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-request-1.json new file mode 100644 index 00000000000..0b0b7e7485b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-request-1.json @@ -0,0 +1,84 @@ +{ + "id": "tid", + "imp": [ + { + "id": "impId001", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "tagid": "first-tagid", + "ext": { + "bidder": { + "TagID": "first-tagid" + } + } + } + ], + "site": { + "domain": "example.com", + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "userAgent", + "dnt": 2, + "ip": "193.168.244.1", + "pxratio": 4.2, + "language": "en", + "ifa": "ifaId" + }, + "user": { + "buyeruid": "CS-UID" + }, + "at": 1, + "tmax": 5000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {}, + "vastxml": { + "ttlseconds": 120 + } + }, + "auctiontimestamp": 1000, + "channel" : { + "name" : "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-request-2.json new file mode 100644 index 00000000000..a2b7360050b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-request-2.json @@ -0,0 +1,83 @@ +{ + "id": "tid", + "imp": [ + { + "id": "impId002", + "video": { + "mimes": [ + "video/mp4" + ], + "w": 640, + "h": 480 + }, + "tagid": "second-tagid", + "ext": { + "bidder": { + "TagID": "second-tagid" + } + } + } + ], + "site": { + "domain": "example.com", + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "userAgent", + "dnt": 2, + "ip": "193.168.244.1", + "pxratio": 4.2, + "language": "en", + "ifa": "ifaId" + }, + "user": { + "buyeruid": "CS-UID" + }, + "at": 1, + "tmax": 5000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {}, + "vastxml": { + "ttlseconds": 120 + } + }, + "auctiontimestamp": 1000, + "channel" : { + "name" : "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-response-1.json b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-response-1.json new file mode 100644 index 00000000000..89ec3dc2248 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-response-1.json @@ -0,0 +1,19 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "id": "bid001", + "impid": "impId001", + "price": 1.25, + "crid": "crid001", + "adm": "adm001", + "h": 250, + "w": 300 + } + ] + } + ], + "bidid": "bid001" +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-response-2.json b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-response-2.json new file mode 100644 index 00000000000..966ec782f17 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/colossus/test-colossus-bid-response-2.json @@ -0,0 +1,27 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "id": "bid01", + "impid": "impId002", + "price": 2.25, + "cid": "1001", + "crid": "crid002", + "adid": "29681110", + "adm": "adm002", + "cat": [ + "IAB2" + ], + "adomain": [ + "video-example.com" + ], + "h": 480, + "w": 640 + } + ] + } + ], + "bidid": "bid01" +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-auction-connectad-request.json b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-auction-connectad-request.json new file mode 100644 index 00000000000..b5cf1fb713c --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-auction-connectad-request.json @@ -0,0 +1,77 @@ +{ + "id": "tid", + "imp": [ + { + "id": "impId001", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "tagid": "2eb6bd58-865c-47ce-af7f-a918108c3fd2", + "ext": { + "connectad": { + "networkId": 12, + "siteId": 15, + "bidfloor": 14.7 + } + } + } + ], + "device": { + "pxratio": 4.2, + "dnt": 2, + "ip": "193.168.244.1", + "language": "en", + "ifa": "ifaId", + "ua": "userAgent" + }, + "site": { + "domain": "example.com", + "ext": { + "amp": 0 + }, + "page": "https://www.example.com", + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 3000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "includebidderkeys": true, + "includewinners": true, + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-auction-connectad-response.json b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-auction-connectad-response.json new file mode 100644 index 00000000000..b7e1cc8a733 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-auction-connectad-response.json @@ -0,0 +1,56 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "id": "1", + "impid": "impId001", + "price": 0.01, + "adm": "hi", + "cid": "test_cid", + "crid": "test_banner_crid", + "ext": { + "bidder": { + "format": "BANNER" + }, + "prebid": { + "type": "banner", + "targeting": { + "hb_bidder": "connectad", + "hb_bidder_connectad": "connectad", + "hb_cache_host": "{{ cache.host }}", + "hb_cache_host_connectad": "{{ cache.host }}", + "hb_cache_id": "f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "hb_cache_id_connectad": "f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "hb_cache_path": "{{ cache.path }}", + "hb_cache_path_connectad": "{{ cache.path }}", + "hb_pb": "0.00", + "hb_pb_connectad": "0.00" + }, + "cache": { + "bids": { + "cacheId": "f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "url": "{{ cache.resource_url }}f0ab9105-cb21-4e59-b433-70f5ad6671cb" + } + } + } + } + } + ], + "group": 0, + "seat": "connectad" + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "cache": "{{ cache.response_time_ms }}", + "connectad": "{{ connectad.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 1000 + }, + "tmaxrequest": 3000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-cache-connectad-request.json b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-cache-connectad-request.json new file mode 100644 index 00000000000..c6692479e4a --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-cache-connectad-request.json @@ -0,0 +1,18 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "id": "1", + "impid": "impId001", + "price": 0.01, + "adm": "hi", + "cid": "test_cid", + "crid": "test_banner_crid", + "ext": { + "format": "BANNER" + } + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-cache-connectad-response.json b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-cache-connectad-response.json new file mode 100644 index 00000000000..93d0b8de2cd --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-cache-connectad-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "f0ab9105-cb21-4e59-b433-70f5ad6671cb" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-connectad-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-connectad-bid-request.json new file mode 100644 index 00000000000..3c214cef05b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-connectad-bid-request.json @@ -0,0 +1,83 @@ +{ + "id": "tid", + "imp": [ + { + "id": "impId001", + "banner": { + "format": [], + "w": 300, + "h": 250 + }, + "tagid": "15", + "bidfloor" : 14.7, + "bidfloorcur" : "USD", + "secure" : 1, + "ext": { + "bidder": { + "networkId": 12, + "siteId": 15, + "bidfloor": 14.7 + } + } + } + ], + "site": { + "domain": "example.com", + "page": "https://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "userAgent", + "dnt": 2, + "ip": "193.168.244.1", + "pxratio": 4.2, + "language": "en", + "ifa": "ifaId" + }, + "user": { + "buyeruid": "CA-UID" + }, + "at": 1, + "tmax": 3000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000, + "channel": { + "name": "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-connectad-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-connectad-bid-response.json new file mode 100644 index 00000000000..455a146256a --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/connectad/test-connectad-bid-response.json @@ -0,0 +1,20 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "adm": "hi", + "crid": "test_banner_crid", + "cid": "test_cid", + "impid": "impId001", + "id": "1", + "price": 0.01, + "ext": { + "format": "BANNER" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/consumable/test-auction-consumable-request.json b/src/test/resources/org/prebid/server/it/openrtb2/consumable/test-auction-consumable-request.json index 88fb155b0ab..3d4151a6b86 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/consumable/test-auction-consumable-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/consumable/test-auction-consumable-request.json @@ -65,12 +65,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/conversant/alias/test-auction-conversant-request.json b/src/test/resources/org/prebid/server/it/openrtb2/conversant/alias/test-auction-conversant-request.json index 62ae5f8e6d5..efe8225764f 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/conversant/alias/test-auction-conversant-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/conversant/alias/test-auction-conversant-request.json @@ -67,12 +67,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/conversant/alias/test-conversant-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/conversant/alias/test-conversant-bid-request.json index a206472e3aa..653a4b9d51e 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/conversant/alias/test-conversant-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/conversant/alias/test-conversant-bid-request.json @@ -14,7 +14,7 @@ "h": 600 }, "displaymanager": "prebid-s2s", - "displaymanagerver": "1.0.1", + "displaymanagerver": "2.0.0", "ext": { "bidder": { "site_id": "siteId2" @@ -44,12 +44,7 @@ "user": { "buyeruid": "CV-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, @@ -96,4 +91,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/conversant/test-auction-conversant-request.json b/src/test/resources/org/prebid/server/it/openrtb2/conversant/test-auction-conversant-request.json index 22bfe67895f..3ceceeb9a61 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/conversant/test-auction-conversant-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/conversant/test-auction-conversant-request.json @@ -79,12 +79,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/conversant/test-conversant-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/conversant/test-conversant-bid-request.json index 2cf39df5f37..bf1337d38fc 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/conversant/test-conversant-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/conversant/test-conversant-bid-request.json @@ -14,7 +14,7 @@ "h": 600 }, "displaymanager": "prebid-s2s", - "displaymanagerver": "1.0.1", + "displaymanagerver": "2.0.0", "ext": { "bidder": { "site_id": "siteId" @@ -31,7 +31,7 @@ "h": 600 }, "displaymanager": "prebid-s2s", - "displaymanagerver": "1.0.1", + "displaymanagerver": "2.0.0", "ext": { "bidder": { "site_id": "siteId" @@ -61,11 +61,6 @@ "user": { "buyeruid": "CV-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -110,4 +105,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/cpmstar/test-auction-cpmstar-request.json b/src/test/resources/org/prebid/server/it/openrtb2/cpmstar/test-auction-cpmstar-request.json index 47bc7bde079..68f0b7c91d3 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/cpmstar/test-auction-cpmstar-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/cpmstar/test-auction-cpmstar-request.json @@ -83,12 +83,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/cpmstar/test-cpmstar-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/cpmstar/test-cpmstar-bid-request-1.json index b3d811045e6..a07e42f638d 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/cpmstar/test-cpmstar-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/cpmstar/test-cpmstar-bid-request-1.json @@ -56,12 +56,7 @@ "user": { "buyeruid": "CS-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-request.json b/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-request.json index ea69921948e..a3edebf4a84 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-request.json @@ -81,12 +81,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-response.json b/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-response.json index 2f25dda7869..66ddb8803ef 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-response.json @@ -103,13 +103,13 @@ "datablocks": [ { "uri": "{{ datablocks.exchange_uri }}?sid=2", - "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"impId002\",\"video\":{\"mimes\":[\"video/mp4\"],\"w\":300,\"h\":250,\"pos\":1},\"ext\":{\"bidder\":{\"host\":\"localhost:8090\",\"sourceId\":2}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"DB-UID\",\"ext\":{\"consent\":\"consentValue\",\"digitrust\":{\"id\":\"id\",\"keyv\":123,\"pref\":0}}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", + "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"impId002\",\"video\":{\"mimes\":[\"video/mp4\"],\"w\":300,\"h\":250,\"pos\":1},\"ext\":{\"bidder\":{\"host\":\"localhost:8090\",\"sourceId\":2}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"DB-UID\",\"ext\":{\"consent\":\"consentValue\"}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", "responsebody": "{\"id\":\"tid\",\"seatbid\":[{\"bid\":[{\"id\":\"bid002\",\"impid\":\"impId002\",\"price\":9.99,\"crid\":\"crid002\",\"cid\":\"cid002\",\"adomain\":[\"psacentral.org\"],\"h\":250,\"w\":300}],\"seat\":\"datablocks\"}]}", "status": 200 }, { "uri": "{{ datablocks.exchange_uri }}?sid=1", - "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"impId001\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}]},\"ext\":{\"bidder\":{\"host\":\"localhost:8090\",\"sourceId\":1}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"DB-UID\",\"ext\":{\"consent\":\"consentValue\",\"digitrust\":{\"id\":\"id\",\"keyv\":123,\"pref\":0}}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", + "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"impId001\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}]},\"ext\":{\"bidder\":{\"host\":\"localhost:8090\",\"sourceId\":1}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"DB-UID\",\"ext\":{\"consent\":\"consentValue\"}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", "responsebody": "{\"id\":\"tid\",\"seatbid\":[{\"bid\":[{\"id\":\"bid001\",\"impid\":\"impId001\",\"price\":7.77,\"adid\":\"adid001\",\"crid\":\"crid001\",\"cid\":\"cid001\",\"adm\":\"adm001\",\"h\":250,\"w\":300}],\"seat\":\"datablocks\"}]}", "status": 200 } @@ -173,12 +173,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-datablocks-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-datablocks-bid-request-1.json index fda6ba6af81..d83e947f165 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-datablocks-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-datablocks-bid-request-1.json @@ -40,12 +40,7 @@ "user": { "buyeruid": "DB-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-datablocks-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-datablocks-bid-request-2.json index a6ed8c70eeb..0352ce9e783 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-datablocks-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-datablocks-bid-request-2.json @@ -40,12 +40,7 @@ "user": { "buyeruid": "DB-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-auction-deepintent-request.json b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-auction-deepintent-request.json new file mode 100644 index 00000000000..e7507d0e050 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-auction-deepintent-request.json @@ -0,0 +1,62 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "displaymanager" : "di_prebid", + "displaymanagerver" : "2.0.0", + "tagid" : "possibleTagId", + "ext": { + "deepintent": { + "tagId": "possibleTagId" + } + } + } + ], + "device": { + "ua": "userAgent", + "ip": "193.168.244.1" + }, + "site": { + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000 + } + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-auction-deepintent-response.json b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-auction-deepintent-response.json new file mode 100644 index 00000000000..25d77da5ec2 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-auction-deepintent-response.json @@ -0,0 +1,53 @@ +{ + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "testid", + "impid": "testimpid", + "price": 0.01, + "adid": "2068416", + "cid": "8048", + "crid": "24080", + "ext": { + "prebid": { + "type": "banner", + "targeting": { + "hb_pb": "0.00", + "hb_cache_id_deepintent": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_bidder_deepintent": "deepintent", + "hb_bidder": "deepintent", + "hb_cache_id": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_pb_deepintent": "0.00", + "hb_cache_host": "{{ cache.host }}", + "hb_cache_host_deepintent": "{{ cache.host }}", + "hb_cache_path": "{{ cache.path }}", + "hb_cache_path_deepintent": "{{ cache.path }}" + }, + "cache": { + "bids": { + "url": "{{ cache.resource_url }}3c0769d8-0dd9-465c-8bf3-f570605ba698", + "cacheId": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + } + } + } + } + ], + "seat": "deepintent", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "deepintent": "{{ deepintent.response_time_ms }}", + "cache": "{{ cache.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 1000 + }, + "tmaxrequest": 1000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-cache-deepintent-request.json b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-cache-deepintent-request.json new file mode 100644 index 00000000000..ca8e3ab2f6a --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-cache-deepintent-request.json @@ -0,0 +1,15 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-cache-deepintent-response.json b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-cache-deepintent-response.json new file mode 100644 index 00000000000..c0100536be1 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-cache-deepintent-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-deepintent-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-deepintent-bid-request.json new file mode 100644 index 00000000000..74055235383 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-deepintent-bid-request.json @@ -0,0 +1,76 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "displaymanager" : "di_prebid", + "displaymanagerver" : "2.0.0", + "tagid" : "possibleTagId", + "ext": { + "bidder": { + "tagId": "possibleTagId" + } + } + + } + ], + "site": { + "domain": "example.com", + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "userAgent", + "ip": "193.168.244.1" + }, + "user": { + "buyeruid": "DI-UID" + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000, + "channel": { + "name": "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-deepintent-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-deepintent-bid-response.json new file mode 100644 index 00000000000..ca4e6ee1db4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/deepintent/test-deepintent-bid-response.json @@ -0,0 +1,18 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + ], + "type": "banner" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/dmx/test-auction-dmx-request.json b/src/test/resources/org/prebid/server/it/openrtb2/dmx/test-auction-dmx-request.json index 01774409106..356d83d4fa6 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/dmx/test-auction-dmx-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/dmx/test-auction-dmx-request.json @@ -74,14 +74,20 @@ "fd": 1, "tid": "tid" }, + "user": { "ext": { "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "eids": [ + { + "source": "adserver.org", + "uids": [ + { + "id": "id" + } + ] + } + ] } }, "regs": { @@ -123,4 +129,4 @@ "auctiontimestamp": 1000 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/dmx/test-dmx-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/dmx/test-dmx-bid-request.json index df6f7d0fe44..444460c60f3 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/dmx/test-dmx-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/dmx/test-dmx-bid-request.json @@ -71,11 +71,16 @@ "buyeruid": "DM-UID", "ext": { "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "eids": [ + { + "source": "adserver.org", + "uids": [ + { + "id": "id" + } + ] + } + ] } }, "at": 1, @@ -129,4 +134,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-auction-emxdigital-request.json b/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-auction-emxdigital-request.json index 7c9afda64d7..9f0db45cbbc 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-auction-emxdigital-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-auction-emxdigital-request.json @@ -47,10 +47,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, @@ -73,11 +69,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-auction-emxdigital-response.json b/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-auction-emxdigital-response.json index 9c5c067a286..1eb31ec7cf8 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-auction-emxdigital-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-auction-emxdigital-response.json @@ -50,7 +50,7 @@ "emx_digital": [ { "uri": "{{ emx_digital.exchange_uri }}?t=1000&ts=2060541160", - "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"uuid\",\"banner\":{\"format\":[],\"w\":300,\"h\":250},\"tagid\":\"25251\",\"secure\":0}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"Android Chrome/60\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"ext\":{\"consent\":\"consentValue\",\"digitrust\":{\"id\":\"id\",\"keyv\":123,\"pref\":0}}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"aliases\":{\"appnexusAlias\":\"appnexus\",\"conversantAlias\":\"conversant\"},\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", + "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"uuid\",\"banner\":{\"format\":[],\"w\":300,\"h\":250},\"tagid\":\"25251\",\"secure\":0,\"ext\":{\"bidder\":{\"tagid\":\"25251\"}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"Android Chrome/60\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"ext\":{\"consent\":\"consentValue\"}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", "responsebody": "{\"id\":\"some_test_auction\",\"seatbid\":[{\"seat\":\"12356\",\"bid\":[{\"id\":\"uuid\",\"adm\":\"

\",\"impid\":\"uuid\",\"ttl\":300,\"crid\":\"94395500\",\"w\":300,\"price\":2.942808,\"adid\":\"94395500\",\"h\":250}]}],\"cur\":\"USD\"}", "status": 200 } @@ -104,11 +104,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -129,10 +124,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-emxdigital-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-emxdigital-bid-request.json index cb4802104a4..8b819c1bb3e 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-emxdigital-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/emxdigital/test-emxdigital-bid-request.json @@ -46,10 +46,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-auction-engagebdr-request.json b/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-auction-engagebdr-request.json index 22d183ef720..ea9428f01b7 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-auction-engagebdr-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-auction-engagebdr-request.json @@ -74,12 +74,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-engagebdr-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-engagebdr-bid-request-1.json index ea0cb1d65d6..1126f469c70 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-engagebdr-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-engagebdr-bid-request-1.json @@ -35,12 +35,7 @@ "user": { "buyeruid": "EG-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-engagebdr-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-engagebdr-bid-request-2.json index 1317bdc2578..6ffe58b473f 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-engagebdr-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/engagebdr/test-engagebdr-bid-request-2.json @@ -39,12 +39,7 @@ "user": { "buyeruid": "EG-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/eplanning/test-auction-eplanning-request.json b/src/test/resources/org/prebid/server/it/openrtb2/eplanning/test-auction-eplanning-request.json index aae85c34bbc..f9217cad610 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/eplanning/test-auction-eplanning-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/eplanning/test-auction-eplanning-request.json @@ -63,12 +63,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-auction-facebook-request.json b/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-auction-facebook-request.json index 3af581f91a6..c0133c4cab9 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-auction-facebook-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-auction-facebook-request.json @@ -91,12 +91,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-1.json index 92524585708..b65befa9ae0 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-1.json @@ -26,12 +26,7 @@ "user": { "buyeruid": "FB-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-2.json index 9a182f31169..91e8b766567 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-2.json @@ -30,12 +30,7 @@ "user": { "buyeruid": "FB-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-3.json b/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-3.json index 1a2952a99d4..6ebeb687006 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-3.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/facebook/test-facebook-bid-request-3.json @@ -26,11 +26,6 @@ "user": { "buyeruid": "FB-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/gamma/test-auction-gamma-request.json b/src/test/resources/org/prebid/server/it/openrtb2/gamma/test-auction-gamma-request.json index ed18110b4b9..79472812715 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/gamma/test-auction-gamma-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/gamma/test-auction-gamma-request.json @@ -69,11 +69,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/gamoshi/test-auction-gamoshi-request.json b/src/test/resources/org/prebid/server/it/openrtb2/gamoshi/test-auction-gamoshi-request.json index cbb9986d15f..ddcdd5b3e2c 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/gamoshi/test-auction-gamoshi-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/gamoshi/test-auction-gamoshi-request.json @@ -81,12 +81,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/gamoshi/test-gamoshi-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/gamoshi/test-gamoshi-bid-request-1.json index a7d7e0f525b..e1af7fe1880 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/gamoshi/test-gamoshi-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/gamoshi/test-gamoshi-bid-request-1.json @@ -60,11 +60,6 @@ "user": { "buyeruid": "GM-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/grid/test-auction-grid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/grid/test-auction-grid-request.json index e5dca974590..6ea2e260623 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/grid/test-auction-grid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/grid/test-auction-grid-request.json @@ -62,12 +62,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/grid/test-grid-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/grid/test-grid-bid-request-1.json index ed007d4c297..59837eb72e4 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/grid/test-grid-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/grid/test-grid-bid-request-1.json @@ -39,11 +39,6 @@ "user": { "buyeruid": "GRID-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/gumgum/test-auction-gumgum-request.json b/src/test/resources/org/prebid/server/it/openrtb2/gumgum/test-auction-gumgum-request.json index 0f7bd5cd45e..380e5d38f4b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/gumgum/test-auction-gumgum-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/gumgum/test-auction-gumgum-request.json @@ -103,13 +103,9 @@ } }, "user": { + "buyeruid" : "GUM-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { @@ -117,4 +113,4 @@ "gdpr": 0 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/gumgum/test-gumgum-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/gumgum/test-gumgum-bid-request-1.json index 62062dd5d81..7ff815c64da 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/gumgum/test-gumgum-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/gumgum/test-gumgum-bid-request-1.json @@ -82,13 +82,9 @@ "ifa": "ifaId" }, "user": { + "buyeruid" : "GUM-UID", "ext": { - "consent" : "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, @@ -132,4 +128,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/improvedigital/test-auction-improvedigital-request.json b/src/test/resources/org/prebid/server/it/openrtb2/improvedigital/test-auction-improvedigital-request.json index 203fcea22a9..d511bb16b6f 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/improvedigital/test-auction-improvedigital-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/improvedigital/test-auction-improvedigital-request.json @@ -66,12 +66,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/improvedigital/test-improvedigital-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/improvedigital/test-improvedigital-bid-request-1.json index a10b790fcad..09055b884ef 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/improvedigital/test-improvedigital-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/improvedigital/test-improvedigital-bid-request-1.json @@ -43,11 +43,6 @@ "user": { "buyeruid": "ID-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-auction-invibes-request.json b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-auction-invibes-request.json new file mode 100644 index 00000000000..ac19fc93b16 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-auction-invibes-request.json @@ -0,0 +1,85 @@ +{ + "id": "tid", + "imp": [ + { + "id": "impId001", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "tagid": "2eb6bd58-865c-47ce-af7f-a918108c3fd2", + "ext": { + "invibes": { + "placementId": "plcId", + "domainId": 1001, + "debug": { + "testBvid": "", + "testLog": false + } + } + } + } + ], + "device": { + "pxratio": 4.2, + "dnt": 2, + "ip": "193.168.244.1", + "language": "en", + "ifa": "ifaId", + "ua": "userAgent" + }, + "site": { + "domain": "example.com", + "ext": { + "amp": 0 + }, + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 3000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "user": { + "ext": { + "consent": "consentValue" + } + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "includebidderkeys": true, + "includewinners": true, + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-auction-invibes-response.json b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-auction-invibes-response.json new file mode 100644 index 00000000000..f013f8816aa --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-auction-invibes-response.json @@ -0,0 +1,58 @@ +{ + "id":"tid", + "seatbid":[ + { + "bid":[ + { + "id":"bid001", + "impid":"impId001", + "price":1.3, + "adm":"adm001", + "adid":"adid001", + "cid":"cid001", + "crid":"crid001", + "w":300, + "h":250, + "ext":{ + "prebid":{ + "type":"banner", + "targeting":{ + "hb_pb_invibes":"1.30", + "hb_cache_id_invibes":"f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "hb_bidder_invibes":"invibes", + "hb_cache_id":"f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "hb_pb":"1.30", + "hb_cache_path":"/cache", + "hb_size":"300x250", + "hb_bidder":"invibes", + "hb_size_invibes":"300x250", + "hb_cache_host":"{{ cache.host }}", + "hb_cache_path_invibes":"{{ cache.path }}", + "hb_cache_host_invibes": "{{ cache.host }}" + }, + "cache":{ + "bids":{ + "url":"http://localhost:8090/cache?uuid=f0ab9105-cb21-4e59-b433-70f5ad6671cb", + "cacheId":"f0ab9105-cb21-4e59-b433-70f5ad6671cb" + } + } + } + } + } + ], + "seat":"invibes", + "group":0 + } + ], + "cur":"USD", + "ext":{ + "responsetimemillis":{ + "cache":"{{ cache.response_time_ms }}", + "invibes":"{{ invibes.response_time_ms }}" + }, + "tmaxrequest":3000, + "prebid":{ + "auctiontimestamp":1000 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-cache-invibes-request.json b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-cache-invibes-request.json new file mode 100644 index 00000000000..7007994992c --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-cache-invibes-request.json @@ -0,0 +1,18 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "id": "bid001", + "impid": "impId001", + "price": 1.3, + "adm": "adm001", + "adid" : "adid001", + "cid" : "cid001", + "crid" : "crid001", + "w" : 300, + "h" : 250 + } + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-cache-invibes-response.json b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-cache-invibes-response.json new file mode 100644 index 00000000000..93d0b8de2cd --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-cache-invibes-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "f0ab9105-cb21-4e59-b433-70f5ad6671cb" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-invibes-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-invibes-bid-request.json new file mode 100644 index 00000000000..5f5a1df81d2 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-invibes-bid-request.json @@ -0,0 +1,10 @@ +{ + "BidParamsJson" :"{\"PlacementIds\":[\"plcId\"],\"BidVersion\":\"4\",\"Properties\":{\"plcId\":{\"Formats\":[{\"w\":300,\"h\":250}],\"ImpID\":\"impId001\"}}}", + "Location" :"http://www.example.com", + "Lid" : "IV-UID", + "IsTestBid" : false, + "GdprConsent" :"consentValue", + "Gdpr" : false, + "InvibBVLog" : false, + "VideoAdDebug" : false +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-invibes-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-invibes-bid-response.json new file mode 100644 index 00000000000..bee6af29e05 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/invibes/test-invibes-bid-response.json @@ -0,0 +1,19 @@ +{ + "currency": "USD", + "typedBids": [ + { + "bid": { + "id": "bid001", + "impid": "impId001", + "price": 1.3, + "adid": "adid001", + "crid": "crid001", + "cid": "cid001", + "adm": "adm001", + "h": 250, + "w": 300 + }, + "dealPriority": 12 + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-auction-ix-request.json b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-auction-ix-request.json index d243d9ad735..649ff43cfc1 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-auction-ix-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-auction-ix-request.json @@ -38,7 +38,7 @@ "at": 1, "tmax": 5000, "cur": [ - "USD" + "EUR" ], "source": { "fd": 1, @@ -68,12 +68,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { @@ -81,4 +76,4 @@ "gdpr": 0 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-auction-ix-response.json b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-auction-ix-response.json index 1bd080ba4cc..4d09ed53984 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-auction-ix-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-auction-ix-response.json @@ -6,7 +6,7 @@ { "id": "975135373", "impid": "impId6", - "price": 4.75, + "price": 4.125, "adm": "adm6", "crid": "crid6", "w": 300, @@ -15,10 +15,10 @@ "prebid": { "type": "banner", "targeting": { - "hb_pb_ix": "4.70", + "hb_pb_ix": "4.10", "hb_cache_id": "3bd85b54-a5c5-4852-956e-44e8a7b6b5bc", "hb_bidder_ix": "ix", - "hb_pb": "4.70", + "hb_pb": "4.10", "hb_size_ix": "300x250", "hb_cache_path": "{{ cache.path }}", "hb_cache_path_ix": "{{ cache.path }}", @@ -42,7 +42,7 @@ "group": 0 } ], - "cur": "USD", + "cur": "EUR", "ext": { "responsetimemillis": { "ix": "{{ ix.response_time_ms }}", diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-cache-ix-request.json b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-cache-ix-request.json index b624459a59f..515ce3171c0 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-cache-ix-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-cache-ix-request.json @@ -5,7 +5,7 @@ "value": { "id": "975135373", "impid": "impId6", - "price": 4.75, + "price": 4.125, "adm": "adm6", "crid": "crid6", "w": 300, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-request-1.json index bf900503714..01cfbd3b728 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-request-1.json @@ -42,18 +42,13 @@ "user": { "buyeruid": "IE-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, "at": 1, "tmax": 5000, "cur": [ - "USD" + "EUR" ], "source": { "fd": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-request-2.json index 422a99a2df1..f75ca1d4437 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-request-2.json @@ -42,18 +42,13 @@ "user": { "buyeruid": "IE-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, "at": 1, "tmax": 5000, "cur": [ - "USD" + "EUR" ], "source": { "fd": 1, @@ -91,4 +86,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-response-1.json b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-response-1.json index df1dd17699a..b96c0d698c5 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-response-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ix/test-ix-bid-response-1.json @@ -6,7 +6,7 @@ { "id": "975135373", "impid": "impId6", - "price": 4.75, + "price": 4.7, "adm": "adm6", "crid": "crid6" } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-auction-kidoz-request.json b/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-auction-kidoz-request.json index 5f14035ebc2..c23f9b8cbab 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-auction-kidoz-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-auction-kidoz-request.json @@ -93,12 +93,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-kidoz-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-kidoz-bid-request-1.json index 18ea5c6ace0..4642e4ee4c5 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-kidoz-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-kidoz-bid-request-1.json @@ -40,12 +40,7 @@ "user": { "buyeruid": "KZ-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-kidoz-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-kidoz-bid-request-2.json index 163ea170416..1001ba1ae91 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-kidoz-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/kidoz/test-kidoz-bid-request-2.json @@ -43,12 +43,7 @@ "user": { "buyeruid": "KZ-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-auction-krushmedia-request.json b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-auction-krushmedia-request.json new file mode 100644 index 00000000000..1c57f457716 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-auction-krushmedia-request.json @@ -0,0 +1,62 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "ext": { + "krushmedia": { + "key": "testValue" + } + }, + "tagid": "impId021" + } + ], + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "site": { + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000 + } + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-auction-krushmedia-response.json b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-auction-krushmedia-response.json new file mode 100644 index 00000000000..22e48c8f0b4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-auction-krushmedia-response.json @@ -0,0 +1,53 @@ +{ + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "testid", + "impid": "testimpid", + "price": 0.01, + "adid": "2068416", + "cid": "8048", + "crid": "24080", + "ext": { + "prebid": { + "type": "banner", + "targeting": { + "hb_pb": "0.00", + "hb_cache_id_krushmedia": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_bidder_krushmedia": "krushmedia", + "hb_bidder": "krushmedia", + "hb_cache_id": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_pb_krushmedia": "0.00", + "hb_cache_host": "{{ cache.host }}", + "hb_cache_host_krushmedia": "{{ cache.host }}", + "hb_cache_path": "{{ cache.path }}", + "hb_cache_path_krushmedia": "{{ cache.path }}" + }, + "cache": { + "bids": { + "url": "{{ cache.resource_url }}3c0769d8-0dd9-465c-8bf3-f570605ba698", + "cacheId": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + } + } + } + } + ], + "seat": "krushmedia", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "krushmedia": "{{ krushmedia.response_time_ms }}", + "cache": "{{ cache.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 1000 + }, + "tmaxrequest": 1000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-cache-krushmedia-request.json b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-cache-krushmedia-request.json new file mode 100644 index 00000000000..ca8e3ab2f6a --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-cache-krushmedia-request.json @@ -0,0 +1,15 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-cache-krushmedia-response.json b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-cache-krushmedia-response.json new file mode 100644 index 00000000000..c0100536be1 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-cache-krushmedia-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-krushmedia-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-krushmedia-bid-request.json new file mode 100644 index 00000000000..0c095490aa8 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-krushmedia-bid-request.json @@ -0,0 +1,70 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "tagid": "impId021" + } + ], + "site": { + "domain": "example.com", + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "user": { + "buyeruid": "KM-UID" + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000, + "channel": { + "name": "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-krushmedia-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-krushmedia-bid-response.json new file mode 100644 index 00000000000..ca4e6ee1db4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/krushmedia/test-krushmedia-bid-response.json @@ -0,0 +1,18 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + ], + "type": "banner" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-request.json b/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-request.json index 2120605003c..a2d90139b66 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-request.json @@ -43,10 +43,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, @@ -69,12 +65,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-response.json b/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-response.json index e0660e9e4e3..22af329541c 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-auction-kubient-response.json @@ -62,7 +62,7 @@ "kubient": [ { "uri": "{{ kubient.exchange_uri }}", - "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"test-imp-banner-id\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}],\"w\":500,\"h\":400},\"ext\":{\"bidder\":{\"zoneid\":\"9042\"}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"ext\":{\"consent\":\"consentValue\",\"digitrust\":{\"id\":\"id\",\"keyv\":123,\"pref\":0}}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"aliases\":{\"appnexusAlias\":\"appnexus\",\"conversantAlias\":\"conversant\"},\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", + "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"test-imp-banner-id\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}],\"w\":500,\"h\":400},\"ext\":{\"bidder\":{\"zoneid\":\"9042\"}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"ext\":{\"consent\":\"consentValue\"}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", "responsebody": "{\"id\":\"tid\",\"seatbid\":[{\"bid\":[{\"id\":\"7706636740145184841\",\"impid\":\"test-imp-banner-id\",\"price\":0.5,\"adid\":\"29681110\",\"adm\":\"some-test-ad\",\"adomain\":[\"advertsite.com\"],\"cid\":\"772\",\"crid\":\"29681110\",\"h\":576,\"w\":1024}]}]}", "status": 200 } @@ -110,11 +110,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -135,10 +130,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-kubient-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-kubient-bid-request-1.json index 22bb47d2aec..30fc51dafc9 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-kubient-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/kubient/test-kubient-bid-request-1.json @@ -40,11 +40,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -65,10 +60,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-auction-lifestreet-request.json b/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-auction-lifestreet-request.json index ce8c289d1b2..6088fe8c279 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-auction-lifestreet-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-auction-lifestreet-request.json @@ -79,12 +79,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-lifestreet-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-lifestreet-bid-request-1.json index d09c7d601b3..4a2a5c7ad2f 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-lifestreet-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-lifestreet-bid-request-1.json @@ -36,11 +36,6 @@ "user": { "buyeruid": "LS-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-lifestreet-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-lifestreet-bid-request-2.json index 2be68d0431f..ba3bfcd9393 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-lifestreet-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/lifestreet/test-lifestreet-bid-request-2.json @@ -39,11 +39,6 @@ "user": { "buyeruid": "LS-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/lockerdome/test-auction-lockerdome-request.json b/src/test/resources/org/prebid/server/it/openrtb2/lockerdome/test-auction-lockerdome-request.json index 7a914dac341..873ee9b8631 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/lockerdome/test-auction-lockerdome-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/lockerdome/test-auction-lockerdome-request.json @@ -62,12 +62,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/lockerdome/test-lockerdome-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/lockerdome/test-lockerdome-bid-request.json index dff9878bef9..76ec286f60b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/lockerdome/test-lockerdome-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/lockerdome/test-lockerdome-bid-request.json @@ -39,11 +39,6 @@ "user": { "buyeruid": "LD-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/logicad/test-auction-logicad-request.json b/src/test/resources/org/prebid/server/it/openrtb2/logicad/test-auction-logicad-request.json index af7b053eeae..19c76cc4529 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/logicad/test-auction-logicad-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/logicad/test-auction-logicad-request.json @@ -69,12 +69,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/logicad/test-logicad-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/logicad/test-logicad-bid-request.json index 1d60d5783ab..9e7a534c4f9 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/logicad/test-logicad-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/logicad/test-logicad-bid-request.json @@ -41,12 +41,7 @@ "user": { "buyeruid": "LC-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, @@ -90,4 +85,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/lunamedia/test-auction-lunamedia-request.json b/src/test/resources/org/prebid/server/it/openrtb2/lunamedia/test-auction-lunamedia-request.json index 38d001f51c7..f3322195185 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/lunamedia/test-auction-lunamedia-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/lunamedia/test-auction-lunamedia-request.json @@ -70,12 +70,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { @@ -83,4 +78,4 @@ "gdpr": 0 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/lunamedia/test-lunamedia-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/lunamedia/test-lunamedia-bid-request.json index d49a9b375c4..4547b4f6393 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/lunamedia/test-lunamedia-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/lunamedia/test-lunamedia-bid-request.json @@ -36,14 +36,9 @@ "ifa": "ifaId" }, "user": { - "buyeruid" : "LM-UID", + "buyeruid": "LM-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, @@ -87,4 +82,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/marsmedia/test-auction-marsmedia-request.json b/src/test/resources/org/prebid/server/it/openrtb2/marsmedia/test-auction-marsmedia-request.json index 2db8cc2a6df..fb335dd6c69 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/marsmedia/test-auction-marsmedia-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/marsmedia/test-auction-marsmedia-request.json @@ -77,12 +77,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/marsmedia/test-marsmedia-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/marsmedia/test-marsmedia-bid-request-1.json index 1e2bf2a5aac..4a0c0913910 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/marsmedia/test-marsmedia-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/marsmedia/test-marsmedia-bid-request-1.json @@ -56,11 +56,6 @@ "user": { "buyeruid": "MM-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/mgid/test-auction-mgid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/mgid/test-auction-mgid-request.json index 7691fce4060..8b93a756fe1 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/mgid/test-auction-mgid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/mgid/test-auction-mgid-request.json @@ -69,12 +69,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/mgid/test-mgid-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/mgid/test-mgid-bid-request.json index be9a8a5654e..f301e145230 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/mgid/test-mgid-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/mgid/test-mgid-bid-request.json @@ -49,12 +49,7 @@ "user": { "buyeruid": "MGID-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/mobilefuse/test-auction-mobilefuse-request.json b/src/test/resources/org/prebid/server/it/openrtb2/mobilefuse/test-auction-mobilefuse-request.json index 6b0cae4bf6f..326188434f0 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/mobilefuse/test-auction-mobilefuse-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/mobilefuse/test-auction-mobilefuse-request.json @@ -50,12 +50,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/mobilefuse/test-mobilefuse-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/mobilefuse/test-mobilefuse-bid-request.json index 225a0e57171..31b5c38798c 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/mobilefuse/test-mobilefuse-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/mobilefuse/test-mobilefuse-bid-request.json @@ -35,12 +35,7 @@ "user": { "buyeruid": "MF-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, @@ -94,4 +89,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nanointeractive/test-auction-nanointeractive-request.json b/src/test/resources/org/prebid/server/it/openrtb2/nanointeractive/test-auction-nanointeractive-request.json index 4399365e153..4a55209e63a 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/nanointeractive/test-auction-nanointeractive-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/nanointeractive/test-auction-nanointeractive-request.json @@ -100,12 +100,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nanointeractive/test-nanointeractive-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/nanointeractive/test-nanointeractive-bid-request-1.json index 2cbb8090222..2934f223725 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/nanointeractive/test-nanointeractive-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/nanointeractive/test-nanointeractive-bid-request-1.json @@ -72,12 +72,7 @@ "user": { "buyeruid": "NI-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ninthdecimal/test-auction-ninthdecimal-request.json b/src/test/resources/org/prebid/server/it/openrtb2/ninthdecimal/test-auction-ninthdecimal-request.json index dae0737f694..d83bea50931 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ninthdecimal/test-auction-ninthdecimal-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ninthdecimal/test-auction-ninthdecimal-request.json @@ -70,12 +70,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ninthdecimal/test-ninthdecimal-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/ninthdecimal/test-ninthdecimal-bid-request.json index c262def4797..bc2e18078f7 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ninthdecimal/test-ninthdecimal-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ninthdecimal/test-ninthdecimal-bid-request.json @@ -38,12 +38,7 @@ "user": { "buyeruid": "ND-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, @@ -87,4 +82,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-request.json new file mode 100644 index 00000000000..69a50977e20 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-request.json @@ -0,0 +1,63 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "ext": { + "nobid": { + "siteId": 23, + "placementId": 25 + } + }, + "tagid": "impId021" + } + ], + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "site": { + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000 + } + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-response.json new file mode 100644 index 00000000000..4e20fc3207b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-response.json @@ -0,0 +1,53 @@ +{ + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "testid", + "impid": "testimpid", + "price": 0.01, + "adid": "2068416", + "cid": "8048", + "crid": "24080", + "ext": { + "prebid": { + "type": "banner", + "targeting": { + "hb_pb": "0.00", + "hb_cache_id_nobid": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_bidder_nobid": "nobid", + "hb_bidder": "nobid", + "hb_cache_id": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_pb_nobid": "0.00", + "hb_cache_host": "{{ cache.host }}", + "hb_cache_host_nobid": "{{ cache.host }}", + "hb_cache_path": "{{ cache.path }}", + "hb_cache_path_nobid": "{{ cache.path }}" + }, + "cache": { + "bids": { + "url": "{{ cache.resource_url }}3c0769d8-0dd9-465c-8bf3-f570605ba698", + "cacheId": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + } + } + } + } + ], + "seat": "nobid", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "nobid": "{{ nobid.response_time_ms }}", + "cache": "{{ cache.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 1000 + }, + "tmaxrequest": 1000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-request.json new file mode 100644 index 00000000000..ca8e3ab2f6a --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-request.json @@ -0,0 +1,15 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-response.json new file mode 100644 index 00000000000..c0100536be1 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-request.json new file mode 100644 index 00000000000..e0868c03cee --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-request.json @@ -0,0 +1,76 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "tagid": "impId021", + "ext": { + "bidder": { + "siteId" : 23, + "placementId" : 25 + } + } + } + ], + "site": { + "domain": "example.com", + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "user": { + "buyeruid": "NB-UID" + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000, + "channel": { + "name": "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-response.json new file mode 100644 index 00000000000..ca4e6ee1db4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-response.json @@ -0,0 +1,18 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + ], + "type": "banner" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-request.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-request.json index da5a20c5084..0c573d26446 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-request.json @@ -135,12 +135,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-1.json index c765d75a28f..bd909861224 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-1.json @@ -63,11 +63,6 @@ "user": { "buyeruid": "OX-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-2.json index c12f7c9fb77..de95eb016a6 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-2.json @@ -41,11 +41,6 @@ "user": { "buyeruid": "OX-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-3.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-3.json index 4b19cfe27a3..c5a2e86a49e 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-3.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-bid-request-3.json @@ -41,11 +41,6 @@ "user": { "buyeruid":"OX-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/orbidder/test-auction-orbidder-request.json b/src/test/resources/org/prebid/server/it/openrtb2/orbidder/test-auction-orbidder-request.json index ae6c601f277..583a41dedde 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/orbidder/test-auction-orbidder-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/orbidder/test-auction-orbidder-request.json @@ -50,12 +50,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { @@ -87,4 +82,4 @@ "auctiontimestamp": 1000 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/orbidder/test-orbidder-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/orbidder/test-orbidder-bid-request.json index ec68a1df402..78558170715 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/orbidder/test-orbidder-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/orbidder/test-orbidder-bid-request.json @@ -42,12 +42,7 @@ "user": { "buyeruid": "OB-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, @@ -91,4 +86,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-auction-pubmatic-request.json b/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-auction-pubmatic-request.json index 2799068aef5..3917bd648d5 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-auction-pubmatic-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-auction-pubmatic-request.json @@ -103,12 +103,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-pubmatic-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-pubmatic-bid-request-1.json index 4c77a806ed2..d4a5120aaf7 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-pubmatic-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-pubmatic-bid-request-1.json @@ -54,11 +54,6 @@ "user": { "buyeruid": "PM-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-auction-pubnative-request.json b/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-auction-pubnative-request.json index ce019eb761f..25141633587 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-auction-pubnative-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-auction-pubnative-request.json @@ -93,12 +93,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-1.json index c737950f3f4..4a4f9d894fe 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-1.json @@ -43,12 +43,7 @@ "user": { "buyeruid": "PN-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-2.json index 400020985b1..62e1d9d9061 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-2.json @@ -40,12 +40,7 @@ "user": { "buyeruid": "PN-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-3.json b/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-3.json index c39bbdcc5c9..6a9591a6ce6 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-3.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pubnative/test-pubnative-bid-request-3.json @@ -37,12 +37,7 @@ "user": { "buyeruid": "PN-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pulsepoint/test-auction-pulsepoint-request.json b/src/test/resources/org/prebid/server/it/openrtb2/pulsepoint/test-auction-pulsepoint-request.json index dffa0f808f3..254d3589220 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pulsepoint/test-auction-pulsepoint-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pulsepoint/test-auction-pulsepoint-request.json @@ -86,12 +86,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pulsepoint/test-pulsepoint-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/pulsepoint/test-pulsepoint-bid-request-1.json index ec4ef146bd1..270c71276cb 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pulsepoint/test-pulsepoint-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pulsepoint/test-pulsepoint-bid-request-1.json @@ -65,11 +65,6 @@ "user": { "buyeruid": "PP-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/rhythmone/test-auction-rhythmone-request.json b/src/test/resources/org/prebid/server/it/openrtb2/rhythmone/test-auction-rhythmone-request.json index 8725408d37d..7efe918e2bb 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/rhythmone/test-auction-rhythmone-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/rhythmone/test-auction-rhythmone-request.json @@ -81,12 +81,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/rhythmone/test-rhythmone-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/rhythmone/test-rhythmone-bid-request-1.json index be9655aa778..299b60feba6 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/rhythmone/test-rhythmone-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/rhythmone/test-rhythmone-bid-request-1.json @@ -60,11 +60,6 @@ "user": { "buyeruid": "RO-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/rtbhouse/test-auction-rtbhouse-request.json b/src/test/resources/org/prebid/server/it/openrtb2/rtbhouse/test-auction-rtbhouse-request.json index 388106a0b1f..82b15a0bac1 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/rtbhouse/test-auction-rtbhouse-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/rtbhouse/test-auction-rtbhouse-request.json @@ -63,12 +63,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/rtbhouse/test-rtbhouse-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/rtbhouse/test-rtbhouse-bid-request-1.json index a7e8ecc0fda..c6f6e47a07c 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/rtbhouse/test-rtbhouse-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/rtbhouse/test-rtbhouse-bid-request-1.json @@ -37,12 +37,7 @@ "user": { "buyeruid": "RTBH-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-request.json b/src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-request.json index b65c278477a..2484264b8a9 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-request.json @@ -278,10 +278,6 @@ "user": { "ext": { "consent": "BOEFEAyOEFEAyAHABDENAIgAAAB9vABAASA", - "digitrust": { - "id": "id", - "keyv": 123 - }, "eids": [ { "source": "adserver.org", diff --git a/src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-response.json b/src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-response.json index a7cea58a85a..1683448972d 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-response.json @@ -628,11 +628,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "BOEFEAyOEFEAyAHABDENAIgAAAB9vABAASA", "eids": [ { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/sharethrough/test-auction-sharethrough-request.json b/src/test/resources/org/prebid/server/it/openrtb2/sharethrough/test-auction-sharethrough-request.json index f85ecebe767..073016adb28 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/sharethrough/test-auction-sharethrough-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/sharethrough/test-auction-sharethrough-request.json @@ -57,10 +57,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, @@ -93,11 +89,6 @@ ] } ], - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/sharethrough/test-auction-sharethrough-response.json b/src/test/resources/org/prebid/server/it/openrtb2/sharethrough/test-auction-sharethrough-response.json index 0237cfc3df6..e86ac798d08 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/sharethrough/test-auction-sharethrough-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/sharethrough/test-auction-sharethrough-response.json @@ -121,11 +121,6 @@ ] } ], - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -151,10 +146,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-auction-silvermob-request.json b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-auction-silvermob-request.json new file mode 100644 index 00000000000..bbbde910291 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-auction-silvermob-request.json @@ -0,0 +1,61 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "ext": { + "silvermob": { + "zoneid": "testZoneId", + "host": "testHostValue" + } + }, + "tagid": "impId021" + } + ], + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123" + }, + "site": { + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000 + } + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-auction-silvermob-response.json b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-auction-silvermob-response.json new file mode 100644 index 00000000000..de2439c7f86 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-auction-silvermob-response.json @@ -0,0 +1,53 @@ +{ + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "testid", + "impid": "testimpid", + "price": 0.01, + "adid": "2068416", + "cid": "8048", + "crid": "24080", + "ext": { + "prebid": { + "type": "banner", + "targeting": { + "hb_pb": "0.00", + "hb_cache_id_silvermob": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_bidder_silvermob": "silvermob", + "hb_bidder": "silvermob", + "hb_cache_id": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_pb_silvermob": "0.00", + "hb_cache_host": "{{ cache.host }}", + "hb_cache_host_silvermob": "{{ cache.host }}", + "hb_cache_path": "{{ cache.path }}", + "hb_cache_path_silvermob": "{{ cache.path }}" + }, + "cache": { + "bids": { + "url": "{{ cache.resource_url }}3c0769d8-0dd9-465c-8bf3-f570605ba698", + "cacheId": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + } + } + } + } + ], + "seat": "silvermob", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "silvermob": "{{ silvermob.response_time_ms }}", + "cache": "{{ cache.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 1000 + }, + "tmaxrequest": 1000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-cache-silvermob-request.json b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-cache-silvermob-request.json new file mode 100644 index 00000000000..ca8e3ab2f6a --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-cache-silvermob-request.json @@ -0,0 +1,15 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-cache-silvermob-response.json b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-cache-silvermob-response.json new file mode 100644 index 00000000000..c0100536be1 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-cache-silvermob-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-silvermob-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-silvermob-bid-request.json new file mode 100644 index 00000000000..d713ab3ff08 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-silvermob-bid-request.json @@ -0,0 +1,74 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "tagid": "impId021", + "ext": { + "bidder": { + "zoneid": "testZoneId", + "host": "testHostValue" + } + } + } + ], + "site": { + "domain": "example.com", + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123" + }, + "user": { + "buyeruid": "SM-UID" + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000, + "channel": { + "name": "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-silvermob-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-silvermob-bid-response.json new file mode 100644 index 00000000000..ca4e6ee1db4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/silvermob/test-silvermob-bid-response.json @@ -0,0 +1,18 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + ], + "type": "banner" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-auction-smartadserver-request.json b/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-auction-smartadserver-request.json index 7de3994683c..34abff9aca8 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-auction-smartadserver-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-auction-smartadserver-request.json @@ -46,10 +46,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, @@ -72,12 +68,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-auction-smartadserver-response.json b/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-auction-smartadserver-response.json index 00a73c254e1..f53c1f4dcc4 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-auction-smartadserver-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-auction-smartadserver-response.json @@ -61,8 +61,8 @@ ], "smartadserver": [ { - "uri": "{{ smartadserver.exchange_uri }}?callerId=5", - "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"test-imp-banner-id\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}],\"w\":500,\"h\":400},\"ext\":{\"bidder\":{\"siteId\":1,\"pageId\":2,\"formatId\":3,\"networkId\":73}}}],\"site\":{\"publisher\":{\"id\":\"73\"}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"SA-UID\",\"ext\":{\"consent\":\"consentValue\",\"digitrust\":{\"id\":\"id\",\"keyv\":123,\"pref\":0}}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"aliases\":{\"appnexusAlias\":\"appnexus\",\"conversantAlias\":\"conversant\"},\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", + "uri": "{{ smartadserver.exchange_uri }}/api/bid?callerId=5", + "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"test-imp-banner-id\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}],\"w\":500,\"h\":400},\"ext\":{\"bidder\":{\"siteId\":1,\"pageId\":2,\"formatId\":3,\"networkId\":73}}}],\"site\":{\"publisher\":{\"id\":\"73\"}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"SA-UID\",\"ext\":{\"consent\":\"consentValue\"}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", "responsebody": "{\"id\":\"tid\",\"seatbid\":[{\"bid\":[{\"id\":\"7706636740145184841\",\"impid\":\"test-imp-banner-id\",\"price\":0.5,\"adid\":\"29681110\",\"adm\":\"some-test-ad\",\"adomain\":[\"advertsite.com\"],\"cid\":\"772\",\"crid\":\"29681110\",\"h\":576,\"w\":1024}]}]}", "status": 200 } @@ -113,11 +113,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -138,10 +133,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-smartadserver-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-smartadserver-bid-request-1.json index 115e58fa4b0..d44e20c3b68 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-smartadserver-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/smartadserver/test-smartadserver-bid-request-1.json @@ -39,11 +39,6 @@ "user": { "buyeruid" : "SA-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -64,10 +59,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, @@ -93,4 +84,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-auction-smartrtb-request.json b/src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-auction-smartrtb-request.json index f6caca91bf3..2c6355f4429 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-auction-smartrtb-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-auction-smartrtb-request.json @@ -98,12 +98,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-smartrtb-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-smartrtb-bid-request.json index 841e7745379..e52187cc0b5 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-smartrtb-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/smartrtb/test-smartrtb-bid-request.json @@ -107,12 +107,7 @@ "tmax": 5000, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-auction-somoaudience-request.json b/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-auction-somoaudience-request.json index a7cdb7df279..7234ec3354a 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-auction-somoaudience-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-auction-somoaudience-request.json @@ -116,12 +116,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-1.json index 077c83ddce5..acc41e62f2b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-1.json @@ -47,11 +47,6 @@ "user": { "buyeruid": "SM-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-2.json index d23c70e4ebf..78dae5aebaf 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-2.json @@ -38,11 +38,6 @@ "user": { "buyeruid": "SM-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-3.json b/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-3.json index bca7fa68205..1abac39190a 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-3.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/somoaudience/test-somoaudience-bid-request-3.json @@ -31,11 +31,6 @@ "user": { "buyeruid": "SM-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-auction-sonobi-request.json b/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-auction-sonobi-request.json index 4f8dddb44df..652df4c2d79 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-auction-sonobi-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-auction-sonobi-request.json @@ -77,12 +77,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-sonobi-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-sonobi-bid-request-1.json index 51ed94815c8..51b5e0c2b3a 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-sonobi-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-sonobi-bid-request-1.json @@ -40,12 +40,7 @@ "user": { "buyeruid": "SB-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-sonobi-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-sonobi-bid-request-2.json index bbb3df7405e..a4ac76b8a32 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-sonobi-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/sonobi/test-sonobi-bid-request-2.json @@ -39,12 +39,7 @@ "user": { "buyeruid": "SB-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/sovrn/test-auction-sovrn-request.json b/src/test/resources/org/prebid/server/it/openrtb2/sovrn/test-auction-sovrn-request.json index 77b496bb41e..3c9e555f284 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/sovrn/test-auction-sovrn-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/sovrn/test-auction-sovrn-request.json @@ -64,12 +64,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/sovrn/test-sovrn-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/sovrn/test-sovrn-bid-request-1.json index 3e333fb2f90..ae826e0b486 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/sovrn/test-sovrn-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/sovrn/test-sovrn-bid-request-1.json @@ -42,12 +42,7 @@ "user": { "buyeruid": "990011", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-auction-synacormedia-request.json b/src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-auction-synacormedia-request.json index 839add5a448..635962ae61b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-auction-synacormedia-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-auction-synacormedia-request.json @@ -80,12 +80,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-synacormedia-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-synacormedia-bid-request.json index 836ad96bce4..5468f52bc99 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-synacormedia-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/synacormedia/test-synacormedia-bid-request.json @@ -59,12 +59,7 @@ "user": { "buyeruid": "SCM-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, @@ -82,7 +77,6 @@ } }, "ext": { - "seatId": "228", - "tagId": "demo1" + "seatId": "228" } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/tappx/test-auction-tappx-request.json b/src/test/resources/org/prebid/server/it/openrtb2/tappx/test-auction-tappx-request.json index 47492a49d71..a0dc82ec832 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/tappx/test-auction-tappx-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/tappx/test-auction-tappx-request.json @@ -65,11 +65,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/tappx/test-tappx-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/tappx/test-tappx-bid-request.json index 89ee69285d3..df98570852c 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/tappx/test-tappx-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/tappx/test-tappx-bid-request.json @@ -43,11 +43,6 @@ "user": { "buyeruid": "TX-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/telaria/test-auction-telaria-request.json b/src/test/resources/org/prebid/server/it/openrtb2/telaria/test-auction-telaria-request.json index f98e514064f..2699198f3e3 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/telaria/test-auction-telaria-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/telaria/test-auction-telaria-request.json @@ -91,12 +91,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/telaria/test-telaria-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/telaria/test-telaria-bid-request-1.json index 3fb7054b871..f55efa396a0 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/telaria/test-telaria-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/telaria/test-telaria-bid-request-1.json @@ -44,12 +44,7 @@ "user": { "buyeruid": "TL-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/triplelift/test-auction-triplelift-request.json b/src/test/resources/org/prebid/server/it/openrtb2/triplelift/test-auction-triplelift-request.json index 8a2deca46c7..8a0ce522449 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/triplelift/test-auction-triplelift-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/triplelift/test-auction-triplelift-request.json @@ -62,11 +62,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/triplelift/test-triplelift-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/triplelift/test-triplelift-bid-request.json index 5eb728e4cd9..493d9e71ecc 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/triplelift/test-triplelift-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/triplelift/test-triplelift-bid-request.json @@ -40,11 +40,6 @@ "user": { "buyeruid": "TL-UID", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-request.json b/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-request.json index 7653b419c44..c3c161d62aa 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-request.json @@ -36,10 +36,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, @@ -62,11 +58,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-response.json b/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-response.json index 00a6d4ec1c0..570aefa9feb 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-auction-triplelift-native-response.json @@ -63,7 +63,7 @@ "triplelift_native": [ { "uri": "{{ triplelift_native.exchange_uri }}", - "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"test-imp-id\",\"native\":{\"request\":\"{\\\"ver\\\":\\\"1.1\\\",\\\"context\\\":1,\\\"contextsubtype\\\":11,\\\"plcmttype\\\":4,\\\"plcmtcnt\\\":1,\\\"assets\\\":[{\\\"id\\\":0,\\\"required\\\":1,\\\"title\\\":{\\\"len\\\":500}}]}\"},\"tagid\":\"foo\",\"ext\":{\"bidder\":{\"inventoryCode\":\"foo\"}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"test\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"T\",\"ext\":{\"consent\":\"consentValue\",\"digitrust\":{\"id\":\"id\",\"keyv\":123,\"pref\":0}}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"aliases\":{\"appnexusAlias\":\"appnexus\",\"conversantAlias\":\"conversant\"},\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", + "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"test-imp-id\",\"native\":{\"request\":\"{\\\"ver\\\":\\\"1.1\\\",\\\"context\\\":1,\\\"contextsubtype\\\":11,\\\"plcmttype\\\":4,\\\"plcmtcnt\\\":1,\\\"assets\\\":[{\\\"id\\\":0,\\\"required\\\":1,\\\"title\\\":{\\\"len\\\":500}}]}\"},\"tagid\":\"foo\",\"ext\":{\"bidder\":{\"inventoryCode\":\"foo\"}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"test\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"T\",\"ext\":{\"consent\":\"consentValue\"}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", "responsebody": "{\"id\":\"test-request-id\",\"seatbid\":[{\"seat\":\"958\",\"bid\":[{\"id\":\"7706636740145184841\",\"impid\":\"test-imp-id\",\"price\":0.5,\"adid\":\"29681110\",\"adm\":\"some-test-ad\",\"adomain\":[\"triplelift.com\"],\"iurl\":\"http://nym1-ib.adnxs.com/cr?id=29681110\",\"cid\":\"958\",\"crid\":\"29681110\",\"h\":250,\"w\":300}]}],\"bidid\":\"5778926625248726496\",\"cur\":\"USD\"}", "status": 200 } @@ -104,11 +104,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -129,10 +124,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-triplelift-native-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-triplelift-native-bid-request.json index 439b6474237..d4a22534d32 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-triplelift-native-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/tripleliftnative/test-triplelift-native-bid-request.json @@ -35,11 +35,6 @@ "user": { "buyeruid": "T", "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -60,10 +55,6 @@ "ext": { "prebid": { "debug": 1, - "aliases": { - "appnexusAlias": "appnexus", - "conversantAlias": "conversant" - }, "targeting": { "pricegranularity": { "precision": 2, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ttx/test-auction-ttx-request.json b/src/test/resources/org/prebid/server/it/openrtb2/ttx/test-auction-ttx-request.json index 0e6d21179aa..2a3a461727d 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ttx/test-auction-ttx-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ttx/test-auction-ttx-request.json @@ -64,12 +64,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ttx/test-ttx-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/ttx/test-ttx-bid-request-1.json index 95ee04bedbb..ff0d24bf988 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ttx/test-ttx-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ttx/test-ttx-bid-request-1.json @@ -41,12 +41,7 @@ "user": { "buyeruid": "TTX-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ucfunnel/test-auction-ucfunnel-request.json b/src/test/resources/org/prebid/server/it/openrtb2/ucfunnel/test-auction-ucfunnel-request.json index 8317dba4939..331e6857f42 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ucfunnel/test-auction-ucfunnel-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ucfunnel/test-auction-ucfunnel-request.json @@ -73,12 +73,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/ucfunnel/test-ucfunnel-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/ucfunnel/test-ucfunnel-bid-request.json index 6eb2dec557c..62747e3cc7c 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/ucfunnel/test-ucfunnel-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/ucfunnel/test-ucfunnel-bid-request.json @@ -40,12 +40,7 @@ "user": { "buyeruid": "UF-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-auction-unruly-request.json b/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-auction-unruly-request.json index 0805dd611c1..085bca4c46f 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-auction-unruly-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-auction-unruly-request.json @@ -78,12 +78,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-unruly-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-unruly-bid-request-1.json index f7a7377760f..b3fcaf9705e 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-unruly-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-unruly-bid-request-1.json @@ -39,12 +39,7 @@ "user": { "buyeruid": "UR-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-unruly-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-unruly-bid-request-2.json index 974bf822a1e..96889f14e2b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-unruly-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/unruly/test-unruly-bid-request-2.json @@ -39,12 +39,7 @@ "user": { "buyeruid": "UR-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/valueimpression/test-auction-valueimpression-request.json b/src/test/resources/org/prebid/server/it/openrtb2/valueimpression/test-auction-valueimpression-request.json index c8226ede61c..55afe5c957c 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/valueimpression/test-auction-valueimpression-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/valueimpression/test-auction-valueimpression-request.json @@ -92,12 +92,7 @@ "user": { "buyeruid": "VI-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/valueimpression/test-valueimpression-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/valueimpression/test-valueimpression-bid-request-1.json index ec42d77106c..a59a418916d 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/valueimpression/test-valueimpression-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/valueimpression/test-valueimpression-bid-request-1.json @@ -58,12 +58,7 @@ "user": { "buyeruid": "VI-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-request.json b/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-request.json index af571db17df..a7ea628e575 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-request.json @@ -63,12 +63,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-verizonmedia-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-verizonmedia-bid-request-1.json index ce7df815bbc..50ae26dd237 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-verizonmedia-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-verizonmedia-bid-request-1.json @@ -43,12 +43,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-bid-request-1.json index af712452338..e920fd3d553 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-bid-request-1.json @@ -248,17 +248,29 @@ } }, "device": { - "ua": "userAgent", - "ip": "193.168.244.0" + "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", + "dnt": 33, + "lmt": 44, + "ip": "123.145.167.10", + "devicetype": 1, + "os": "mac os", + "h": 480, + "w": 640, + "ifa": "AA000DFE74168477C70D291f574D344790E0BB11", + "didsha1": "didsha1", + "didmd5": "didmd5", + "dpidsha1": "dpidsha1", + "dpidmd5": "dpidmd5", + "macsha1": "macsha1", + "macmd5": "macmd5" }, "user": { + "buyeruid": "appnexus", "yob": 1991, "gender": "F", - "keywords": "Hotels, Travelling" - }, - "regs": { + "keywords": "Hotels, Travelling", "ext": { - "us_privacy": "1YNN" + "consent": "BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA" } }, "at": 1, @@ -266,6 +278,12 @@ "cur": [ "USD" ], + "regs": { + "ext": { + "gdpr": 1, + "us_privacy": "1YNN" + } + }, "ext": { "prebid": { "targeting": { @@ -283,6 +301,9 @@ }, "cache": { "vastxml": {} + }, + "channel": { + "name": "web" } } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-bid-request-2.json index 991c4ddf098..bbe5da789b4 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-bid-request-2.json @@ -41,17 +41,29 @@ } }, "device": { - "ua": "userAgent", - "ip": "193.168.244.0" + "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", + "dnt": 33, + "lmt": 44, + "ip": "123.145.167.10", + "devicetype": 1, + "os": "mac os", + "h": 480, + "w": 640, + "ifa": "AA000DFE74168477C70D291f574D344790E0BB11", + "didsha1": "didsha1", + "didmd5": "didmd5", + "dpidsha1": "dpidsha1", + "dpidmd5": "dpidmd5", + "macsha1": "macsha1", + "macmd5": "macmd5" }, "user": { + "buyeruid": "appnexus", "yob": 1991, "gender": "F", - "keywords": "Hotels, Travelling" - }, - "regs": { + "keywords": "Hotels, Travelling", "ext": { - "us_privacy": "1YNN" + "consent": "BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA" } }, "at": 1, @@ -59,6 +71,12 @@ "cur": [ "USD" ], + "regs": { + "ext": { + "gdpr": 1, + "us_privacy": "1YNN" + } + }, "ext": { "prebid": { "targeting": { @@ -76,7 +94,10 @@ }, "cache": { "vastxml": {} + }, + "channel": { + "name": "web" } } } -} +} \ No newline at end of file diff --git a/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-request.json b/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-request.json index 8c7abb10755..8de091e7bcb 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-request.json @@ -23,13 +23,8 @@ "page": "prebid.com" }, "user": { - "buyeruids": { - "appnexus": "unique_id_an", - "rubicon": "unique_id_rubi" - }, - "gdpr": { - "consentrequired": false, - "consentstring": "BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA" + "ext": { + "consent": "BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA" }, "yob": 1991, "gender": "F", @@ -37,11 +32,12 @@ }, "regs": { "ext": { + "gdpr": 1, "us_privacy": "1YNN" } }, "tmax": 5000, - "device11": { + "device": { "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", "ip": "123.145.167.10", "devicetype": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-response-empty.json b/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-response-empty.json deleted file mode 100644 index b773ce30155..00000000000 --- a/src/test/resources/org/prebid/server/it/openrtb2/video/test-video-appnexus-response-empty.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "adPods": [] -} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/visx/test-auction-visx-request.json b/src/test/resources/org/prebid/server/it/openrtb2/visx/test-auction-visx-request.json index a39a7602e77..a31f4b23855 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/visx/test-auction-visx-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/visx/test-auction-visx-request.json @@ -70,12 +70,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/visx/test-visx-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/visx/test-visx-bid-request.json index fcee8a54f73..acd4d80c313 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/visx/test-visx-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/visx/test-visx-bid-request.json @@ -47,12 +47,7 @@ "user": { "buyeruid": "VISX-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/vrtcal/test-auction-vrtcal-request.json b/src/test/resources/org/prebid/server/it/openrtb2/vrtcal/test-auction-vrtcal-request.json index c29f63cbb11..6e65e13fb4a 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/vrtcal/test-auction-vrtcal-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/vrtcal/test-auction-vrtcal-request.json @@ -59,12 +59,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/vrtcal/test-vrtcal-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/vrtcal/test-vrtcal-bid-request-1.json index 4437d138db1..7a9dede97f5 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/vrtcal/test-vrtcal-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/vrtcal/test-vrtcal-bid-request-1.json @@ -30,12 +30,7 @@ "user": { "buyeruid": "VR-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yeahmobi/test-auction-yeahmobi-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yeahmobi/test-auction-yeahmobi-request.json index ee088e56217..354d2be8365 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yeahmobi/test-auction-yeahmobi-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yeahmobi/test-auction-yeahmobi-request.json @@ -53,12 +53,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { @@ -100,4 +95,4 @@ "auctiontimestamp": 1000 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yeahmobi/test-yeahmobi-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yeahmobi/test-yeahmobi-bid-request.json index 4ff2144a2bc..b94c172d60b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yeahmobi/test-yeahmobi-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yeahmobi/test-yeahmobi-bid-request.json @@ -44,12 +44,7 @@ "user": { "buyeruid": "YM-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yieldlab/test-auction-yieldlab-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yieldlab/test-auction-yieldlab-request.json index 1b1f1059fed..c53a1e56cb3 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yieldlab/test-auction-yieldlab-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yieldlab/test-auction-yieldlab-request.json @@ -82,11 +82,6 @@ }, "user": { "ext": { - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - }, "consent": "consentValue" } }, @@ -95,4 +90,4 @@ "gdpr": 0 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yieldlab/test-auction-yieldlab-response.json b/src/test/resources/org/prebid/server/it/openrtb2/yieldlab/test-auction-yieldlab-response.json index 4b56af12471..28b402fc0f6 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yieldlab/test-auction-yieldlab-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yieldlab/test-auction-yieldlab-response.json @@ -164,12 +164,7 @@ "tmax": 5000, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yieldmo/test-auction-yieldmo-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yieldmo/test-auction-yieldmo-request.json index 25cfb2c200d..5dd12d1e5b5 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yieldmo/test-auction-yieldmo-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yieldmo/test-auction-yieldmo-request.json @@ -62,12 +62,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yieldmo/test-yieldmo-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/yieldmo/test-yieldmo-bid-request-1.json index 2592271d1c0..456dec57676 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yieldmo/test-yieldmo-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yieldmo/test-yieldmo-bid-request-1.json @@ -37,12 +37,7 @@ "user": { "buyeruid": "YM-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yieldone/test-auction-yieldone-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yieldone/test-auction-yieldone-request.json index ce0f887b9df..dae78d61fbe 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yieldone/test-auction-yieldone-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yieldone/test-auction-yieldone-request.json @@ -62,12 +62,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yieldone/test-yieldone-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yieldone/test-yieldone-bid-request.json index 97ac27767a4..2dd1d05c05b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yieldone/test-yieldone-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yieldone/test-yieldone-bid-request.json @@ -41,12 +41,7 @@ "user": { "buyeruid": "YD-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-request.json b/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-request.json index 0f1f2f26a0c..be89aba4f07 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-request.json @@ -91,12 +91,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "regs": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-response.json b/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-response.json index 36ff7f81ffa..6b9f939a0b9 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-response.json @@ -103,13 +103,13 @@ "zeroclickfraud": [ { "uri": "{{ zeroclickfraud.exchange_uri }}?sid=2", - "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"impId002\",\"video\":{\"mimes\":[\"video/mp4\"],\"w\":300,\"h\":250,\"pos\":1},\"ext\":{\"bidder\":{\"host\":\"localhost:8090\",\"sourceId\":2}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"ZF-UID\",\"ext\":{\"consent\":\"consentValue\",\"digitrust\":{\"id\":\"id\",\"keyv\":123,\"pref\":0}}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"currency\":{\"rates\":{\"EUR\":{\"USD\":1.2406},\"USD\":{\"EUR\":0.811}}},\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", + "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"impId002\",\"video\":{\"mimes\":[\"video/mp4\"],\"w\":300,\"h\":250,\"pos\":1},\"ext\":{\"bidder\":{\"host\":\"localhost:8090\",\"sourceId\":2}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"ZF-UID\",\"ext\":{\"consent\":\"consentValue\"}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"currency\":{\"rates\":{\"EUR\":{\"USD\":1.2406},\"USD\":{\"EUR\":0.811}}},\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", "responsebody": "{\"id\":\"tid\",\"seatbid\":[{\"bid\":[{\"id\":\"bid002\",\"impid\":\"impId002\",\"price\":9.99,\"crid\":\"crid002\",\"cid\":\"cid002\",\"adomain\":[\"psacentral.org\"],\"h\":250,\"w\":300}],\"seat\":\"zeroclickfraud\"}]}", "status": 200 }, { "uri": "{{ zeroclickfraud.exchange_uri }}?sid=1", - "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"impId001\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}]},\"ext\":{\"bidder\":{\"host\":\"localhost:8090\",\"sourceId\":1}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"ZF-UID\",\"ext\":{\"consent\":\"consentValue\",\"digitrust\":{\"id\":\"id\",\"keyv\":123,\"pref\":0}}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"currency\":{\"rates\":{\"EUR\":{\"USD\":1.2406},\"USD\":{\"EUR\":0.811}}},\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", + "requestbody": "{\"id\":\"tid\",\"imp\":[{\"id\":\"impId001\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}]},\"ext\":{\"bidder\":{\"host\":\"localhost:8090\",\"sourceId\":1}}}],\"site\":{\"domain\":\"example.com\",\"page\":\"http://www.example.com\",\"publisher\":{\"id\":\"publisherId\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"userAgent\",\"dnt\":2,\"ip\":\"193.168.244.1\",\"pxratio\":4.2,\"language\":\"en\",\"ifa\":\"ifaId\"},\"user\":{\"buyeruid\":\"ZF-UID\",\"ext\":{\"consent\":\"consentValue\"}},\"at\":1,\"tmax\":5000,\"cur\":[\"USD\"],\"source\":{\"fd\":1,\"tid\":\"tid\"},\"regs\":{\"ext\":{\"gdpr\":0}},\"ext\":{\"prebid\":{\"debug\":1,\"currency\":{\"rates\":{\"EUR\":{\"USD\":1.2406},\"USD\":{\"EUR\":0.811}}},\"targeting\":{\"pricegranularity\":{\"precision\":2,\"ranges\":[{\"max\":20,\"increment\":0.1}]},\"includewinners\":true,\"includebidderkeys\":true},\"cache\":{\"bids\":{},\"vastxml\":{\"ttlseconds\":120}},\"auctiontimestamp\":1000,\"channel\":{\"name\":\"web\"}}}}", "responsebody": "{\"id\":\"tid\",\"seatbid\":[{\"bid\":[{\"id\":\"bid001\",\"impid\":\"impId001\",\"price\":7.77,\"adid\":\"adid001\",\"crid\":\"crid001\",\"cid\":\"cid001\",\"adm\":\"adm001\",\"h\":250,\"w\":300}],\"seat\":\"zeroclickfraud\"}]}", "status": 200 } @@ -173,12 +173,7 @@ }, "user": { "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-zeroclickfraud-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-zeroclickfraud-bid-request-1.json index e60f0063394..d578b675833 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-zeroclickfraud-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-zeroclickfraud-bid-request-1.json @@ -40,12 +40,7 @@ "user": { "buyeruid": "ZF-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-zeroclickfraud-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-zeroclickfraud-bid-request-2.json index 3129406631f..871c2f75cd1 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-zeroclickfraud-bid-request-2.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-zeroclickfraud-bid-request-2.json @@ -40,12 +40,7 @@ "user": { "buyeruid": "ZF-UID", "ext": { - "consent": "consentValue", - "digitrust": { - "id": "id", - "keyv": 123, - "pref": 0 - } + "consent": "consentValue" } }, "at": 1, diff --git a/src/test/resources/org/prebid/server/it/test-application.properties b/src/test/resources/org/prebid/server/it/test-application.properties index 8074cd4ede4..77a14c83601 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -1,3 +1,7 @@ +adapters.acuityads.enabled=true +adapters.acuityads.endpoint=http://localhost:8090/acuityads-exchange +adapters.acuityads.pbs-enforces-gdpr=true +adapters.acuityads.usersync.url=//acuityads-usersync adapters.adform.enabled=true adapters.adform.endpoint=http://localhost:8090/adform-exchange adapters.adform.pbs-enforces-gdpr=true @@ -11,7 +15,7 @@ adapters.adhese.endpoint=http://localhost:8090/adhese-exchange adapters.adhese.pbs-enforces-gdpr=true adapters.adhese.usersync.url=//adhese-usersync adapters.adkerneladn.enabled=true -adapters.adkerneladn.endpoint=http://localhost:8090/adkernelAdn-exchange?account= +adapters.adkerneladn.endpoint=http://localhost:8090/adkernelAdn.{{Host}}?account={{PublisherID}} adapters.adkerneladn.pbs-enforces-gdpr=true adapters.adkerneladn.usersync.url=//adkernelAdn-usersync adapters.adkernel.enabled=true @@ -38,6 +42,10 @@ adapters.adpone.enabled=true adapters.adpone.endpoint=http://localhost:8090/adpone-exchange adapters.adpone.pbs-enforces-gdpr=true adapters.adpone.usersync.url=//adpone-usersync +adapters.adprime.enabled=true +adapters.adprime.endpoint=http://localhost:8090/adprime-exchange +adapters.adprime.pbs-enforces-gdpr=true +adapters.adprime.usersync.url=//adprime-usersync adapters.adtarget.enabled=true adapters.adtarget.endpoint=http://localhost:8090/adtarget-exchange adapters.adtarget.pbs-enforces-gdpr=true @@ -54,6 +62,10 @@ adapters.aja.enabled=true adapters.aja.endpoint=http://localhost:8090/aja adapters.aja.pbs-enforces-gdpr=true adapters.aja.usersync.url=//v1/sync/ssp?ssp= +adapters.amx.enabled=true +adapters.amx.endpoint=http://localhost:8090/amx-exchange +adapters.amx.pbs-enforces-gdpr=true +adapters.amx.usersync.url=//amx-usersync adapters.appnexus.enabled=true adapters.appnexus.endpoint=http://localhost:8090/appnexus-exchange adapters.appnexus.pbs-enforces-gdpr=true @@ -80,6 +92,10 @@ adapters.brightroll.enabled=true adapters.brightroll.endpoint=http://localhost:8090/brightroll-exchange adapters.brightroll.pbs-enforces-gdpr=true adapters.brightroll.usersync.url=//brightroll-usersync +adapters.connectad.enabled=true +adapters.connectad.endpoint=http://localhost:8090/connectad-exchange +adapters.connectad.pbs-enforces-gdpr=true +adapters.connectad.usersync.url=//connectad-usersync adapters.cpmstar.enabled=true adapters.cpmstar.endpoint=http://localhost:8090/cpmstar-exchange adapters.cpmstar.pbs-enforces-gdpr=true @@ -96,6 +112,10 @@ adapters.datablocks.enabled=true adapters.datablocks.endpoint=http://{{Host}}/datablocks-exchange?sid={{SourceId}} adapters.datablocks.pbs-enforces-gdpr=true adapters.datablocks.usersync.url=//datablocks-usersync +adapters.deepintent.enabled=true +adapters.deepintent.endpoint=http://localhost:8090/deepintent-exchange +adapters.deepintent.pbs-enforces-gdpr=true +adapters.deepintent.usersync.url=//deepintent-usersync adapters.dmx.enabled=true adapters.dmx.endpoint=http://localhost:8090/dmx-exchange adapters.dmx.pbs-enforces-gdpr=true @@ -146,6 +166,14 @@ adapters.kidoz.enabled=true adapters.kidoz.endpoint=http://localhost:8090/kidoz-exchange adapters.kidoz.pbs-enforces-gdpr=true adapters.kidoz.usersync.url=//kidoz-usersync +adapters.colossus.enabled=true +adapters.colossus.endpoint=http://localhost:8090/colossus-exchange +adapters.colossus.pbs-enforces-gdpr=true +adapters.colossus.usersync.url=//colossus-usersync +adapters.krushmedia.enabled=true +adapters.krushmedia.endpoint=http://localhost:8090/krushmedia-exchange +adapters.krushmedia.pbs-enforces-gdpr=true +adapters.krushmedia.usersync.url=//krushmedia-usersync adapters.kubient.enabled=true adapters.kubient.endpoint=http://localhost:8090/kubient-exchange adapters.kubient.pbs-enforces-gdpr=true @@ -186,6 +214,10 @@ adapters.ninthdecimal.enabled=true adapters.ninthdecimal.endpoint=http://localhost:8090/ninthdecimal-exchange?pubid= adapters.ninthdecimal.pbs-enforces-gdpr=true adapters.ninthdecimal.usersync.url=//ninthdecimal-usersync +adapters.nobid.enabled=true +adapters.nobid.endpoint=http://localhost:8090/nobid-exchange?pubid= +adapters.nobid.pbs-enforces-gdpr=true +adapters.nobid.usersync.url=//nobid-usersync adapters.openx.enabled=true adapters.openx.endpoint=http://localhost:8090/openx-exchange adapters.openx.pbs-enforces-gdpr=true @@ -256,6 +288,10 @@ adapters.sharethrough.enabled=true adapters.sharethrough.endpoint=http://localhost:8090/sharethrough-exchange adapters.sharethrough.pbs-enforces-gdpr=true adapters.sharethrough.usersync.url=//sharethrough-usersync +adapters.silvermob.enabled=true +adapters.silvermob.endpoint=http://localhost:8090/silvermob-exchange +adapters.silvermob.pbs-enforces-gdpr=true +adapters.silvermob.usersync.url=//silvermob-usersync adapters.tappx.enabled=true adapters.tappx.endpoint=http:// adapters.tappx.pbs-enforces-gdpr=true @@ -282,6 +318,10 @@ adapters.ucfunnel.enabled=true adapters.ucfunnel.endpoint=http://localhost:8090/ucfunnel-exchange adapters.ucfunnel.pbs-enforces-gdpr=true adapters.ucfunnel.usersync.url=//ucfunnel-usersync +adapters.between.enabled=true +adapters.between.endpoint=http://localhost:8090/between-exchange +adapters.between.pbs-enforces-gdpr=true +adapters.between.usersync.url=//between-usersync adapters.unruly.enabled=true adapters.unruly.endpoint=http://localhost:8090/unruly-exchange adapters.unruly.pbs-enforces-gdpr=true @@ -306,6 +346,10 @@ adapters.inmobi.enabled=true adapters.inmobi.endpoint=http://localhost:8090/inmobi-exchange adapters.inmobi.pbs-enforces-gdpr=true adapters.inmobi.usersync.url=//inmobi-usersync +adapters.invibes.enabled=true +adapters.invibes.endpoint=http://localhost:8090/invibes-exchange +adapters.invibes.pbs-enforces-gdpr=true +adapters.invibes.usersync.url=//invibes-usersync adapters.yeahmobi.enabled=true adapters.yeahmobi.endpoint=http://localhost:8090/yeahmobi-exchange adapters.yeahmobi.pbs-enforces-gdpr=true diff --git a/src/test/resources/org/prebid/server/handler/version/empty.json b/src/test/resources/org/prebid/server/util/resource/version/empty.json similarity index 100% rename from src/test/resources/org/prebid/server/handler/version/empty.json rename to src/test/resources/org/prebid/server/util/resource/version/empty.json diff --git a/src/test/resources/org/prebid/server/handler/version/version.json b/src/test/resources/org/prebid/server/util/resource/version/version.json similarity index 100% rename from src/test/resources/org/prebid/server/handler/version/version.json rename to src/test/resources/org/prebid/server/util/resource/version/version.json