Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functional tests for aligning TCF and tests for support transmitEids activity controls #2893

Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ class PurposeConfig {
PurposeEnforcement enforcePurpose
Boolean enforceVendors
List<String> vendorExceptions
PurposeEid eid
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.prebid.server.functional.model.config

import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.databind.annotation.JsonNaming
import groovy.transform.ToString

@ToString(includeNames = true, ignoreNulls = true)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy)
class PurposeEid {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably missing this configuration prebid/prebid-server#2904.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link for the general page. But config is:

privacy.gdpr.purposes.p4.eid.require_consent: true/false
privacy.gdpr.purposes.p4.eid.exceptions: ["pubcid.org"]

Did I miss something?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this one privacy.gdpr.purposes.p4.eid.activity_transition

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marki1an added, thanks for notes

Boolean requireConsent
List<String> exceptions
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.prebid.server.functional.model.privacy

import groovy.transform.ToString
import org.prebid.server.functional.model.bidder.BidderName
import org.prebid.server.functional.model.config.Purpose
import org.prebid.server.functional.model.config.PurposeEnforcement
import org.prebid.server.functional.util.privacy.TcfConsent

@ToString(includeNames = true, ignoreNulls = true)
class EnforcementRequirements {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better naming for me: EnforcementRequirement


Purpose purpose
PurposeEnforcement enforcePurpose
Purpose purposeConsent
Boolean enforceVendor
Integer vendorConsentBitField
Integer vendorLegitimateInterestBitField
List<BidderName> vendorExceptions
Purpose purposesLITransparency
List<TcfConsent.RestrictionType> restrictionType
Integer vendorIdGvl
Integer vendorListVersion
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum ActivityType {
TRANSMIT_UFPD("transmitUfpd"),
TRANSMIT_PRECISE_GEO("transmitPreciseGeo"),
TRANSMIT_TID("transmitTid"),
TRANSMIT_EIDS("transmitEids"),
TRANSMIT_EIDS("transmitEids")

@JsonValue
final String value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.prebid.server.functional.model.request.auction

import groovy.transform.ToString

import static org.prebid.server.functional.model.request.auction.ActivityType.TRANSMIT_EIDS
import static org.prebid.server.functional.model.request.auction.ActivityType.TRANSMIT_PRECISE_GEO
import static org.prebid.server.functional.model.request.auction.ActivityType.TRANSMIT_TID
import static org.prebid.server.functional.model.request.auction.ActivityType.TRANSMIT_UFPD
Expand All @@ -18,6 +19,7 @@ class AllowActivities {
Activity enrichUfpd
Activity reportAnalytics
Activity transmitUfpd
Activity transmitEids
Activity transmitPreciseGeo
Activity transmitTid

Expand All @@ -30,6 +32,8 @@ class AllowActivities {
return fetchBids = activity
case ENRICH_UFPD:
return enrichUfpd = activity
case TRANSMIT_EIDS:
return transmitEids = activity
case REPORT_ANALYTICS:
return reportAnalytics = activity
case TRANSMIT_UFPD:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.prebid.server.functional.model.request.auction

import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString
import org.prebid.server.functional.util.PBSUtils

@ToString(includeNames = true, ignoreNulls = true)
@EqualsAndHashCode
class Eid {

String source
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.prebid.server.functional.model.request.auction

import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString
import org.prebid.server.functional.util.PBSUtils

@ToString(includeNames = true, ignoreNulls = true)
@EqualsAndHashCode
class Uid {

String id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class VendorList extends NetworkScaffolding {
request().withPath(VENDOR_LIST_ENDPOINT)
}

@Override
void reset() {
TcfPolicyVersion.values().each { version -> super.reset("/v${version}/vendor-list.json") }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here should be ${version.vendorListVersion}

}

void setResponse(TcfPolicyVersion tcfPolicyVersion = TCF_POLICY_V2,
Map<Integer, Vendor> vendors = [(GENERIC_VENDOR_ID): Vendor.getDefaultVendor(GENERIC_VENDOR_ID)]) {
def prepareEndpoint = endpoint.replace("{TCF_POLICY}", "v" + tcfPolicyVersion.vendorListVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class AuctionSpec extends BaseSpec {

then: "Bidder request shouldn't contain buyeruid from the user.ext.prebid.buyeruids"
def bidderRequest = bidder.getBidderRequest(bidRequest.id)
assert !bidderRequest.user
assert !bidderRequest.user.ext
}

def "PBS should populate buyeruid from uids cookie when buyeruids with appropriate bidder but without value present in request"() {
Expand Down Expand Up @@ -213,7 +213,7 @@ class AuctionSpec extends BaseSpec {

then: "Bidder request shouldn't contain buyeruid from the uids cookie"
def bidderRequest = bidder.getBidderRequest(bidRequest.id)
assert !bidderRequest.user
assert !bidderRequest.user.buyeruid
}

def "PBS should take precedence buyeruids whenever present valid uid cookie"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.prebid.server.functional.model.db.Account
import org.prebid.server.functional.model.db.StoredImp
import org.prebid.server.functional.model.db.StoredRequest
import org.prebid.server.functional.model.request.amp.AmpRequest
import org.prebid.server.functional.model.request.auction.Asset
import org.prebid.server.functional.model.request.auction.Banner
import org.prebid.server.functional.model.request.auction.BidRequest
import org.prebid.server.functional.model.request.auction.Device
Expand All @@ -24,7 +23,6 @@ import org.prebid.server.functional.model.response.auction.BidResponse
import org.prebid.server.functional.model.response.auction.ErrorType
import org.prebid.server.functional.util.PBSUtils
import org.prebid.server.functional.util.privacy.CcpaConsent
import spock.lang.IgnoreRest

import static org.prebid.server.functional.model.bidder.BidderName.APPNEXUS
import static org.prebid.server.functional.model.bidder.BidderName.GENERIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,6 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec {
assert response.responseBody
}


def "PBS setuid call when privacy regulation don't match custom requirement should respond with required UIDs cookies"() {
given: "Cookie sync SetuidRequest with accountId"
def accountId = PBSUtils.randomNumber as String
Expand Down
Loading