-
Notifications
You must be signed in to change notification settings - Fork 190
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
Add functional tests for aligning TCF and tests for support transmitEids activity controls #2893
Conversation
…ing-TCF-and-Activity-Controls
…ing-TCF-and-Activity-Controls
…ing-TCF-and-Activity-Controls
7acc755
to
010be34
Compare
…ing-TCF-and-Activity-Controls
47b66c3
to
c6bd6a2
Compare
c6bd6a2
to
f23a2be
Compare
@ToString(includeNames = true, ignoreNulls = true) | ||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy) | ||
class PurposeEid { | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
|
||
then: "Generic bidder request should have data in Eid field" | ||
def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
assert bidderRequest.user.eids == userEids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK we should check FPD fields, not a Eids
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to Eids
tests as the main point for this feature, let me know if ufpd
test required
@@ -0,0 +1,23 @@ | |||
package org.prebid.server.functional.model.privacy | |||
|
|||
import com.iabtcf.v2.PublisherRestriction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
List<BidderName> vendorExceptions | ||
List<BidderName> softVendorExceptions | ||
Purpose purposesLITransparency | ||
List<RestrictionType> restrictionType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please use your own RestroctionType
- I don't see the
flexiblePurposes
,legIntPurposes
,publisherRestrictions
, fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- good point, updated
flexiblePurposes
,legIntPurposes
,publisherRestrictions
are completely included in the GVL files for TcfFullTransmitEidsAligningActivitiesSpec. Creating separate files for each purpose would be unnecessarily resource-intensive for software systems
def purposes = TcfUtils.getPurposeConfigsForPersonalizedAds(enforcementRequirments, true) | ||
def accountGdprConfig = new AccountGdprConfig(purposes: purposes) | ||
def activity = Activity.getDefaultActivity([ActivityRule.getDefaultActivityRule(Condition.baseCondition, true)]) | ||
def account = getAccountWithGdpr(bidRequest.accountId, accountGdprConfig).tap { | ||
config.privacy.allowActivities = AllowActivities.getDefaultAllowActivities(TRANSMIT_UFPD, activity) | ||
} | ||
accountDao.save(account) | ||
|
||
when: "PBS processes auction requests" | ||
privacyPbsServiceWithMultipleGvl.sendAuctionRequest(bidRequest) | ||
|
||
then: "Generic bidder request should have data in Eid field" | ||
def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
assert bidderRequest.user.eids == userEids | ||
|
||
where: | ||
enforcementRequirments << getLegalEnforcementRequirments(P4) + getCompanyEnforcementRequirments(P4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Minor, typo
requierments
- You try to populate as much as you can, but the method getPurposeConfigsForPersonalizedAds() doesn't take a list of enforcementRequirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated typo, and we don't put a list of enforcementRequirements for getPurposeConfigsForPersonalizedAds. It simply creates a list concatenation by the + operator and then appends it to enforcement requirements by the “<<” operator. That is why we have all requirements separately
class TcfFullTransmitUfpdAligningActivitiesSpec extends PrivacyBaseSpec { | ||
|
||
@Shared | ||
static final int PURPOSES_ONLY_GVL_VERSION = PBSUtils.getRandomNumber(0, 4095) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please place private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
…ing-TCF-and-Activity-Controls
894e020
to
44e6549
Compare
import static org.prebid.server.functional.model.request.auction.TraceLevel.VERBOSE | ||
import static org.prebid.server.functional.util.privacy.TcfConsent.GENERIC_VENDOR_ID | ||
|
||
class TcfBasicTransmitEidsAligningActivitiesSpec extends PrivacyBaseSpec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TcfBasicTransmitEidsActivitiesSpec
assert bidderRequest.user.eids == userEids | ||
|
||
where: | ||
enforcementRequirments << getCompanyBasedEnforcementRequirments(P4) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type: getCompanyBasedEnforcementRequirements
import org.prebid.server.functional.util.privacy.TcfConsent | ||
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
class EnforcementRequirements { |
There was a problem hiding this comment.
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
...org/prebid/server/functional/tests/privacy/TcfBasicTransmitEidsAligningActivitiesSpec.groovy
Outdated
Show resolved
Hide resolved
static Map<Purpose, PurposeConfig> getPurposeConfigsForPersonalizedAds(EnforcementRequirements enforcementRequirments, boolean requireConsent = false, List<String> eidsExceptions = []) { | ||
def purpose = enforcementRequirments.purposeConsent ?: enforcementRequirments.purpose | ||
// Basic Ads required for any bidder call, should be present at least as company consent | ||
Map<Purpose, PurposeConfig> purposes = [(Purpose.P2): new PurposeConfig(enforcePurpose: NO, enforceVendors: false)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: please replace Map
on def
import static org.prebid.server.functional.util.privacy.TcfConsent.RestrictionType.UNDEFINED | ||
import static org.prebid.server.functional.util.privacy.TcfConsent.TcfPolicyVersion.TCF_POLICY_V2 | ||
|
||
class TcfFullTransmitEidsAligningActivitiesSpec extends PrivacyBaseSpec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TcfFullTransmitEidsActivitiesSpec
|
||
private final PrebidServerService activityPbsServiceExcludeGvl = pbsServiceFactory.getService(PBS_CONFIG) | ||
|
||
private final PrebidServerService activityPbsServiceExcludeGvlWithElderOrtb = pbsServiceFactory.getService(PBS_CONFIG + ["adapters.generic.ortb-version": "2.5"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, we can omit elder ORTB.
- We have tests for it, and privacy doesn't affect these fields.
- This is legacy behaviour and we should not care about it.
@Net-burst What do you think about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't reviewed the whole PR yet, but I'd leave it be. Because otherwise, we won't be able to tell for sure whether masking happens before or after the normalization. But maybe it would be worth moving those tests to a separate location.
private static String getVendorListPath(Integer gvlVersion) { | ||
"/app/prebid-server/data/vendorlist-v${TCF_POLICY_V2.vendorListVersion}/${gvlVersion}.json" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to move in PrivacyBaseSpec
import org.prebid.server.functional.model.request.auction.Eid | ||
import org.prebid.server.functional.service.PrebidServerService | ||
import org.prebid.server.functional.util.privacy.TcfUtils | ||
import spock.lang.IgnoreRest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used import
|
||
import static org.prebid.server.functional.model.bidder.BidderName.ALIAS | ||
import static org.prebid.server.functional.model.bidder.BidderName.GENERIC | ||
import static org.prebid.server.functional.model.bidder.BidderName.RUBICON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -177,6 +181,55 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { | |||
assert metrics[DISALLOWED_COUNT_FOR_GENERIC_ADAPTER] == 1 | |||
} | |||
|
|||
def "PBS auction call when transmit UFPD activities is rejecting requests with activityTransition false should remove only UFPD fields in request"() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this test to the end of the spec
@@ -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") } |
There was a problem hiding this comment.
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}
it.setAccountId(accountId) | ||
it.ext.prebid.trace = VERBOSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary setup of those fields since they are already applied in givenBidRequestWithAccountAndEidsData(...) and check other occurrences.
def purposesLITransparency = enforcementRequirements.getPurposesLITransparency() | ||
def restrictionType = enforcementRequirements.restrictionType | ||
def vendorIdGvl = enforcementRequirements.vendorIdGvl | ||
def builder = new Builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use new TcfConsent.Builder()
istead of new Builder()
|
||
then: "Generic bidder request should have data in Eid field" | ||
def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
assert bidderRequest.user.eids == userEids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about bidderRequest.user?.ext?.eids
|
||
then: "Generic bidder request should have data in Eid field" | ||
def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
assert bidderRequest.user.ext.eids == userEids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bidderRequest.user?.eids?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check other cases
|
||
then: "Generic bidder request shouldn't have data in Eid field" | ||
def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor empty line
import static org.prebid.server.functional.model.request.auction.ActivityType.TRANSMIT_EIDS | ||
import static org.prebid.server.functional.model.request.auction.TraceLevel.VERBOSE | ||
|
||
class PrivacyOrtbConverterSpec extends PrivacyBaseSpec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better naming TransmitEidsOrtbConverterActivitiesSpec
|
||
then: "Generic bidder request should have data in Eid field" | ||
def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
assert bidderRequest?.user?.ext?.eids == userEids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an assertion for bidderRequest.user.eids
?
Check other occurrences.
No description provided.