Skip to content

Commit 6b54360

Browse files
committed
Merge branch 'refs/heads/master' into setuid-tcf-support
2 parents 8172dd6 + 11f0eaa commit 6b54360

File tree

21 files changed

+183
-88
lines changed

21 files changed

+183
-88
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Post Stale PRs To Slack
2+
3+
on:
4+
# run Monday 9am and on-demand
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 9 * * 1'
8+
9+
jobs:
10+
fetch-PRs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Fetch pull requests
14+
id: local
15+
uses: paritytech/[email protected]
16+
with:
17+
GITHUB_TOKEN: ${{ github.token }}
18+
days-stale: 14
19+
ignoredLabels: "blocked"
20+
- name: Post to a Slack channel
21+
id: slack
22+
uses: slackapi/[email protected]
23+
with:
24+
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
25+
slack-message: "${{ steps.local.outputs.message }}"
26+
env:
27+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

docs/build.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Build project
22

33
To build the project, you will need at least
4-
[Java 11](https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz)
4+
[Java 21](https://whichjdk.com/)
55
and [Maven](https://maven.apache.org/) installed.
66

7+
If for whatever reason this Java reference will be stale,
8+
you can always get the current project Java version from `pom.xml` property
9+
```xml
10+
<java.version>...</java.version>
11+
```
12+
713
To verify the installed Java run in console:
814

915
```bash
@@ -13,9 +19,9 @@ java -version
1319
which should show something like (yours may be different):
1420

1521
```
16-
openjdk version "11.0.2" 2019-01-15
17-
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
18-
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
22+
openjdk version "21.0.5" 2024-10-15 LTS
23+
OpenJDK Runtime Environment Corretto-21.0.5.11.1 (build 21.0.5+11-LTS)
24+
OpenJDK 64-Bit Server VM Corretto-21.0.5.11.1 (build 21.0.5+11-LTS, mixed mode, sharing)
1925
```
2026

2127
Follow next steps to create JAR which can be deployed locally.

src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public class RubiconBidder implements Bidder<BidRequest> {
154154
private static final String FPD_KEYWORDS_FIELD = "keywords";
155155
private static final String DFP_ADUNIT_CODE_FIELD = "dfp_ad_unit_code";
156156
private static final String STYPE_FIELD = "stype";
157+
private static final String TID_FIELD = "tid";
157158
private static final String PREBID_EXT = "prebid";
158159
private static final String PBS_LOGIN = "pbs_login";
159160
private static final String PBS_VERSION = "pbs_version";
@@ -700,6 +701,7 @@ private RubiconImpExt makeImpExt(Imp imp,
700701
.maxbids(getMaxBids(extRequest))
701702
.gpid(getGpid(imp.getExt()))
702703
.skadn(getSkadn(imp.getExt()))
704+
.tid(getTid(imp.getExt()))
703705
.prebid(rubiconImpExtPrebid)
704706
.build();
705707
}
@@ -947,6 +949,11 @@ private ObjectNode getSkadn(ObjectNode impExt) {
947949
return skadnNode != null && skadnNode.isObject() ? (ObjectNode) skadnNode : null;
948950
}
949951

952+
private String getTid(ObjectNode impExt) {
953+
final JsonNode tidNode = impExt.get(TID_FIELD);
954+
return tidNode != null && tidNode.isTextual() ? tidNode.asText() : null;
955+
}
956+
950957
private String getAdSlot(Imp imp) {
951958
final ObjectNode dataNode = toObjectNode(imp.getExt().get(FPD_DATA_FIELD));
952959

src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ public class RubiconImpExt {
2020

2121
ObjectNode skadn;
2222

23+
String tid;
24+
2325
RubiconImpExtPrebid prebid;
2426
}

src/main/resources/bidder-config/driftpixel.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ adapters:
1313
- native
1414
supported-vendors:
1515
vendor-id: 0
16+
usersync:
17+
cookie-family-name: driftpixel
18+
redirect:
19+
url: "https://sync.driftpixel.live/psync?t=s&e=0&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&cb={{redirect_url}}"
20+
support-cors: false
21+
uid-macro: "%USER_ID%"

src/main/resources/bidder-config/pgamssp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ adapters:
1212
- video
1313
- native
1414
supported-vendors:
15-
vendor-id: 0
15+
vendor-id: 1353
1616
usersync:
1717
cookie-family-name: pgamssp
1818
redirect:

src/main/resources/bidder-config/pubmatic.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
adapters:
22
pubmatic:
33
endpoint: https://hbopenbid.pubmatic.com/translator?source=prebid-server
4+
ortb-version: "2.6"
45
meta-info:
56
maintainer-email: [email protected]
67
app-media-types:

src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,6 @@ class GeneralModuleSpec extends ModuleBaseSpec {
323323
assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
324324
assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
325325

326-
and: "RB-Richmedia-Filter module call metrics shouldn't be updated"
327-
assert !metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
328-
assert !metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
329-
330326
cleanup: "Stop and remove pbs container"
331327
pbsServiceFactory.removeContainer(pbsConfig)
332328
}
@@ -352,7 +348,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
352348
assert !response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten()
353349

354350
and: "Ortb2blocking module call metrics shouldn't be updated"
355-
def metrics = pbsServiceWithMultipleModuleWithRequireInvoke.sendCollectedMetricsRequest()
351+
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
356352
assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
357353
assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
358354
assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
@@ -362,7 +358,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
362358
pbsServiceFactory.removeContainer(pbsConfig)
363359
}
364360

365-
def "PBS should call module without account config when default-account module-execution config enabled module"() {
361+
def "PBS shouldn't call module and not override host config when default-account module-execution config enabled module"() {
366362
given: "PBS service with module-execution and default account configs"
367363
def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap {
368364
hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): true]))
@@ -391,15 +387,53 @@ class GeneralModuleSpec extends ModuleBaseSpec {
391387
assert !response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten()
392388

393389
and: "Ortb2blocking module call metrics shouldn't be updated"
394-
def metrics = pbsServiceWithMultipleModuleWithRequireInvoke.sendCollectedMetricsRequest()
390+
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
395391
assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
396392
assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
397393
assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
398394
assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
399395

400-
and: "RB-Richmedia-Filter module call metrics shouldn't be updated"
401-
assert !metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
402-
assert !metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
396+
cleanup: "Stop and remove pbs container"
397+
pbsServiceFactory.removeContainer(pbsConfig)
398+
}
399+
400+
def "PBS should call module without account module config when default-account module-execution config enabling module"() {
401+
given: "PBS service with module-execution and default account configs"
402+
def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap {
403+
hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): true]))
404+
}
405+
def pbsConfig = MULTI_MODULE_CONFIG + ENABLED_INVOKE_CONFIG + ["settings.default-account-config": encode(defaultAccountConfigSettings)]
406+
def pbsServiceWithMultipleModules = pbsServiceFactory.getService(pbsConfig)
407+
408+
and: "Default bid request with verbose trace"
409+
def bidRequest = defaultBidRequest.tap {
410+
ext.prebid.trace = TraceLevel.VERBOSE
411+
}
412+
413+
and: "Save account without modules config"
414+
def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(modules: null))
415+
def account = new Account(uuid: bidRequest.getAccountId(), config: accountConfig)
416+
accountDao.save(account)
417+
418+
and: "Flush metrics"
419+
flushMetrics(pbsServiceWithMultipleModules)
420+
421+
when: "PBS processes auction request"
422+
def response = pbsServiceWithMultipleModules.sendAuctionRequest(bidRequest)
423+
424+
then: "PBS response should include trace information about called modules"
425+
verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List<InvocationResult>) {
426+
it.status == [SUCCESS, SUCCESS]
427+
it.action == [NO_ACTION, NO_ACTION]
428+
it.hookId.moduleCode.sort() == [ORTB2_BLOCKING, ORTB2_BLOCKING].code.sort()
429+
}
430+
431+
and: "Ortb2blocking module call metrics should be updated"
432+
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
433+
assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
434+
assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
435+
assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
436+
assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
403437

404438
cleanup: "Stop and remove pbs container"
405439
pbsServiceFactory.removeContainer(pbsConfig)

src/test/groovy/org/prebid/server/functional/tests/privacy/ActivityTraceLogSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class ActivityTraceLogSpec extends PrivacyBaseSpec {
121121
accountDao.save(account)
122122

123123
when: "PBS processes auction requests"
124-
def bidResponse = pbsServiceFactory.getService(PBS_CONFIG).sendAuctionRequest(bidRequest)
124+
def bidResponse = activityPbsService.sendAuctionRequest(bidRequest)
125125

126126
then: "Bid response should contain basic info in debug"
127127
def infrastructure = bidResponse.ext.debug.trace.activityInfrastructure

src/test/groovy/org/prebid/server/functional/tests/privacy/GdprAmpSpec.groovy

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import org.prebid.server.functional.model.request.auction.BidRequest
1313
import org.prebid.server.functional.model.request.auction.DistributionChannel
1414
import org.prebid.server.functional.model.request.auction.Regs
1515
import org.prebid.server.functional.model.request.auction.RegsExt
16-
import org.prebid.server.functional.service.PrebidServerService
17-
import org.prebid.server.functional.testcontainers.container.PrebidServerContainer
1816
import org.prebid.server.functional.util.PBSUtils
1917
import org.prebid.server.functional.util.privacy.BogusConsent
2018
import org.prebid.server.functional.util.privacy.CcpaConsent
@@ -320,10 +318,8 @@ class GdprAmpSpec extends PrivacyBaseSpec {
320318
def startTime = Instant.now()
321319

322320
and: "Create new container"
323-
def serverContainer = new PrebidServerContainer(GDPR_VENDOR_LIST_CONFIG +
324-
["adapters.generic.meta-info.vendor-id": GENERIC_VENDOR_ID as String])
325-
serverContainer.start()
326-
def privacyPbsService = new PrebidServerService(serverContainer)
321+
def config = GDPR_VENDOR_LIST_CONFIG + ["adapters.generic.meta-info.vendor-id": GENERIC_VENDOR_ID as String]
322+
def defaultPrivacyPbsService = pbsServiceFactory.getService(config)
327323

328324
and: "Prepare tcf consent string"
329325
def tcfConsent = new TcfConsent.Builder()
@@ -347,21 +343,21 @@ class GdprAmpSpec extends PrivacyBaseSpec {
347343
vendorListResponse.setResponse(tcfPolicyVersion)
348344

349345
when: "PBS processes amp request"
350-
privacyPbsService.sendAmpRequest(ampRequest)
346+
defaultPrivacyPbsService.sendAmpRequest(ampRequest)
351347

352348
then: "Used vendor list have proper specification version of GVL"
353349
def properVendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString())
354-
PBSUtils.waitUntil { privacyPbsService.isFileExist(properVendorListPath) }
355-
def vendorList = privacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class)
350+
PBSUtils.waitUntil { defaultPrivacyPbsService.isFileExist(properVendorListPath) }
351+
def vendorList = defaultPrivacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class)
356352
assert vendorList.tcfPolicyVersion == tcfPolicyVersion.vendorListVersion
357353

358354
and: "Logs should contain proper vendor list version"
359-
def logs = privacyPbsService.getLogsByTime(startTime)
355+
def logs = defaultPrivacyPbsService.getLogsByTime(startTime)
360356
assert getLogsByText(logs, "Created new TCF 2 vendor list for version " +
361357
"v${tcfPolicyVersion.vendorListVersion}.${tcfPolicyVersion.vendorListVersion}")
362358

363-
cleanup: "Stop container with default request"
364-
serverContainer.stop()
359+
cleanup: "Stop and remove pbs container"
360+
pbsServiceFactory.removeContainer(config)
365361

366362
where:
367363
tcfPolicyVersion << [TCF_POLICY_V2, TCF_POLICY_V4, TCF_POLICY_V5]
@@ -410,7 +406,10 @@ class GdprAmpSpec extends PrivacyBaseSpec {
410406
}
411407

412408
def "PBS amp should emit the same error without a second GVL list request if a retry is too soon for the exponential-backoff"() {
413-
given: "Test start time"
409+
given: "Prebid server with privacy settings"
410+
def defaultPrivacyPbsService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG)
411+
412+
and: "Test start time"
414413
def startTime = Instant.now()
415414

416415
and: "Prepare tcf consent string"
@@ -438,33 +437,36 @@ class GdprAmpSpec extends PrivacyBaseSpec {
438437
vendorListResponse.setResponse(tcfPolicyVersion, Delay.seconds(EXPONENTIAL_BACKOFF_MAX_DELAY + 3))
439438

440439
when: "PBS processes amp request"
441-
privacyPbsService.sendAmpRequest(ampRequest)
440+
defaultPrivacyPbsService.sendAmpRequest(ampRequest)
442441

443442
then: "PBS shouldn't fetch vendor list"
444443
def vendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString())
445-
assert !privacyPbsService.isFileExist(vendorListPath)
444+
assert !defaultPrivacyPbsService.isFileExist(vendorListPath)
446445

447446
and: "Logs should contain proper vendor list version"
448-
def logs = privacyPbsService.getLogsByTime(startTime)
447+
def logs = defaultPrivacyPbsService.getLogsByTime(startTime)
449448
def tcfError = "TCF 2 vendor list for version v${tcfPolicyVersion.vendorListVersion}.${tcfPolicyVersion.vendorListVersion} not found, started downloading."
450449
assert getLogsByText(logs, tcfError)
451450

452451
and: "Second start for fetch second round of logs"
453452
def secondStartTime = Instant.now()
454453

455454
when: "PBS processes amp request"
456-
privacyPbsService.sendAmpRequest(ampRequest)
455+
defaultPrivacyPbsService.sendAmpRequest(ampRequest)
457456

458457
then: "PBS shouldn't fetch vendor list"
459-
assert !privacyPbsService.isFileExist(vendorListPath)
458+
assert !defaultPrivacyPbsService.isFileExist(vendorListPath)
460459

461460
and: "Logs should contain proper vendor list version"
462-
def logsSecond = privacyPbsService.getLogsByTime(secondStartTime)
461+
def logsSecond = defaultPrivacyPbsService.getLogsByTime(secondStartTime)
463462
assert getLogsByText(logsSecond, tcfError)
464463

465464
and: "Reset vendor list response"
466465
vendorListResponse.reset()
467466

467+
cleanup: "Stop and remove pbs container"
468+
pbsServiceFactory.removeContainer(GENERAL_PRIVACY_CONFIG)
469+
468470
where:
469471
tcfPolicyVersion << [TCF_POLICY_V2, TCF_POLICY_V4, TCF_POLICY_V5]
470472
}
@@ -659,7 +661,10 @@ class GdprAmpSpec extends PrivacyBaseSpec {
659661
}
660662

661663
def "PBS amp should set 3 for tcfPolicyVersion when tcfPolicyVersion is #tcfPolicyVersion"() {
662-
given: "Tcf consent setup"
664+
given: "Prebid server with privacy settings"
665+
def defaultPrivacyPbsService = pbsServiceFactory.getService(GENERAL_PRIVACY_CONFIG)
666+
667+
and: "Tcf consent setup"
663668
def tcfConsent = new TcfConsent.Builder()
664669
.setPurposesLITransparency(BASIC_ADS)
665670
.setTcfPolicyVersion(tcfPolicyVersion.value)
@@ -681,14 +686,17 @@ class GdprAmpSpec extends PrivacyBaseSpec {
681686
vendorListResponse.setResponse(tcfPolicyVersion)
682687

683688
when: "PBS processes amp request"
684-
privacyPbsService.sendAmpRequest(ampRequest)
689+
defaultPrivacyPbsService.sendAmpRequest(ampRequest)
685690

686691
then: "Used vendor list have proper specification version of GVL"
687692
def properVendorListPath = VENDOR_LIST_PATH.replace("{VendorVersion}", tcfPolicyVersion.vendorListVersion.toString())
688-
PBSUtils.waitUntil { privacyPbsService.isFileExist(properVendorListPath) }
689-
def vendorList = privacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class)
693+
PBSUtils.waitUntil { defaultPrivacyPbsService.isFileExist(properVendorListPath) }
694+
def vendorList = defaultPrivacyPbsService.getValueFromContainer(properVendorListPath, VendorListConsent.class)
690695
assert vendorList.gvlSpecificationVersion == V3
691696

697+
cleanup: "Stop and remove pbs container"
698+
pbsServiceFactory.removeContainer(GENERAL_PRIVACY_CONFIG)
699+
692700
where:
693701
tcfPolicyVersion << [TCF_POLICY_V4, TCF_POLICY_V5]
694702
}

0 commit comments

Comments
 (0)