From 3c319a98a25d0573953ecfaa4c2eb0ae66ed1f40 Mon Sep 17 00:00:00 2001 From: Muki Seiler Date: Tue, 17 Dec 2024 12:41:28 +0100 Subject: [PATCH 1/8] Fix #3574 add driftpixel userSync redirect url (#3613) --- src/main/resources/bidder-config/driftpixel.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/resources/bidder-config/driftpixel.yaml b/src/main/resources/bidder-config/driftpixel.yaml index 384d75db00c..5bba4d9257f 100644 --- a/src/main/resources/bidder-config/driftpixel.yaml +++ b/src/main/resources/bidder-config/driftpixel.yaml @@ -13,3 +13,9 @@ adapters: - native supported-vendors: vendor-id: 0 + usersync: + cookie-family-name: driftpixel + redirect: + url: "https://sync.driftpixel.live/psync?t=s&e=0&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&cb={{redirect_url}}" + support-cors: false + uid-macro: "%USER_ID%" From 1635329cbd4ea313d017685ecbcb2fd09f93a1f0 Mon Sep 17 00:00:00 2001 From: osulzhenko <125548596+osulzhenko@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:42:14 +0200 Subject: [PATCH 2/8] update functional test for module execution (#3617) --- .../tests/module/GeneralModuleSpec.groovy | 54 +++++++++++++++---- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy index 1ce411e8d36..82727b16a56 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy @@ -323,10 +323,6 @@ class GeneralModuleSpec extends ModuleBaseSpec { assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1 assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1 - and: "RB-Richmedia-Filter module call metrics shouldn't be updated" - assert !metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] - assert !metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] - cleanup: "Stop and remove pbs container" pbsServiceFactory.removeContainer(pbsConfig) } @@ -352,7 +348,7 @@ class GeneralModuleSpec extends ModuleBaseSpec { assert !response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() and: "Ortb2blocking module call metrics shouldn't be updated" - def metrics = pbsServiceWithMultipleModuleWithRequireInvoke.sendCollectedMetricsRequest() + def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest() assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] @@ -362,7 +358,7 @@ class GeneralModuleSpec extends ModuleBaseSpec { pbsServiceFactory.removeContainer(pbsConfig) } - def "PBS should call module without account config when default-account module-execution config enabled module"() { + def "PBS shouldn't call module and not override host config when default-account module-execution config enabled module"() { given: "PBS service with module-execution and default account configs" def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap { hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): true])) @@ -391,15 +387,53 @@ class GeneralModuleSpec extends ModuleBaseSpec { assert !response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() and: "Ortb2blocking module call metrics shouldn't be updated" - def metrics = pbsServiceWithMultipleModuleWithRequireInvoke.sendCollectedMetricsRequest() + def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest() assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] - and: "RB-Richmedia-Filter module call metrics shouldn't be updated" - assert !metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] - assert !metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] + cleanup: "Stop and remove pbs container" + pbsServiceFactory.removeContainer(pbsConfig) + } + + def "PBS should call module without account module config when default-account module-execution config enabling module"() { + given: "PBS service with module-execution and default account configs" + def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap { + hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): true])) + } + def pbsConfig = MULTI_MODULE_CONFIG + ENABLED_INVOKE_CONFIG + ["settings.default-account-config": encode(defaultAccountConfigSettings)] + def pbsServiceWithMultipleModules = pbsServiceFactory.getService(pbsConfig) + + and: "Default bid request with verbose trace" + def bidRequest = defaultBidRequest.tap { + ext.prebid.trace = TraceLevel.VERBOSE + } + + and: "Save account without modules config" + def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(modules: null)) + def account = new Account(uuid: bidRequest.getAccountId(), config: accountConfig) + accountDao.save(account) + + and: "Flush metrics" + flushMetrics(pbsServiceWithMultipleModules) + + when: "PBS processes auction request" + def response = pbsServiceWithMultipleModules.sendAuctionRequest(bidRequest) + + then: "PBS response should include trace information about called modules" + verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List) { + it.status == [SUCCESS, SUCCESS] + it.action == [NO_ACTION, NO_ACTION] + it.hookId.moduleCode.sort() == [ORTB2_BLOCKING, ORTB2_BLOCKING].code.sort() + } + + and: "Ortb2blocking module call metrics should be updated" + def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest() + assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1 + assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1 + assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1 + assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1 cleanup: "Stop and remove pbs container" pbsServiceFactory.removeContainer(pbsConfig) From 9ec0b448196af1bfbf2c1285f1f3bf3892e11be4 Mon Sep 17 00:00:00 2001 From: Emil <63649196+EmilNadimanov@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:44:03 +0100 Subject: [PATCH 3/8] Fix #3581 declare PubMatic support for openRTB 2.6 (#3623) --- src/main/resources/bidder-config/pubmatic.yaml | 1 + .../it/openrtb2/pubmatic/test-auction-pubmatic-request.json | 4 +--- .../it/openrtb2/pubmatic/test-pubmatic-bid-request.json | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/resources/bidder-config/pubmatic.yaml b/src/main/resources/bidder-config/pubmatic.yaml index 8f59f1912f1..5ca8ad94339 100644 --- a/src/main/resources/bidder-config/pubmatic.yaml +++ b/src/main/resources/bidder-config/pubmatic.yaml @@ -1,6 +1,7 @@ adapters: pubmatic: endpoint: https://hbopenbid.pubmatic.com/translator?source=prebid-server + ortb-version: "2.6" meta-info: maintainer-email: header-bidding@pubmatic.com app-media-types: 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 4ce766dfbcc..3a20b08ce67 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 @@ -49,9 +49,7 @@ ], "tmax": 5000, "regs": { - "ext": { - "gdpr": 0 - } + "gdpr": 0 }, "ext": { "prebid": { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-pubmatic-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-pubmatic-bid-request.json index 7a4f1e0279d..95f031b554b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-pubmatic-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/pubmatic/test-pubmatic-bid-request.json @@ -12,7 +12,7 @@ "h": 600 }, "tagid": "slot9", - "bidfloor" : 0.12, + "bidfloor": 0.12, "ext": { "ae": 1, "pmZoneId": "Zone1,Zone2", @@ -45,9 +45,7 @@ "USD" ], "regs": { - "ext": { - "gdpr": 0 - } + "gdpr": 0 }, "ext": { "prebid": { From b9e663bb48f13d5298641a1efc9dac880832626d Mon Sep 17 00:00:00 2001 From: bretg Date: Thu, 19 Dec 2024 09:09:11 -0500 Subject: [PATCH 4/8] Create slack-stale-pr.yml (#3638) --- .github/workflows/slack-stale-pr.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/slack-stale-pr.yml diff --git a/.github/workflows/slack-stale-pr.yml b/.github/workflows/slack-stale-pr.yml new file mode 100644 index 00000000000..a610c3e7de9 --- /dev/null +++ b/.github/workflows/slack-stale-pr.yml @@ -0,0 +1,27 @@ +name: Post Stale PRs To Slack + +on: + # run Monday 9am and on-demand + workflow_dispatch: + schedule: + - cron: '0 9 * * 1' + +jobs: + fetch-PRs: + runs-on: ubuntu-latest + steps: + - name: Fetch pull requests + id: local + uses: paritytech/stale-pr-finder@v0.3.0 + with: + GITHUB_TOKEN: ${{ github.token }} + days-stale: 14 + ignoredLabels: "blocked" + - name: Post to a Slack channel + id: slack + uses: slackapi/slack-github-action@v1.27.1 + with: + channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + slack-message: "${{ steps.local.outputs.message }}" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From a777cb074285fee043d78e728c5ef8832c10d176 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhevedenko <720803+Net-burst@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:09:34 -0500 Subject: [PATCH 5/8] Fix incorrect Java version reference in the build.md (#3640) --- docs/build.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/build.md b/docs/build.md index 67b0b8af26e..ed2c18b7e0a 100644 --- a/docs/build.md +++ b/docs/build.md @@ -1,9 +1,15 @@ # Build project To build the project, you will need at least -[Java 11](https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz) +[Java 21](https://whichjdk.com/) and [Maven](https://maven.apache.org/) installed. +If for whatever reason this Java reference will be stale, +you can always get the current project Java version from `pom.xml` property +```xml +... +``` + To verify the installed Java run in console: ```bash @@ -13,9 +19,9 @@ java -version which should show something like (yours may be different): ``` -openjdk version "11.0.2" 2019-01-15 -OpenJDK Runtime Environment 18.9 (build 11.0.2+9) -OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) +openjdk version "21.0.5" 2024-10-15 LTS +OpenJDK Runtime Environment Corretto-21.0.5.11.1 (build 21.0.5+11-LTS) +OpenJDK 64-Bit Server VM Corretto-21.0.5.11.1 (build 21.0.5+11-LTS, mixed mode, sharing) ``` Follow next steps to create JAR which can be deployed locally. From 2a59c200b17b269164994dd63acae7b61d80779d Mon Sep 17 00:00:00 2001 From: Ryan Chichirico Date: Thu, 19 Dec 2024 07:10:19 -0700 Subject: [PATCH 6/8] PgamSSP adapter : add GVL ID (#3641) --- src/main/resources/bidder-config/pgamssp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/bidder-config/pgamssp.yaml b/src/main/resources/bidder-config/pgamssp.yaml index e2088e63e0e..70105cab774 100644 --- a/src/main/resources/bidder-config/pgamssp.yaml +++ b/src/main/resources/bidder-config/pgamssp.yaml @@ -12,7 +12,7 @@ adapters: - video - native supported-vendors: - vendor-id: 0 + vendor-id: 1353 usersync: cookie-family-name: pgamssp redirect: From 19d25f3fd51542341f3cd99e575247c8a475999c Mon Sep 17 00:00:00 2001 From: osulzhenko <125548596+osulzhenko@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:28:07 +0200 Subject: [PATCH 7/8] Update privacy functional test: GVL file handling (#3644) --- .../tests/privacy/ActivityTraceLogSpec.groovy | 2 +- .../tests/privacy/GdprAmpSpec.groovy | 54 +++++++++++-------- .../tests/privacy/GdprAuctionSpec.groovy | 54 +++++++++++-------- .../privacy/GppSyncUserActivitiesSpec.groovy | 10 ++-- .../tests/privacy/PrivacyBaseSpec.groovy | 11 ++-- .../TcfFullTransmitEidsActivitiesSpec.groovy | 2 +- 6 files changed, 74 insertions(+), 59 deletions(-) diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/ActivityTraceLogSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/ActivityTraceLogSpec.groovy index 309bba2eea6..e0c3b279200 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/ActivityTraceLogSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/ActivityTraceLogSpec.groovy @@ -121,7 +121,7 @@ class ActivityTraceLogSpec extends PrivacyBaseSpec { accountDao.save(account) when: "PBS processes auction requests" - def bidResponse = pbsServiceFactory.getService(PBS_CONFIG).sendAuctionRequest(bidRequest) + def bidResponse = activityPbsService.sendAuctionRequest(bidRequest) then: "Bid response should contain basic info in debug" def infrastructure = bidResponse.ext.debug.trace.activityInfrastructure diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAmpSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAmpSpec.groovy index 34242d43cec..771fac9bd84 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAmpSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAmpSpec.groovy @@ -13,8 +13,6 @@ import org.prebid.server.functional.model.request.auction.BidRequest import org.prebid.server.functional.model.request.auction.DistributionChannel import org.prebid.server.functional.model.request.auction.Regs import org.prebid.server.functional.model.request.auction.RegsExt -import org.prebid.server.functional.service.PrebidServerService -import org.prebid.server.functional.testcontainers.container.PrebidServerContainer import org.prebid.server.functional.util.PBSUtils import org.prebid.server.functional.util.privacy.BogusConsent import org.prebid.server.functional.util.privacy.CcpaConsent @@ -320,10 +318,8 @@ class GdprAmpSpec extends PrivacyBaseSpec { def startTime = Instant.now() and: "Create new container" - def serverContainer = new PrebidServerContainer(GDPR_VENDOR_LIST_CONFIG + - ["adapters.generic.meta-info.vendor-id": GENERIC_VENDOR_ID as String]) - serverContainer.start() - def privacyPbsService = new PrebidServerService(serverContainer) + def config = GDPR_VENDOR_LIST_CONFIG + ["adapters.generic.meta-info.vendor-id": GENERIC_VENDOR_ID as String] + def defaultPrivacyPbsService = pbsServiceFactory.getService(config) and: "Prepare tcf consent string" def tcfConsent = new TcfConsent.Builder() @@ -347,21 +343,21 @@ class GdprAmpSpec extends PrivacyBaseSpec { vendorListResponse.setResponse(tcfPolicyVersion) when: "PBS processes amp request" - privacyPbsService.sendAmpRequest(ampRequest) + defaultPrivacyPbsService.sendAmpRequest(ampRequest) then: "Used vendor list have proper specification version of GVL" def properVendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString()) - PBSUtils.waitUntil { privacyPbsService.isFileExist(properVendorListPath) } - def vendorList = privacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class) + PBSUtils.waitUntil { defaultPrivacyPbsService.isFileExist(properVendorListPath) } + def vendorList = defaultPrivacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class) assert vendorList.tcfPolicyVersion == tcfPolicyVersion.vendorListVersion and: "Logs should contain proper vendor list version" - def logs = privacyPbsService.getLogsByTime(startTime) + def logs = defaultPrivacyPbsService.getLogsByTime(startTime) assert getLogsByText(logs, "Created new TCF 2 vendor list for version " + "v${tcfPolicyVersion.vendorListVersion}.${tcfPolicyVersion.vendorListVersion}") - cleanup: "Stop container with default request" - serverContainer.stop() + cleanup: "Stop and remove pbs container" + pbsServiceFactory.removeContainer(config) where: tcfPolicyVersion << [TCF_POLICY_V2, TCF_POLICY_V4, TCF_POLICY_V5] @@ -410,7 +406,10 @@ class GdprAmpSpec extends PrivacyBaseSpec { } def "PBS amp should emit the same error without a second GVL list request if a retry is too soon for the exponential-backoff"() { - given: "Test start time" + given: "Prebid server with privacy settings" + def defaultPrivacyPbsService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG) + + and: "Test start time" def startTime = Instant.now() and: "Prepare tcf consent string" @@ -438,14 +437,14 @@ class GdprAmpSpec extends PrivacyBaseSpec { vendorListResponse.setResponse(tcfPolicyVersion, Delay.seconds(EXPONENTIAL_BACKOFF_MAX_DELAY + 3)) when: "PBS processes amp request" - privacyPbsService.sendAmpRequest(ampRequest) + defaultPrivacyPbsService.sendAmpRequest(ampRequest) then: "PBS shouldn't fetch vendor list" def vendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString()) - assert !privacyPbsService.isFileExist(vendorListPath) + assert !defaultPrivacyPbsService.isFileExist(vendorListPath) and: "Logs should contain proper vendor list version" - def logs = privacyPbsService.getLogsByTime(startTime) + def logs = defaultPrivacyPbsService.getLogsByTime(startTime) def tcfError = "TCF 2 vendor list for version v${tcfPolicyVersion.vendorListVersion}.${tcfPolicyVersion.vendorListVersion} not found, started downloading." assert getLogsByText(logs, tcfError) @@ -453,18 +452,21 @@ class GdprAmpSpec extends PrivacyBaseSpec { def secondStartTime = Instant.now() when: "PBS processes amp request" - privacyPbsService.sendAmpRequest(ampRequest) + defaultPrivacyPbsService.sendAmpRequest(ampRequest) then: "PBS shouldn't fetch vendor list" - assert !privacyPbsService.isFileExist(vendorListPath) + assert !defaultPrivacyPbsService.isFileExist(vendorListPath) and: "Logs should contain proper vendor list version" - def logsSecond = privacyPbsService.getLogsByTime(secondStartTime) + def logsSecond = defaultPrivacyPbsService.getLogsByTime(secondStartTime) assert getLogsByText(logsSecond, tcfError) and: "Reset vendor list response" vendorListResponse.reset() + cleanup: "Stop and remove pbs container" + pbsServiceFactory.removeContainer(GENERAL_PRIVACY_CONFIG) + where: tcfPolicyVersion << [TCF_POLICY_V2, TCF_POLICY_V4, TCF_POLICY_V5] } @@ -659,7 +661,10 @@ class GdprAmpSpec extends PrivacyBaseSpec { } def "PBS amp should set 3 for tcfPolicyVersion when tcfPolicyVersion is #tcfPolicyVersion"() { - given: "Tcf consent setup" + given: "Prebid server with privacy settings" + def defaultPrivacyPbsService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG) + + and: "Tcf consent setup" def tcfConsent = new TcfConsent.Builder() .setPurposesLITransparency(BASIC_ADS) .setTcfPolicyVersion(tcfPolicyVersion.value) @@ -681,14 +686,17 @@ class GdprAmpSpec extends PrivacyBaseSpec { vendorListResponse.setResponse(tcfPolicyVersion) when: "PBS processes amp request" - privacyPbsService.sendAmpRequest(ampRequest) + defaultPrivacyPbsService.sendAmpRequest(ampRequest) then: "Used vendor list have proper specification version of GVL" def properVendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString()) - PBSUtils.waitUntil { privacyPbsService.isFileExist(properVendorListPath) } - def vendorList = privacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class) + PBSUtils.waitUntil { defaultPrivacyPbsService.isFileExist(properVendorListPath) } + def vendorList = defaultPrivacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class) assert vendorList.gvlSpecificationVersion == V3 + cleanup: "Stop and remove pbs container" + pbsServiceFactory.removeContainer(GENERAL_PRIVACY_CONFIG) + where: tcfPolicyVersion << [TCF_POLICY_V4, TCF_POLICY_V5] } diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAuctionSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAuctionSpec.groovy index 66003fa2716..351875e5f90 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAuctionSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAuctionSpec.groovy @@ -10,8 +10,6 @@ import org.prebid.server.functional.model.request.auction.DistributionChannel import org.prebid.server.functional.model.request.auction.Regs import org.prebid.server.functional.model.request.auction.RegsExt import org.prebid.server.functional.model.response.auction.ErrorType -import org.prebid.server.functional.service.PrebidServerService -import org.prebid.server.functional.testcontainers.container.PrebidServerContainer import org.prebid.server.functional.util.PBSUtils import org.prebid.server.functional.util.privacy.BogusConsent import org.prebid.server.functional.util.privacy.TcfConsent @@ -278,10 +276,8 @@ class GdprAuctionSpec extends PrivacyBaseSpec { def startTime = Instant.now() and: "Create new container" - def serverContainer = new PrebidServerContainer(GDPR_VENDOR_LIST_CONFIG + - ["adapters.generic.meta-info.vendor-id": GENERIC_VENDOR_ID as String]) - serverContainer.start() - def privacyPbsService = new PrebidServerService(serverContainer) + def config = GDPR_VENDOR_LIST_CONFIG + ["adapters.generic.meta-info.vendor-id": GENERIC_VENDOR_ID as String] + def defaultPrivacyPbsService = pbsServiceFactory.getService(config) and: "Tcf consent setup" def tcfConsent = new TcfConsent.Builder() @@ -298,21 +294,21 @@ class GdprAuctionSpec extends PrivacyBaseSpec { vendorListResponse.setResponse(tcfPolicyVersion) when: "PBS processes auction request" - privacyPbsService.sendAuctionRequest(bidRequest) + defaultPrivacyPbsService.sendAuctionRequest(bidRequest) then: "Used vendor list have proper specification version of GVL" def properVendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString()) - PBSUtils.waitUntil { privacyPbsService.isFileExist(properVendorListPath) } - def vendorList = privacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class) + PBSUtils.waitUntil { defaultPrivacyPbsService.isFileExist(properVendorListPath) } + def vendorList = defaultPrivacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class) assert vendorList.tcfPolicyVersion == tcfPolicyVersion.vendorListVersion and: "Logs should contain proper vendor list version" - def logs = privacyPbsService.getLogsByTime(startTime) + def logs = defaultPrivacyPbsService.getLogsByTime(startTime) assert getLogsByText(logs, "Created new TCF 2 vendor list for version " + "v${tcfPolicyVersion.vendorListVersion}.${tcfPolicyVersion.vendorListVersion}") - cleanup: "Stop container with default request" - serverContainer.stop() + cleanup: "Stop and remove pbs container" + pbsServiceFactory.removeContainer(config) where: tcfPolicyVersion << [TCF_POLICY_V2, TCF_POLICY_V4, TCF_POLICY_V5] @@ -357,7 +353,10 @@ class GdprAuctionSpec extends PrivacyBaseSpec { } def "PBS auction should emit the same error without a second GVL list request if a retry is too soon for the exponential-backoff"() { - given: "Test start time" + given: "Prebid server with privacy settings" + def defaultPrivacyPbsService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG) + + and: "Test start time" def startTime = Instant.now() and: "Tcf consent setup" @@ -378,14 +377,14 @@ class GdprAuctionSpec extends PrivacyBaseSpec { vendorListResponse.setResponse(tcfPolicyVersion, Delay.seconds(EXPONENTIAL_BACKOFF_MAX_DELAY + 3)) when: "PBS processes auction request" - privacyPbsService.sendAuctionRequest(bidRequest) + defaultPrivacyPbsService.sendAuctionRequest(bidRequest) then: "Used vendor list have proper specification version of GVL" def properVendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString()) - assert !privacyPbsService.isFileExist(properVendorListPath) + assert !defaultPrivacyPbsService.isFileExist(properVendorListPath) and: "Logs should contain proper vendor list version" - def logs = privacyPbsService.getLogsByTime(startTime) + def logs = defaultPrivacyPbsService.getLogsByTime(startTime) def tcfError = "TCF 2 vendor list for version v${tcfPolicyVersion.vendorListVersion}.${tcfPolicyVersion.vendorListVersion} not found, started downloading." assert getLogsByText(logs, tcfError) @@ -393,18 +392,21 @@ class GdprAuctionSpec extends PrivacyBaseSpec { def secondStartTime = Instant.now() when: "PBS processes amp request" - privacyPbsService.sendAuctionRequest(bidRequest) + defaultPrivacyPbsService.sendAuctionRequest(bidRequest) then: "PBS shouldn't fetch vendor list" - assert !privacyPbsService.isFileExist(properVendorListPath) + assert !defaultPrivacyPbsService.isFileExist(properVendorListPath) and: "Logs should contain proper vendor list version" - def logsSecond = privacyPbsService.getLogsByTime(secondStartTime) + def logsSecond = defaultPrivacyPbsService.getLogsByTime(secondStartTime) assert getLogsByText(logsSecond, tcfError) and: "Reset vendor list response" vendorListResponse.reset() + cleanup: "Stop and remove pbs container" + pbsServiceFactory.removeContainer(GENERAL_PRIVACY_CONFIG) + where: tcfPolicyVersion << [TCF_POLICY_V2, TCF_POLICY_V4, TCF_POLICY_V5] } @@ -783,7 +785,10 @@ class GdprAuctionSpec extends PrivacyBaseSpec { } def "PBS auction should set 3 for tcfPolicyVersion when tcfPolicyVersion is #tcfPolicyVersion"() { - given: "Tcf consent setup" + given: "Prebid server with privacy settings" + def defaultPrivacyPbsService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG) + + and: "Tcf consent setup" def tcfConsent = new TcfConsent.Builder() .setPurposesLITransparency(BASIC_ADS) .setTcfPolicyVersion(tcfPolicyVersion.value) @@ -798,14 +803,17 @@ class GdprAuctionSpec extends PrivacyBaseSpec { vendorListResponse.setResponse(tcfPolicyVersion) when: "PBS processes auction request" - privacyPbsService.sendAuctionRequest(bidRequest) + defaultPrivacyPbsService.sendAuctionRequest(bidRequest) then: "Used vendor list have proper specification version of GVL" def properVendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString()) - PBSUtils.waitUntil { privacyPbsService.isFileExist(properVendorListPath) } - def vendorList = privacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class) + PBSUtils.waitUntil { defaultPrivacyPbsService.isFileExist(properVendorListPath) } + def vendorList = defaultPrivacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class) assert vendorList.gvlSpecificationVersion == V3 + cleanup: "Stop and remove pbs container" + pbsServiceFactory.removeContainer(GENERAL_PRIVACY_CONFIG) + where: tcfPolicyVersion << [TCF_POLICY_V4, TCF_POLICY_V5] } diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppSyncUserActivitiesSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppSyncUserActivitiesSpec.groovy index 602fbb87347..f684cb10313 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppSyncUserActivitiesSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppSyncUserActivitiesSpec.groovy @@ -1778,7 +1778,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { def "PBS cookie sync should process rule when geo doesn't intersection"() { given: "Pbs config with geo location" - def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG + GEO_LOCATION + + def prebidServerService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG + GEO_LOCATION + ["geolocation.configurations.geo-info.[0].country": countyConfig, "geolocation.configurations.geo-info.[0].region" : regionConfig]) @@ -1830,7 +1830,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { def "PBS setuid should process rule when geo doesn't intersection"() { given: "Pbs config with geo location" - def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG + GEO_LOCATION + + def prebidServerService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG + GEO_LOCATION + ["geolocation.configurations.[0].geo-info.country": countyConfig, "geolocation.configurations.[0].geo-info.region" : regionConfig]) @@ -1885,7 +1885,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { def "PBS cookie sync should disallowed rule when device.geo intersection"() { given: "Pbs config with geo location" - def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG + GEO_LOCATION + + def prebidServerService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG + GEO_LOCATION + ["geolocation.configurations.[0].geo-info.country": countyConfig, "geolocation.configurations.[0].geo-info.region" : regionConfig]) @@ -1936,7 +1936,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { def "PBS setuid should disallowed rule when device.geo intersection"() { given: "Pbs config with geo location" - def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG + GEO_LOCATION + + def prebidServerService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG + GEO_LOCATION + ["geolocation.configurations.[0].geo-info.country": countyConfig, "geolocation.configurations.[0].geo-info.region" : regionConfig]) @@ -1986,7 +1986,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { def "PBS cookie sync should fetch geo once when gpp sync user and account require geo look up"() { given: "Pbs config with geo location" - def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG + GEO_LOCATION + + def prebidServerService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG + GEO_LOCATION + ["geolocation.configurations.[0].geo-info.country": USA.ISOAlpha3, "geolocation.configurations.[0].geo-info.region" : ALABAMA.abbreviation]) diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/PrivacyBaseSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/PrivacyBaseSpec.groovy index 145a33336f9..d4cbf17e2dd 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/PrivacyBaseSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/PrivacyBaseSpec.groovy @@ -106,15 +106,14 @@ abstract class PrivacyBaseSpec extends BaseSpec { protected static final Integer MAX_INVALID_TCF_POLICY_VERSION = 63 protected static final Integer MIN_INVALID_TCF_POLICY_VERSION = 6 - @Shared - protected final PrebidServerService privacyPbsService = pbsServiceFactory.getService(GDPR_VENDOR_LIST_CONFIG + - GENERIC_CONFIG + GENERIC_VENDOR_CONFIG + RETRY_POLICY_EXPONENTIAL_CONFIG + GDPR_EEA_COUNTRY) + protected static final Map GENERAL_PRIVACY_CONFIG = + GENERIC_CONFIG + GDPR_VENDOR_LIST_CONFIG + GENERIC_VENDOR_CONFIG + RETRY_POLICY_EXPONENTIAL_CONFIG - protected static final Map PBS_CONFIG = OPENX_CONFIG + - GENERIC_CONFIG + GDPR_VENDOR_LIST_CONFIG + SETTING_CONFIG + GENERIC_VENDOR_CONFIG + @Shared + protected final PrebidServerService privacyPbsService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG + GDPR_EEA_COUNTRY) @Shared - protected final PrebidServerService activityPbsService = pbsServiceFactory.getService(PBS_CONFIG) + protected final PrebidServerService activityPbsService = pbsServiceFactory.getService(OPENX_CONFIG + SETTING_CONFIG + GENERAL_PRIVACY_CONFIG) def setupSpec() { vendorListResponse.setResponse() diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/TcfFullTransmitEidsActivitiesSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/TcfFullTransmitEidsActivitiesSpec.groovy index 934aa69de33..d798bc4c478 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/TcfFullTransmitEidsActivitiesSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/TcfFullTransmitEidsActivitiesSpec.groovy @@ -25,7 +25,7 @@ class TcfFullTransmitEidsActivitiesSpec extends PrivacyBaseSpec { private static PrebidServerService privacyPbsServiceWithMultipleGvl def setupSpec() { - privacyPbsContainerWithMultipleGvl = new PrebidServerContainer(PBS_CONFIG) + privacyPbsContainerWithMultipleGvl = new PrebidServerContainer(GENERAL_PRIVACY_CONFIG) def prepareEncodeResponseBodyWithPurposesOnly = getVendorListContent(true, false, false) def prepareEncodeResponseBodyWithLegIntPurposes = getVendorListContent(false, true, false) def prepareEncodeResponseBodyWithLegIntAndFlexiblePurposes = getVendorListContent(false, true, true) From 11f0eaa0f8cbaacc925d2dad8ec3134589ae2997 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhevedenko <720803+Net-burst@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:20:00 -0500 Subject: [PATCH 8/8] Rubicon: pass imp[].ext.tid (#3648) --- .../org/prebid/server/bidder/rubicon/RubiconBidder.java | 7 +++++++ .../server/bidder/rubicon/proto/request/RubiconImpExt.java | 2 ++ src/test/java/org/prebid/server/it/OwnAdxTest.java | 3 --- .../server/it/hooks/reject/test-rubicon-bid-request-1.json | 3 ++- .../it/hooks/sample-module/test-rubicon-bid-request-1.json | 3 ++- .../it/openrtb2/magnite/test-magnite-bid-request.json | 3 ++- .../it/openrtb2/rubicon/test-rubicon-bid-request.json | 3 ++- 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java b/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java index a420efed87d..ebc7a7dccf4 100644 --- a/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java +++ b/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java @@ -154,6 +154,7 @@ public class RubiconBidder implements Bidder { private static final String FPD_KEYWORDS_FIELD = "keywords"; private static final String DFP_ADUNIT_CODE_FIELD = "dfp_ad_unit_code"; private static final String STYPE_FIELD = "stype"; + private static final String TID_FIELD = "tid"; private static final String PREBID_EXT = "prebid"; private static final String PBS_LOGIN = "pbs_login"; private static final String PBS_VERSION = "pbs_version"; @@ -700,6 +701,7 @@ private RubiconImpExt makeImpExt(Imp imp, .maxbids(getMaxBids(extRequest)) .gpid(getGpid(imp.getExt())) .skadn(getSkadn(imp.getExt())) + .tid(getTid(imp.getExt())) .prebid(rubiconImpExtPrebid) .build(); } @@ -947,6 +949,11 @@ private ObjectNode getSkadn(ObjectNode impExt) { return skadnNode != null && skadnNode.isObject() ? (ObjectNode) skadnNode : null; } + private String getTid(ObjectNode impExt) { + final JsonNode tidNode = impExt.get(TID_FIELD); + return tidNode != null && tidNode.isTextual() ? tidNode.asText() : null; + } + private String getAdSlot(Imp imp) { final ObjectNode dataNode = toObjectNode(imp.getExt().get(FPD_DATA_FIELD)); diff --git a/src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java b/src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java index 1c39f9d9345..d40333b891a 100644 --- a/src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java +++ b/src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java @@ -20,5 +20,7 @@ public class RubiconImpExt { ObjectNode skadn; + String tid; + RubiconImpExtPrebid prebid; } diff --git a/src/test/java/org/prebid/server/it/OwnAdxTest.java b/src/test/java/org/prebid/server/it/OwnAdxTest.java index 1ab4ddb5d71..70c4d6e7686 100644 --- a/src/test/java/org/prebid/server/it/OwnAdxTest.java +++ b/src/test/java/org/prebid/server/it/OwnAdxTest.java @@ -3,9 +3,7 @@ import io.restassured.response.Response; import org.json.JSONException; import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; import org.prebid.server.model.Endpoint; -import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException; @@ -16,7 +14,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static java.util.Collections.singletonList; -@RunWith(SpringRunner.class) public class OwnAdxTest extends IntegrationTest { @Test diff --git a/src/test/resources/org/prebid/server/it/hooks/reject/test-rubicon-bid-request-1.json b/src/test/resources/org/prebid/server/it/hooks/reject/test-rubicon-bid-request-1.json index 0daecc354d4..3743bed491b 100644 --- a/src/test/resources/org/prebid/server/it/hooks/reject/test-rubicon-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/hooks/reject/test-rubicon-bid-request-1.json @@ -37,7 +37,8 @@ "mint_version": "" } }, - "maxbids": 1 + "maxbids": 1, + "tid": "${json-unit.any-string}" } } ], diff --git a/src/test/resources/org/prebid/server/it/hooks/sample-module/test-rubicon-bid-request-1.json b/src/test/resources/org/prebid/server/it/hooks/sample-module/test-rubicon-bid-request-1.json index 14d752bc96d..e9a871c9f77 100644 --- a/src/test/resources/org/prebid/server/it/hooks/sample-module/test-rubicon-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/hooks/sample-module/test-rubicon-bid-request-1.json @@ -38,7 +38,8 @@ "mint_version": "" } }, - "maxbids": 1 + "maxbids": 1, + "tid": "${json-unit.any-string}" } } ], diff --git a/src/test/resources/org/prebid/server/it/openrtb2/magnite/test-magnite-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/magnite/test-magnite-bid-request.json index 08104541960..4b14180a370 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/magnite/test-magnite-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/magnite/test-magnite-bid-request.json @@ -27,7 +27,8 @@ "mint_version": "" } }, - "maxbids": 1 + "maxbids": 1, + "tid": "${json-unit.any-string}" } } ], diff --git a/src/test/resources/org/prebid/server/it/openrtb2/rubicon/test-rubicon-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/rubicon/test-rubicon-bid-request.json index 08104541960..4b14180a370 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/rubicon/test-rubicon-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/rubicon/test-rubicon-bid-request.json @@ -27,7 +27,8 @@ "mint_version": "" } }, - "maxbids": 1 + "maxbids": 1, + "tid": "${json-unit.any-string}" } } ],