diff --git a/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUser.java b/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUser.java index cb1747b6285..d71522b02e1 100644 --- a/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUser.java +++ b/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUser.java @@ -89,6 +89,7 @@ private static boolean checkKnownChildSensitiveDataConsents(USNatGppReader gppRe return equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 0) || equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 1) + || equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 2) || equalsAtIndex(KnownChildSensitiveDataConsent.CONSENT, knownChildSensitiveDataConsents, 1); } diff --git a/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeo.java b/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeo.java index 16c67001786..f4daba2c51c 100644 --- a/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeo.java +++ b/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeo.java @@ -62,6 +62,7 @@ private static boolean checkKnownChildSensitiveDataConsents(USNatGppReader gppRe return equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 0) || equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 1) + || equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 2) || equalsAtIndex(KnownChildSensitiveDataConsent.CONSENT, knownChildSensitiveDataConsents, 1); } diff --git a/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpd.java b/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpd.java index 51a64cb260d..f3fe60a4923 100644 --- a/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpd.java +++ b/src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpd.java @@ -30,9 +30,10 @@ public class USNatTransmitUfpd implements PrivacyModule, Loggable { - private static final Set SENSITIVE_DATA_INDICES_SET_1 = Set.of(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11); - private static final Set SENSITIVE_DATA_INDICES_SET_2 = Set.of(0, 1, 2, 3, 4, 10); - private static final Set SENSITIVE_DATA_INDICES_SET_3 = Set.of(5, 6, 8, 9, 11); + private static final Set SENSITIVE_DATA_INDICES_SET_1 = Set.of( + 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15); + private static final Set SENSITIVE_DATA_INDICES_SET_2 = Set.of(0, 1, 2, 3, 4, 10, 12, 14); + private static final Set SENSITIVE_DATA_INDICES_SET_3 = Set.of(5, 6, 8, 9, 11, 13, 15); private final USNatGppReader gppReader; private final Result result; @@ -125,6 +126,7 @@ private static boolean checkKnownChildSensitiveDataConsents(USNatGppReader gppRe return equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 0) || equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 1) + || equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 2) || equalsAtIndex(KnownChildSensitiveDataConsent.CONSENT, knownChildSensitiveDataConsents, 1); } diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/GpcSubsectionType.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/GpcSubsectionType.groovy new file mode 100644 index 00000000000..97b44f7ab36 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/GpcSubsectionType.groovy @@ -0,0 +1,16 @@ +package org.prebid.server.functional.model.privacy.gpp + +import com.fasterxml.jackson.annotation.JsonValue + +enum GpcSubsectionType { + + CORE(0), + GPC(1) + + @JsonValue + final int value + + GpcSubsectionType(int value) { + this.value = value + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/GppDataActivity.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/GppDataActivity.groovy new file mode 100644 index 00000000000..36a015bde7d --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/GppDataActivity.groovy @@ -0,0 +1,17 @@ +package org.prebid.server.functional.model.privacy.gpp + +import com.fasterxml.jackson.annotation.JsonValue + +enum GppDataActivity { + + NOT_APPLICABLE(0), + NO_CONSENT(1), + CONSENT(2) + + @JsonValue + final int value + + GppDataActivity(int value) { + this.value = value + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/MspaMode.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/MspaMode.groovy new file mode 100644 index 00000000000..7d2b5845453 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/MspaMode.groovy @@ -0,0 +1,17 @@ +package org.prebid.server.functional.model.privacy.gpp + +import com.fasterxml.jackson.annotation.JsonValue + +enum MspaMode { + + NOT_APPLICABLE(0), + YES(1), + NO(2) + + @JsonValue + final int value + + MspaMode(int value) { + this.value = value + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/Notice.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/Notice.groovy new file mode 100644 index 00000000000..5a251e87d47 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/Notice.groovy @@ -0,0 +1,17 @@ +package org.prebid.server.functional.model.privacy.gpp + +import com.fasterxml.jackson.annotation.JsonValue + +enum Notice { + + NOT_APPLICABLE(0), + PROVIDED(1), + NOT_PROVIDED(2) + + @JsonValue + final int value + + Notice(int value) { + this.value = value + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/OptOut.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/OptOut.groovy new file mode 100644 index 00000000000..eb82dd645e9 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/OptOut.groovy @@ -0,0 +1,17 @@ +package org.prebid.server.functional.model.privacy.gpp + +import com.fasterxml.jackson.annotation.JsonValue + +enum OptOut { + + NOT_APPLICABLE(0), + OPTED_OUT(1), + DID_NOT_OPT_OUT(2) + + @JsonValue + final int value + + OptOut(int value) { + this.value = value + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsCaliforniaV1ChildSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsCaliforniaV1ChildSensitiveData.groovy new file mode 100644 index 00000000000..92b9ddcc8db --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsCaliforniaV1ChildSensitiveData.groovy @@ -0,0 +1,29 @@ +package org.prebid.server.functional.model.privacy.gpp + +import org.prebid.server.functional.util.PBSUtils + +class UsCaliforniaV1ChildSensitiveData { + + GppDataActivity childUnder13 + GppDataActivity childFrom13to16 + + static UsCaliforniaV1ChildSensitiveData getDefault(GppDataActivity childUnder13 = GppDataActivity.NOT_APPLICABLE, + GppDataActivity childFrom13to16 = GppDataActivity.NOT_APPLICABLE) { + + new UsCaliforniaV1ChildSensitiveData().tap { + it.childUnder13 = childUnder13 + it.childFrom13to16 = childFrom13to16 + } + } + + static UsCaliforniaV1ChildSensitiveData getRandom(List excludedActivities) { + new UsCaliforniaV1ChildSensitiveData().tap { + it.childUnder13 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + it.childFrom13to16 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + } + } + + List getContentList() { + [childFrom13to16, childUnder13]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsCaliforniaV1SensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsCaliforniaV1SensitiveData.groovy new file mode 100644 index 00000000000..3d78e8c4874 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsCaliforniaV1SensitiveData.groovy @@ -0,0 +1,19 @@ +package org.prebid.server.functional.model.privacy.gpp + +class UsCaliforniaV1SensitiveData { + + GppDataActivity idNumbers + GppDataActivity accountInfo + GppDataActivity geolocation + GppDataActivity racialEthnicOrigin + GppDataActivity communicationContents + GppDataActivity geneticId + GppDataActivity biometricId + GppDataActivity healthInfo + GppDataActivity orientation + + List getContentList() { + [idNumbers, accountInfo, geolocation, racialEthnicOrigin, + communicationContents, geneticId, biometricId, healthInfo, orientation]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsColoradoV1ChildSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsColoradoV1ChildSensitiveData.groovy new file mode 100644 index 00000000000..72d40a316ad --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsColoradoV1ChildSensitiveData.groovy @@ -0,0 +1,24 @@ +package org.prebid.server.functional.model.privacy.gpp + +import org.prebid.server.functional.util.PBSUtils + +class UsColoradoV1ChildSensitiveData { + + GppDataActivity childSensitive + + static UsColoradoV1ChildSensitiveData getDefault(GppDataActivity childSensitive = GppDataActivity.NOT_APPLICABLE) { + new UsColoradoV1ChildSensitiveData().tap { + it.childSensitive = childSensitive + } + } + + static UsColoradoV1ChildSensitiveData getRandom(List excludedActivities) { + new UsColoradoV1ChildSensitiveData().tap { + it.childSensitive = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + } + } + + Integer getContentList() { + this.childSensitive.value + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsColoradoV1SensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsColoradoV1SensitiveData.groovy new file mode 100644 index 00000000000..59e19d673b9 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsColoradoV1SensitiveData.groovy @@ -0,0 +1,17 @@ +package org.prebid.server.functional.model.privacy.gpp + +class UsColoradoV1SensitiveData { + + GppDataActivity racialEthnicOrigin + GppDataActivity religiousBeliefs + GppDataActivity healthInfo + GppDataActivity orientation + GppDataActivity citizenshipStatus + GppDataActivity geneticId + GppDataActivity biometricId + + List getContentList() { + [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, + citizenshipStatus, geneticId, biometricId]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsConnecticutV1ChildSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsConnecticutV1ChildSensitiveData.groovy new file mode 100644 index 00000000000..78ec426efb5 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsConnecticutV1ChildSensitiveData.groovy @@ -0,0 +1,33 @@ +package org.prebid.server.functional.model.privacy.gpp + +import org.prebid.server.functional.util.PBSUtils + +class UsConnecticutV1ChildSensitiveData { + + GppDataActivity childUnder13 + GppDataActivity childFrom13to16 + GppDataActivity childFrom16to18 + + static UsConnecticutV1ChildSensitiveData getDefault(GppDataActivity childUnder13 = GppDataActivity.NOT_APPLICABLE, + GppDataActivity childFrom13to16 = GppDataActivity.NOT_APPLICABLE, + GppDataActivity childFrom16to18 = GppDataActivity.NOT_APPLICABLE) { + + new UsConnecticutV1ChildSensitiveData().tap { + it.childUnder13 = childUnder13 + it.childFrom13to16 = childFrom13to16 + it.childFrom16to18 = childFrom16to18 + } + } + + static UsConnecticutV1ChildSensitiveData getRandom(List excludedActivities = []) { + new UsConnecticutV1ChildSensitiveData().tap { + it.childUnder13 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + it.childFrom13to16 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + it.childFrom16to18 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + } + } + + List getContentList() { + [childFrom13to16, childUnder13, childFrom16to18]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsConnecticutV1SensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsConnecticutV1SensitiveData.groovy new file mode 100644 index 00000000000..844b435cfe4 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsConnecticutV1SensitiveData.groovy @@ -0,0 +1,19 @@ +package org.prebid.server.functional.model.privacy.gpp + +class UsConnecticutV1SensitiveData { + + GppDataActivity racialEthnicOrigin + GppDataActivity religiousBeliefs + GppDataActivity healthInfo + GppDataActivity orientation + GppDataActivity citizenshipStatus + GppDataActivity geneticId + GppDataActivity biometricId + GppDataActivity geolocation + GppDataActivity idNumbers + + List getContentList() { + [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, + citizenshipStatus, geneticId, biometricId, geolocation, idNumbers]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV1ChildSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV1ChildSensitiveData.groovy new file mode 100644 index 00000000000..ab2edc1d8ce --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV1ChildSensitiveData.groovy @@ -0,0 +1,29 @@ +package org.prebid.server.functional.model.privacy.gpp + +import org.prebid.server.functional.util.PBSUtils + +class UsNationalV1ChildSensitiveData { + + GppDataActivity childUnder13 + GppDataActivity childFrom13to16 + + static UsNationalV1ChildSensitiveData getDefault(GppDataActivity childUnder13 = GppDataActivity.NOT_APPLICABLE, + GppDataActivity childFrom13to16 = GppDataActivity.NOT_APPLICABLE) { + + new UsNationalV1ChildSensitiveData().tap { + it.childUnder13 = childUnder13 + it.childFrom13to16 = childFrom13to16 + } + } + + static UsNationalV1ChildSensitiveData getRandom(List excludedActivities) { + new UsNationalV1ChildSensitiveData().tap { + it.childUnder13 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + it.childFrom13to16 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + } + } + + List getContentList() { + [childFrom13to16, childUnder13]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV1SensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV1SensitiveData.groovy new file mode 100644 index 00000000000..81a26ea9c4c --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV1SensitiveData.groovy @@ -0,0 +1,23 @@ +package org.prebid.server.functional.model.privacy.gpp + +class UsNationalV1SensitiveData { + + GppDataActivity racialEthnicOrigin + GppDataActivity religiousBeliefs + GppDataActivity healthInfo + GppDataActivity orientation + GppDataActivity citizenshipStatus + GppDataActivity geneticId + GppDataActivity biometricId + GppDataActivity geolocation + GppDataActivity idNumbers + GppDataActivity accountInfo + GppDataActivity unionMembership + GppDataActivity communicationContents + + List getContentList() { + [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, + citizenshipStatus, geneticId, biometricId, geolocation, + idNumbers, accountInfo, unionMembership, communicationContents]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV2ChildSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV2ChildSensitiveData.groovy new file mode 100644 index 00000000000..5edbd69b4d0 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV2ChildSensitiveData.groovy @@ -0,0 +1,31 @@ +package org.prebid.server.functional.model.privacy.gpp + +import org.prebid.server.functional.util.PBSUtils + +class UsNationalV2ChildSensitiveData extends UsNationalV1ChildSensitiveData { + + GppDataActivity childFrom16to17 + + static UsNationalV2ChildSensitiveData getDefault(GppDataActivity childUnder13 = GppDataActivity.NOT_APPLICABLE, + GppDataActivity childFrom13to16 = GppDataActivity.NOT_APPLICABLE, + GppDataActivity childFrom16to17 = GppDataActivity.NOT_APPLICABLE) { + + new UsNationalV2ChildSensitiveData().tap { + it.childUnder13 = childUnder13 + it.childFrom13to16 = childFrom13to16 + it.childFrom16to17 = childFrom16to17 + } + } + + static UsNationalV2ChildSensitiveData getRandom(List excludedActivities) { + new UsNationalV2ChildSensitiveData().tap { + it.childUnder13 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + it.childFrom13to16 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + it.childFrom16to17 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + } + } + + List getContentList() { + [childFrom13to16, childUnder13, childFrom16to17]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV2SensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV2SensitiveData.groovy new file mode 100644 index 00000000000..e6f17e23d3f --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsNationalV2SensitiveData.groovy @@ -0,0 +1,17 @@ +package org.prebid.server.functional.model.privacy.gpp + +class UsNationalV2SensitiveData extends UsNationalV1SensitiveData { + + GppDataActivity consumerHealthData + GppDataActivity crimeVictim + GppDataActivity nationalOrigin + GppDataActivity transgenderStatus + + @Override + List getContentList() { + [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, + citizenshipStatus, geneticId, biometricId, geolocation, + idNumbers, accountInfo, unionMembership, communicationContents, + consumerHealthData, crimeVictim, nationalOrigin, transgenderStatus]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsUtahV1ChildSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsUtahV1ChildSensitiveData.groovy new file mode 100644 index 00000000000..063899d850c --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsUtahV1ChildSensitiveData.groovy @@ -0,0 +1,25 @@ +package org.prebid.server.functional.model.privacy.gpp + +import org.prebid.server.functional.util.PBSUtils + +class UsUtahV1ChildSensitiveData { + + GppDataActivity childSensitive + + static UsUtahV1ChildSensitiveData getDefault(GppDataActivity childSensitive = GppDataActivity.NOT_APPLICABLE) { + + new UsUtahV1ChildSensitiveData().tap { + it.childSensitive = childSensitive + } + } + + static UsUtahV1ChildSensitiveData getRandom(List excludedActivities) { + new UsUtahV1ChildSensitiveData().tap { + it.childSensitive = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + } + } + + Integer getContentList() { + childSensitive.value + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsUtahV1SensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsUtahV1SensitiveData.groovy new file mode 100644 index 00000000000..53845f9318a --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsUtahV1SensitiveData.groovy @@ -0,0 +1,18 @@ +package org.prebid.server.functional.model.privacy.gpp + +class UsUtahV1SensitiveData { + + GppDataActivity racialEthnicOrigin + GppDataActivity religiousBeliefs + GppDataActivity orientation + GppDataActivity citizenshipStatus + GppDataActivity healthInfo + GppDataActivity geneticId + GppDataActivity biometricId + GppDataActivity geolocation + + List getContentList() { + [racialEthnicOrigin, religiousBeliefs, orientation, citizenshipStatus, + healthInfo, geneticId, biometricId, geolocation]*.value.collect { it ?: 0 } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsVirginiaV1ChildSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsVirginiaV1ChildSensitiveData.groovy new file mode 100644 index 00000000000..2cffb109ec9 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsVirginiaV1ChildSensitiveData.groovy @@ -0,0 +1,25 @@ +package org.prebid.server.functional.model.privacy.gpp + +import org.prebid.server.functional.util.PBSUtils + +class UsVirginiaV1ChildSensitiveData { + + GppDataActivity childSensitive + + static UsVirginiaV1ChildSensitiveData getDefault(GppDataActivity childSensitive = GppDataActivity.NOT_APPLICABLE) { + + new UsVirginiaV1ChildSensitiveData().tap { + it.childSensitive = childSensitive + } + } + + static UsVirginiaV1ChildSensitiveData getRandom(List excludedActivities = []) { + new UsVirginiaV1ChildSensitiveData().tap { + it.childSensitive = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities) + } + } + + Integer getContentList() { + childSensitive.value + } +} diff --git a/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsVirginiaV1SensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsVirginiaV1SensitiveData.groovy new file mode 100644 index 00000000000..3185883a32b --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/model/privacy/gpp/UsVirginiaV1SensitiveData.groovy @@ -0,0 +1,18 @@ +package org.prebid.server.functional.model.privacy.gpp + +class UsVirginiaV1SensitiveData { + + GppDataActivity racialEthnicOrigin + GppDataActivity religiousBeliefs + GppDataActivity healthInfo + GppDataActivity orientation + GppDataActivity citizenshipStatus + GppDataActivity geneticId + GppDataActivity biometricId + GppDataActivity geolocation + + List getContentList() { + [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, + citizenshipStatus, geneticId, biometricId, geolocation]*.value.collect { it ?: 0 } + } +} 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 7dc412d1780..d9563b7fe4d 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 @@ -16,7 +16,7 @@ import org.prebid.server.functional.model.response.auction.And import org.prebid.server.functional.model.response.auction.GeoCode import org.prebid.server.functional.model.response.auction.RuleConfiguration import org.prebid.server.functional.util.PBSUtils -import org.prebid.server.functional.util.privacy.gpp.UsNatV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsNatV1Consent import static org.prebid.server.functional.model.bidder.BidderName.GENERIC import static org.prebid.server.functional.model.pricefloors.Country.CAN diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppAmpSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppAmpSpec.groovy index 204f2eb7025..ab4d46117ab 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppAmpSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppAmpSpec.groovy @@ -7,8 +7,8 @@ import org.prebid.server.functional.model.request.auction.BidRequest import org.prebid.server.functional.model.request.auction.Regs import org.prebid.server.functional.model.request.auction.RegsExt import org.prebid.server.functional.util.PBSUtils -import org.prebid.server.functional.util.privacy.gpp.TcfEuV2Consent -import org.prebid.server.functional.util.privacy.gpp.UsV1Consent +import org.prebid.server.functional.util.privacy.gpp.v2.TcfEuV2Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UspV1Consent import static org.prebid.server.functional.model.request.GppSectionId.TCF_EU_V2 import static org.prebid.server.functional.model.request.GppSectionId.USP_V1 @@ -133,7 +133,7 @@ class GppAmpSpec extends PrivacyBaseSpec { where: gppConsent << [new TcfEuV2Consent.Builder().build(), - new UsV1Consent.Builder().build()] + new UspV1Consent.Builder().build()] } def "PBS should copy consent_string to user.consent and set gdpr=1 when consent_string is valid and gppSid contains 2"() { @@ -165,7 +165,7 @@ class GppAmpSpec extends PrivacyBaseSpec { def "PBS should copy consent_string to user.us_privacy when consent_string contains us_privacy and gppSid contains 6"() { given: "Default amp request with valid consent_string and gpp consent_type" - def gppConsent = new UsV1Consent.Builder().build() + def gppConsent = new UspV1Consent.Builder().build() def gppSidIds = USP_V1.value def ampRequest = getGppAmpRequest(gppConsent.consentString, gppSidIds) diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppAuctionSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppAuctionSpec.groovy index 4eb78ee2140..d0282d48ddd 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppAuctionSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppAuctionSpec.groovy @@ -8,8 +8,8 @@ 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 org.prebid.server.functional.util.privacy.TcfConsent -import org.prebid.server.functional.util.privacy.gpp.TcfEuV2Consent -import org.prebid.server.functional.util.privacy.gpp.UsV1Consent +import org.prebid.server.functional.util.privacy.gpp.v2.TcfEuV2Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UspV1Consent import static org.prebid.server.functional.model.request.GppSectionId.TCF_EU_V2 import static org.prebid.server.functional.model.request.GppSectionId.USP_V1 @@ -174,7 +174,7 @@ class GppAuctionSpec extends PrivacyBaseSpec { def "PBS should copy regs.gpp to regs.usPrivacy when gppSid contains 6, gpp is USP_V1 and regs.us_privacy isn't specified"() { given: "Default bid request with gpp and gppSid, without us_privacy" - def gppConsent = new UsV1Consent.Builder().build() + def gppConsent = new UspV1Consent.Builder().build() def bidRequest = BidRequest.defaultBidRequest.tap { regs = new Regs(gpp: gppConsent, gppSid: [USP_V1.intValue], usPrivacy: null) } @@ -191,7 +191,7 @@ class GppAuctionSpec extends PrivacyBaseSpec { def "PBS shouldn't copy regs.gpp to regs.usPrivacy when gppSid doesn't contain 6, gpp is USP_V1 and regs.us_privacy isn't specified"() { given: "Default bid request with gpp and gppSid, without us_privacy" def gppSidIds = [PBSUtils.getRandomNumberWithExclusion(USP_V1.intValue)] - def gpp = new UsV1Consent.Builder().build() + def gpp = new UspV1Consent.Builder().build() def bidRequest = BidRequest.defaultBidRequest.tap { regs = new Regs(gppSid: gppSidIds, gpp: gpp, usPrivacy: null) } @@ -212,7 +212,7 @@ class GppAuctionSpec extends PrivacyBaseSpec { def "PBS should emit warning when gppSid contains 6, gpp is USP_V1 and regs.gpp and regs.usPrivacy are different"() { given: "Default bid request with gpp, gppSid and usPrivacy" def gppSidIds = [USP_V1.intValue] - def gpp = new UsV1Consent.Builder().build() + def gpp = new UspV1Consent.Builder().build() def ccpaConsent = new CcpaConsent(explicitNotice: ENFORCED, optOutSale: NOT_ENFORCED) def bidRequest = BidRequest.defaultBidRequest.tap { regs = new Regs(gppSid: gppSidIds, gpp: gpp, usPrivacy: ccpaConsent) diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppCookieSyncSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppCookieSyncSpec.groovy index a5a6a13ca09..045dd33a784 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppCookieSyncSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppCookieSyncSpec.groovy @@ -16,9 +16,9 @@ import org.prebid.server.functional.util.HttpUtil import org.prebid.server.functional.util.PBSUtils import org.prebid.server.functional.util.privacy.CcpaConsent import org.prebid.server.functional.util.privacy.TcfConsent -import org.prebid.server.functional.util.privacy.gpp.TcfEuV2Consent -import org.prebid.server.functional.util.privacy.gpp.UsV1Consent -import spock.lang.IgnoreRest +import org.prebid.server.functional.util.privacy.gpp.v1.UsNatV1Consent +import org.prebid.server.functional.util.privacy.gpp.v2.TcfEuV2Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UspV1Consent import static org.prebid.server.functional.model.bidder.BidderName.ALIAS import static org.prebid.server.functional.model.bidder.BidderName.GENERIC @@ -211,7 +211,7 @@ class GppCookieSyncSpec extends BaseSpec { given: "Cookie sync request" def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { it.gppSid = USP_V1.value - it.gpp = new UsV1Consent.Builder().build() + it.gpp = new UspV1Consent.Builder().build() it.gdpr = null it.usPrivacy = new CcpaConsent(explicitNotice: ENFORCED, optOutSale: ENFORCED) } @@ -328,7 +328,7 @@ class GppCookieSyncSpec extends BaseSpec { given: "Default CookieSyncRequest with gpp and gppSid" def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { it.gppSid = TCF_EU_V2.intValue - it.gpp = new UsV1Consent.Builder().build() + it.gpp = new UsNatV1Consent.Builder().build() it.gppSid = gppSid } @@ -359,7 +359,7 @@ class GppCookieSyncSpec extends BaseSpec { def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { it.gppSid = TCF_EU_V2.intValue it.bidders = [ALIAS] - it.gpp = new UsV1Consent.Builder().build() + it.gpp = new UsNatV1Consent.Builder().build() it.gppSid = gppSid } @@ -479,7 +479,7 @@ class GppCookieSyncSpec extends BaseSpec { def "PBS shouldn't emit error message when request doesn't contain matched gpp config and specific global skip gpp config for adapter"() { given: "Default CookieSyncRequest with gpp and gppSid" - def gpp = new UsV1Consent.Builder().build() + def gpp = new UsNatV1Consent.Builder().build() def gppSid = "${PBSUtils.getRandomEnum(GppSectionId.class, [FIRST_GPP_SECTION, SECOND_GPP_SECTION]).value}" def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { it.gppSid = TCF_EU_V2.intValue diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppFetchBidActivitiesSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppFetchBidActivitiesSpec.groovy index 4f45bc9e512..8b9f0f5e4ad 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppFetchBidActivitiesSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppFetchBidActivitiesSpec.groovy @@ -8,6 +8,15 @@ import org.prebid.server.functional.model.config.InequalityValueRule import org.prebid.server.functional.model.config.LogicalRestrictedRule import org.prebid.server.functional.model.db.Account import org.prebid.server.functional.model.db.StoredRequest +import org.prebid.server.functional.model.privacy.gpp.GppDataActivity +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsColoradoV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsConnecticutV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV2ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV2SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsVirginiaV1ChildSensitiveData import org.prebid.server.functional.model.request.amp.AmpRequest import org.prebid.server.functional.model.request.auction.Activity import org.prebid.server.functional.model.request.auction.ActivityRule @@ -19,14 +28,15 @@ import org.prebid.server.functional.model.request.auction.Geo import org.prebid.server.functional.model.request.auction.RegsExt import org.prebid.server.functional.service.PrebidServerException import org.prebid.server.functional.util.PBSUtils -import org.prebid.server.functional.util.privacy.gpp.UsCaV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCoV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsNatV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsUtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsVaV1Consent -import org.prebid.server.functional.util.privacy.gpp.data.UsCaliforniaSensitiveData -import org.prebid.server.functional.util.privacy.gpp.data.UsUtahSensitiveData +import org.prebid.server.functional.util.privacy.gpp.v1.UsCaV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCoV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsNatV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsUtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsVaV1Consent +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1SensitiveData +import org.prebid.server.functional.util.privacy.gpp.v2.UsNatV2Consent import java.time.Instant @@ -661,6 +671,91 @@ class GppFetchBidActivitiesSpec extends PrivacyBaseSpec { new UsCtV1Consent.Builder().build() | US_CT_V1 } + def "PBS auction call when request have disallow logic US nat v2 validation should call bid adapter"() { + given: "Default Generic BidRequests with gppConsent and account id" + def accountId = PBSUtils.randomNumber as String + def bidRequest = BidRequest.defaultBidRequest.tap { + it.setAccountId(accountId) + regs.gppSid = [US_NAT_V1.intValue] + regs.gpp = gppConsent + } + + and: "Activities set for fetchBid with rejecting privacy regulation" + def rule = new ActivityRule().tap { + it.privacyRegulation = [IAB_US_GENERAL] + } + + def activities = AllowActivities.getDefaultAllowActivities(FETCH_BIDS, Activity.getDefaultActivity([rule])) + + and: "Account gpp configuration" + def accountGppConfig = new AccountGppConfig(code: IAB_US_GENERAL, enabled: true) + + and: "Existed account with privacy regulation setup" + def account = getAccountWithAllowActivitiesAndPrivacyModule(accountId, activities, [accountGppConfig]) + accountDao.save(account) + + when: "PBS processes auction requests" + activityPbsService.sendAuctionRequest(bidRequest) + + then: "Generic bidder should be called" + assert bidder.getBidderRequest(bidRequest.id) + + where: + gppConsent << [ + new UsNatV2Consent.Builder().setSensitiveDataProcessing( + new UsNationalV2SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT, + consumerHealthData: GppDataActivity.CONSENT, + crimeVictim: GppDataActivity.CONSENT, + nationalOrigin: GppDataActivity.CONSENT, + transgenderStatus: GppDataActivity.CONSENT + )), + new UsNatV2Consent.Builder().setSensitiveDataProcessing( + new UsNationalV2SensitiveData( + racialEthnicOrigin: GppDataActivity.NO_CONSENT, + religiousBeliefs: GppDataActivity.NO_CONSENT, + healthInfo: GppDataActivity.NO_CONSENT, + orientation: GppDataActivity.NO_CONSENT, + citizenshipStatus: GppDataActivity.NO_CONSENT, + unionMembership: GppDataActivity.NO_CONSENT, + consumerHealthData: GppDataActivity.NO_CONSENT, + nationalOrigin: GppDataActivity.NO_CONSENT + )), + new UsNatV2Consent.Builder().setSensitiveDataProcessing( + new UsNationalV2SensitiveData( + geneticId: GppDataActivity.NO_CONSENT, + biometricId: GppDataActivity.NO_CONSENT, + idNumbers: GppDataActivity.NO_CONSENT, + accountInfo: GppDataActivity.NO_CONSENT, + communicationContents: GppDataActivity.NO_CONSENT, + crimeVictim: GppDataActivity.NO_CONSENT, + transgenderStatus: GppDataActivity.NO_CONSENT + )), + new UsNatV2Consent.Builder().setSensitiveDataProcessing( + new UsNationalV2SensitiveData( + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT, + crimeVictim: GppDataActivity.CONSENT, + transgenderStatus: GppDataActivity.CONSENT + )), + new UsNatV2Consent.Builder().setKnownChildSensitiveDataConsents( + new UsNationalV2ChildSensitiveData(childFrom16to17: GppDataActivity.NO_CONSENT)) + ] + } + def "PBS auction call when privacy regulation have duplicate should process request and update alerts metrics"() { given: "Default basic generic BidRequest" def accountId = PBSUtils.randomNumber as String @@ -814,14 +909,14 @@ class GppFetchBidActivitiesSpec extends PrivacyBaseSpec { assert bidder.getBidderRequests(bidRequest.id).size() == 0 where: - gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + gppConsent | valueRules + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS auction call when custom privacy regulation empty and normalize is disabled should process request and emit error log"() { @@ -911,74 +1006,51 @@ class GppFetchBidActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS amp call when bidder allowed in activities should process bid request and proper metrics and update processed metrics"() { @@ -1377,13 +1449,13 @@ class GppFetchBidActivitiesSpec extends PrivacyBaseSpec { assert bidder.getBidderRequest(ampStoredRequest.id) where: - gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + gppConsent | gppSid + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } def "PBS amp call when privacy regulation have duplicate should process request and update alerts metrics"() { @@ -1565,14 +1637,14 @@ class GppFetchBidActivitiesSpec extends PrivacyBaseSpec { assert !bidder.getBidderRequests(ampStoredRequest.id).size() where: - gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + gppConsent | valueRules + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS amp call when custom privacy regulation empty and normalize is disabled should process request and emit error log"() { @@ -1684,73 +1756,50 @@ class GppFetchBidActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } } diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppSetUidSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppSetUidSpec.groovy index 47a04509805..d49565222d2 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppSetUidSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppSetUidSpec.groovy @@ -5,8 +5,8 @@ import org.prebid.server.functional.model.request.GppSectionId import org.prebid.server.functional.model.request.setuid.SetuidRequest import org.prebid.server.functional.service.PrebidServerException import org.prebid.server.functional.util.PBSUtils -import org.prebid.server.functional.util.privacy.gpp.TcfEuV2Consent -import org.prebid.server.functional.util.privacy.gpp.UsV1Consent +import org.prebid.server.functional.util.privacy.gpp.v2.TcfEuV2Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UspV1Consent import static org.prebid.server.functional.model.bidder.BidderName.GENERIC import static org.prebid.server.functional.model.request.GppSectionId.US_NAT_V1 @@ -68,7 +68,7 @@ class GppSetUidSpec extends PrivacyBaseSpec { assert response.uidsCookie.tempUIDs[GENERIC] where: - gpp << [new UsV1Consent.Builder().build().encodeSection(), + gpp << [new UspV1Consent.Builder().build().encodeSection(), new TcfEuV2Consent.Builder().build().encodeSection()] } 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 2303bfc9e5f..3392bcf1bfd 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 @@ -12,6 +12,17 @@ import org.prebid.server.functional.model.config.GppModuleConfig import org.prebid.server.functional.model.config.InequalityValueRule import org.prebid.server.functional.model.config.LogicalRestrictedRule import org.prebid.server.functional.model.db.Account +import org.prebid.server.functional.model.privacy.gpp.GppDataActivity +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsColoradoV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsConnecticutV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV2ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsVirginiaV1ChildSensitiveData import org.prebid.server.functional.model.request.auction.Activity import org.prebid.server.functional.model.request.auction.ActivityRule import org.prebid.server.functional.model.request.auction.AllowActivities @@ -20,14 +31,15 @@ import org.prebid.server.functional.model.request.cookiesync.CookieSyncRequest import org.prebid.server.functional.model.request.setuid.SetuidRequest import org.prebid.server.functional.service.PrebidServerException import org.prebid.server.functional.util.PBSUtils -import org.prebid.server.functional.util.privacy.gpp.UsCaV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCoV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsNatV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsUtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsVaV1Consent -import org.prebid.server.functional.util.privacy.gpp.data.UsCaliforniaSensitiveData -import org.prebid.server.functional.util.privacy.gpp.data.UsUtahSensitiveData +import org.prebid.server.functional.util.privacy.gpp.v1.UsCaV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCoV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsNatV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsUtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsVaV1Consent +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1SensitiveData +import org.prebid.server.functional.util.privacy.gpp.v2.UsNatV2Consent import java.time.Instant @@ -371,7 +383,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { privacyAllowRegulations << [IAB_US_GENERAL, IAB_ALL, ALL] } - def "PBS cookie sync call when privacy module contain some part of disallow logic should exclude bidders URLs"() { + def "PBS cookie sync call should exclude bidder URLs when privacy module contains disallowed GPP rules"() { given: "Cookie sync request with link to account" def accountId = PBSUtils.randomString def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { @@ -403,47 +415,67 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: disallowGppLogic << [ SIMPLE_GPC_DISALLOW_LOGIC, - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build(), - new UsNatV1Consent.Builder().setSaleOptOut(1).setSaleOptOutNotice(1).setMspaServiceProviderMode(2).setMspaOptOutOptionMode(1).build(), - new UsNatV1Consent.Builder().setSaleOptOutNotice(2).setSaleOptOut(1).setMspaServiceProviderMode(2).setMspaOptOutOptionMode(1).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 1).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(1, 0).build(), - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build(), new UsNatV1Consent.Builder() - .setSharingNotice(2) - .setSharingOptOutNotice(1) - .setSharingOptOut(1) - .setMspaServiceProviderMode(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setMspaServiceProviderMode(MspaMode.YES) + .setMspaOptOutOptionMode(MspaMode.NO) .build(), new UsNatV1Consent.Builder() - .setSharingOptOutNotice(2) - .setSharingOptOut(1) - .setSharingNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOutNotice(2) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOut(1) - .setTargetedAdvertisingOptOutNotice(1) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NOT_APPLICABLE, GppDataActivity.NO_CONSENT)) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE)) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NO_CONSENT, GppDataActivity.NOT_APPLICABLE)) + .build(), + new UsNatV1Consent.Builder() + .setPersonalDataConsents(GppDataActivity.CONSENT) + .build(), + new UsNatV1Consent.Builder() + .setSharingNotice(Notice.NOT_PROVIDED) + .setSharingOptOutNotice(Notice.PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) + .build(), + new UsNatV1Consent.Builder() + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setSharingNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) + .build(), + new UsNatV1Consent.Builder() + .setTargetedAdvertisingOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) + .build(), + new UsNatV1Consent.Builder() + .setTargetedAdvertisingOptOut(OptOut.OPTED_OUT) + .setTargetedAdvertisingOptOutNotice(Notice.PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build() ] } - def "PBS cookie sync call when privacy module contain some part of disallow logic which violates GPP validation should exclude bidders URLs"() { + def "PBS cookie sync call should exclude bidders URLs when privacy module contain opt out of disallow GPP logic"() { given: "Cookie sync request with link to account" def accountId = PBSUtils.randomString def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { @@ -474,14 +506,58 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: disallowGppLogic << [ - 'DBABLA~BAAgAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA', - 'DBABLA~BAACAAAAAAA.QA' + new UsNatV2Consent.Builder() + .setSaleOptOut(OptOut.DID_NOT_OPT_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) + .build(), + new UsNatV2Consent.Builder() + .setTargetedAdvertisingOptOut(OptOut.DID_NOT_OPT_OUT) + .build() + ] + } + + def "PBS cookie sync call should exclude bidders URLs when privacy module contain disallow child sensitive data logic US nat v2 validation"() { + given: "Cookie sync request with link to account" + def accountId = PBSUtils.randomString + def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { + it.gppSid = US_NAT_V1.value + it.account = accountId + it.gpp = new UsNatV2Consent.Builder() + .setKnownChildSensitiveDataConsents(usNationalV2ChildSensitiveData) + .build() + } + + and: "Activities set for cookie sync with allowing privacy regulation" + def rule = new ActivityRule().tap { + it.privacyRegulation = [IAB_US_GENERAL] + } + + def activities = AllowActivities.getDefaultAllowActivities(SYNC_USER, Activity.getDefaultActivity([rule])) + + and: "Account gpp configuration" + def accountGppConfig = new AccountGppConfig(code: IAB_US_GENERAL, enabled: true) + + and: "Existed account with cookie sync and privacy regulation setup" + def account = getAccountWithAllowActivitiesAndPrivacyModule(accountId, activities, [accountGppConfig]) + accountDao.save(account) + + when: "PBS processes cookie sync request" + def response = activityPbsService.sendCookieSyncRequest(cookieSyncRequest) + + then: "Response should not contain any URLs for bidders" + assert !response.bidderStatus.userSync.url + + where: + usNationalV2ChildSensitiveData << [ + new UsNationalV2ChildSensitiveData(childUnder13: GppDataActivity.NO_CONSENT), + new UsNationalV2ChildSensitiveData(childFrom13to16: GppDataActivity.NO_CONSENT), + new UsNationalV2ChildSensitiveData(childFrom16to17: GppDataActivity.NO_CONSENT) ] } - def "PBS cookie sync call when privacy module contain invalid GPP segment should respond with required bidder URL and emit error log"() { + def "PBS cookie sync call should respond with required bidder URL and emit error log when privacy module contain invalid GPP segment"() { given: "Test start time" def startTime = Instant.now() @@ -602,12 +678,12 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } def "PBS cookie sync call when privacy modules contain allowing settings should include proper responded with bidders URLs"() { @@ -833,14 +909,14 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { assert !response.bidderStatus.userSync.url where: - gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + gppConsent | valueRules + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS cookie sync call when custom privacy regulation empty and normalize is disabled should respond with an error and update metric"() { @@ -929,74 +1005,51 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS setuid request when bidder allowed in activities should respond with valid bidders UIDs cookies and update processed metrics"() { @@ -1311,7 +1364,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { privacyAllowRegulations << [IAB_US_GENERAL, IAB_ALL, ALL] } - def "PBS setuid request when privacy module contain some part of disallow logic should reject bidders with status code invalidStatusCode"() { + def "PBS setuid request should reject bidders with status code invalidStatusCode when privacy module contains disallowed GPP rules"() { given: "Cookie sync SetuidRequest with accountId" def accountId = PBSUtils.randomString def setuidRequest = SetuidRequest.defaultSetuidRequest.tap { @@ -1348,47 +1401,67 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: disallowGppLogic << [ SIMPLE_GPC_DISALLOW_LOGIC, - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build(), - new UsNatV1Consent.Builder().setSaleOptOut(1).setSaleOptOutNotice(1).setMspaServiceProviderMode(2).setMspaOptOutOptionMode(1).build(), - new UsNatV1Consent.Builder().setSaleOptOutNotice(2).setSaleOptOut(1).setMspaServiceProviderMode(2).setMspaOptOutOptionMode(1).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 1).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(1, 0).build(), - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build(), new UsNatV1Consent.Builder() - .setSharingNotice(2) - .setSharingOptOutNotice(1) - .setSharingOptOut(1) - .setMspaServiceProviderMode(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setMspaServiceProviderMode(MspaMode.YES) + .setMspaOptOutOptionMode(MspaMode.NO) .build(), new UsNatV1Consent.Builder() - .setSharingOptOutNotice(2) - .setSharingOptOut(1) - .setSharingNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOutNotice(2) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOut(1) - .setTargetedAdvertisingOptOutNotice(1) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NOT_APPLICABLE, GppDataActivity.NO_CONSENT)) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE)) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NO_CONSENT, GppDataActivity.NOT_APPLICABLE)) + .build(), + new UsNatV1Consent.Builder() + .setPersonalDataConsents(GppDataActivity.CONSENT) + .build(), + new UsNatV1Consent.Builder() + .setSharingNotice(Notice.NOT_PROVIDED) + .setSharingOptOutNotice(Notice.PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) + .build(), + new UsNatV1Consent.Builder() + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setSharingNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) + .build(), + new UsNatV1Consent.Builder() + .setTargetedAdvertisingOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) + .build(), + new UsNatV1Consent.Builder() + .setTargetedAdvertisingOptOut(OptOut.OPTED_OUT) + .setTargetedAdvertisingOptOutNotice(Notice.PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build() ] } - def "PBS setuid request when privacy module contain some part of disallow logic which violates GPP validation should reject bidders with status code invalidStatusCode"() { + def "PBS setuid request should reject bidders with status code invalidStatusCode when privacy module contain opt out of disallow GPP UsNat v2 logic"() { given: "Cookie sync SetuidRequest with accountId" def accountId = PBSUtils.randomString def setuidRequest = SetuidRequest.defaultSetuidRequest.tap { @@ -1424,10 +1497,15 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: disallowGppLogic << [ - 'DBABLA~BAAgAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA', - 'DBABLA~BAACAAAAAAA.QA' + new UsNatV2Consent.Builder() + .setSaleOptOut(OptOut.DID_NOT_OPT_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) + .build(), + new UsNatV2Consent.Builder() + .setTargetedAdvertisingOptOut(OptOut.DID_NOT_OPT_OUT) + .build() ] } @@ -1558,12 +1636,12 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } def "PBS setuid request when privacy modules contain allowing settings should respond with valid bidders UIDs cookies"() { @@ -1809,13 +1887,13 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS setuid call when custom privacy regulation empty and normalize is disabled should respond with required UIDs cookies"() { @@ -1912,74 +1990,51 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS cookie sync should process rule when geo doesn't intersection"() { @@ -2268,7 +2323,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { it.gppSid = US_NAT_V1.value it.account = accountId - it.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + it.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for cookie sync with allowing privacy regulation" @@ -2301,7 +2356,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { it.gppSid = US_NAT_V1.value it.account = accountId - it.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + it.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for cookie sync with allowing privacy regulation" @@ -2353,7 +2408,7 @@ class GppSyncUserActivitiesSpec extends PrivacyBaseSpec { def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { it.gppSid = US_NAT_V1.value it.account = accountId - it.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + it.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for cookie sync with allowing privacy regulation" diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitEidsActivitiesSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitEidsActivitiesSpec.groovy index 41e1079986d..4579ea1f7b6 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitEidsActivitiesSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitEidsActivitiesSpec.groovy @@ -7,6 +7,16 @@ import org.prebid.server.functional.model.config.GppModuleConfig import org.prebid.server.functional.model.config.InequalityValueRule import org.prebid.server.functional.model.config.LogicalRestrictedRule import org.prebid.server.functional.model.db.StoredRequest +import org.prebid.server.functional.model.privacy.gpp.GppDataActivity +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsColoradoV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsConnecticutV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsVirginiaV1ChildSensitiveData import org.prebid.server.functional.model.request.amp.AmpRequest import org.prebid.server.functional.model.request.auction.Activity import org.prebid.server.functional.model.request.auction.ActivityRule @@ -17,15 +27,16 @@ import org.prebid.server.functional.model.request.auction.Geo import org.prebid.server.functional.model.request.auction.RegsExt import org.prebid.server.functional.service.PrebidServerException import org.prebid.server.functional.util.PBSUtils -import org.prebid.server.functional.util.privacy.gpp.UsCaV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCoV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsNatV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsUtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsVaV1Consent -import org.prebid.server.functional.util.privacy.gpp.data.UsCaliforniaSensitiveData -import org.prebid.server.functional.util.privacy.gpp.data.UsNationalSensitiveData -import org.prebid.server.functional.util.privacy.gpp.data.UsUtahSensitiveData +import org.prebid.server.functional.util.privacy.gpp.v1.UsCaV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCoV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsNatV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsUtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsVaV1Consent +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1SensitiveData +import org.prebid.server.functional.util.privacy.gpp.v2.UsNatV2Consent import java.time.Instant @@ -644,7 +655,7 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { privacyAllowRegulations << [IAB_US_GENERAL, IAB_ALL, ALL] } - def "PBS auction call when privacy module contain some part of disallow logic should remove EIDS fields in request"() { + def "PBS auction call should remove EIDS fields in request when privacy module contains disallowed GPP rules"() { given: "Default Generic BidRequests with EIDS fields and account id" def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { @@ -680,127 +691,126 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { disallowGppLogic << [ SIMPLE_GPC_DISALLOW_LOGIC, new UsNatV1Consent.Builder() - .setMspaServiceProviderMode(1) - .setMspaOptOutOptionMode(2) + .setMspaServiceProviderMode(MspaMode.YES) + .setMspaOptOutOptionMode(MspaMode.NO) .build(), new UsNatV1Consent.Builder() - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSaleOptOutNotice(2) - .setSaleOptOut(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSharingNotice(2) - .setSharingOptOutNotice(1) - .setSharingOptOut(1) - .setMspaServiceProviderMode(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSharingNotice(Notice.NOT_PROVIDED) + .setSharingOptOutNotice(Notice.PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSharingOptOutNotice(2) - .setSharingOptOut(1) - .setSharingNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setSharingNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOutNotice(2) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setTargetedAdvertisingOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOut(1) - .setTargetedAdvertisingOptOutNotice(1) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setTargetedAdvertisingOptOut(OptOut.OPTED_OUT) + .setTargetedAdvertisingOptOutNotice(Notice.PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(2) + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_PROVIDED) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(2) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSensitiveDataLimitUseNotice(Notice.NOT_PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 1) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NOT_APPLICABLE, GppDataActivity.NO_CONSENT)) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 2) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE)) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(1, 0) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NO_CONSENT, GppDataActivity.NOT_APPLICABLE)) .build(), new UsNatV1Consent.Builder() - .setPersonalDataConsents(2) + .setPersonalDataConsents(GppDataActivity.CONSENT) .build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 1, - religiousBeliefs: 1, - healthInfo: 1, - orientation: 1, - citizenshipStatus: 1, - unionMembership: 1, + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.NO_CONSENT, + religiousBeliefs: GppDataActivity.NO_CONSENT, + healthInfo: GppDataActivity.NO_CONSENT, + orientation: GppDataActivity.NO_CONSENT, + citizenshipStatus: GppDataActivity.NO_CONSENT, + unionMembership: GppDataActivity.NO_CONSENT, )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 2, - religiousBeliefs: 2, - healthInfo: 2, - orientation: 2, - citizenshipStatus: 2, - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - unionMembership: 2, - communicationContents: 2 + .setSensitiveDataLimitUseNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 2, - religiousBeliefs: 2, - healthInfo: 2, - orientation: 2, - citizenshipStatus: 2, - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - unionMembership: 2, - communicationContents: 2 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - geneticId: 1, - biometricId: 1, - idNumbers: 1, - accountInfo: 1, - communicationContents: 1 + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geneticId: GppDataActivity.NO_CONSENT, + biometricId: GppDataActivity.NO_CONSENT, + idNumbers: GppDataActivity.NO_CONSENT, + accountInfo: GppDataActivity.NO_CONSENT, + communicationContents: GppDataActivity.NO_CONSENT )).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - communicationContents: 2 + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build() ] } - def "PBS auction call when privacy module contain some part of disallow logic which violates GPP validation should remove EIDS fields in request"() { + def "PBS auction call should remove EIDS fields in request when privacy module contain opt out of disallow GPP UsNat v2 logic"() { given: "Default Generic BidRequests with EIDS fields and account id" def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { @@ -833,15 +843,22 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { } where: disallowGppLogic << [ - 'DBABLA~BAAgAAAAAAA.QA', - 'DBABLA~BCAAAAAAAAA.QA', - 'DBABLA~BAAEAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA' + new UsNatV2Consent.Builder() + .setSaleOptOut(OptOut.DID_NOT_OPT_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.OPTED_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) + .build() ] } - def "PBS auction call when privacy module contain invalid GPP segment shouldn't remove EIDS fields in request and emit error log"() { + def "PBS auction call shouldn't remove EIDS fields in request and emit error log when privacy module contain invalid GPP segment"() { given: "Test start time" def startTime = Instant.now() @@ -973,12 +990,12 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { where: gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } def "PBS auction call when privacy modules contain allowing settings should leave EIDS fields in request"() { @@ -1209,13 +1226,13 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { where: gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS auction call when custom privacy regulation empty and normalize is disabled should leave EIDS fields in request and emit error log"() { @@ -1315,74 +1332,51 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS amp call when transmit EIDS activities is allowing request should leave EIDS fields field in active request and update proper metrics"() { @@ -1741,7 +1735,7 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { privacyAllowRegulations << [IAB_US_GENERAL, IAB_ALL, ALL] } - def "PBS amp call when privacy module contain some part of disallow logic should remove EIDS fields in request"() { + def "PBS amp call should remove EIDS fields in request when privacy module contains disallowed GPP rules"() { given: "Default Generic BidRequest with EIDS fields field and account id" def accountId = PBSUtils.randomNumber as String def ampStoredRequest = getBidRequestWithPersonalData(accountId) @@ -1786,127 +1780,126 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { disallowGppLogic << [ SIMPLE_GPC_DISALLOW_LOGIC, new UsNatV1Consent.Builder() - .setMspaServiceProviderMode(1) - .setMspaOptOutOptionMode(2) + .setMspaServiceProviderMode(MspaMode.YES) + .setMspaOptOutOptionMode(MspaMode.NO) .build(), new UsNatV1Consent.Builder() - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSaleOptOutNotice(2) - .setSaleOptOut(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSharingNotice(2) - .setSharingOptOutNotice(1) - .setSharingOptOut(1) - .setMspaServiceProviderMode(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSharingNotice(Notice.NOT_PROVIDED) + .setSharingOptOutNotice(Notice.PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSharingOptOutNotice(2) - .setSharingOptOut(1) - .setSharingNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setSharingNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOutNotice(2) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setTargetedAdvertisingOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOut(1) - .setTargetedAdvertisingOptOutNotice(1) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setTargetedAdvertisingOptOut(OptOut.OPTED_OUT) + .setTargetedAdvertisingOptOutNotice(Notice.PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(2) + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_PROVIDED) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(2) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSensitiveDataLimitUseNotice(Notice.NOT_PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 1) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NOT_APPLICABLE, GppDataActivity.NO_CONSENT)) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 2) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE)) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(1, 0) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NO_CONSENT, GppDataActivity.NOT_APPLICABLE)) .build(), new UsNatV1Consent.Builder() - .setPersonalDataConsents(2) + .setPersonalDataConsents(GppDataActivity.CONSENT) .build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 1, - religiousBeliefs: 1, - healthInfo: 1, - orientation: 1, - citizenshipStatus: 1, - unionMembership: 1, + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.NO_CONSENT, + religiousBeliefs: GppDataActivity.NO_CONSENT, + healthInfo: GppDataActivity.NO_CONSENT, + orientation: GppDataActivity.NO_CONSENT, + citizenshipStatus: GppDataActivity.NO_CONSENT, + unionMembership: GppDataActivity.NO_CONSENT, )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 2, - religiousBeliefs: 2, - healthInfo: 2, - orientation: 2, - citizenshipStatus: 2, - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - unionMembership: 2, - communicationContents: 2 + .setSensitiveDataLimitUseNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 2, - religiousBeliefs: 2, - healthInfo: 2, - orientation: 2, - citizenshipStatus: 2, - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - unionMembership: 2, - communicationContents: 2 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - geneticId: 1, - biometricId: 1, - idNumbers: 1, - accountInfo: 1, - communicationContents: 1 + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geneticId: GppDataActivity.NO_CONSENT, + biometricId: GppDataActivity.NO_CONSENT, + idNumbers: GppDataActivity.NO_CONSENT, + accountInfo: GppDataActivity.NO_CONSENT, + communicationContents: GppDataActivity.NO_CONSENT )).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - communicationContents: 2 + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build() ] } - def "PBS amp call when privacy module contain some part of disallow logic which violates GPP validation should remove EIDS fields in request"() { + def "PBS amp call should remove EIDS fields in request when privacy module contain opt out of disallow GPP UsNat v2 logic"() { given: "Default Generic BidRequest with EIDS fields field and account id" def accountId = PBSUtils.randomNumber as String def ampStoredRequest = getBidRequestWithPersonalData(accountId) @@ -1948,11 +1941,18 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { } where: disallowGppLogic << [ - 'DBABLA~BAAgAAAAAAA.QA', - 'DBABLA~BCAAAAAAAAA.QA', - 'DBABLA~BAAEAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA' + new UsNatV2Consent.Builder() + .setSaleOptOut(OptOut.DID_NOT_OPT_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.OPTED_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) + .build() ] } @@ -2113,12 +2113,12 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { where: gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } def "PBS amp call when privacy modules contain allowing settings should leave EIDS fields in request"() { @@ -2451,13 +2451,13 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { where: gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS amp call when custom privacy regulation empty and normalize is disabled should leave EIDS fields in request and emit error log"() { @@ -2576,74 +2576,51 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS should remove EIDS fields in request when privacy regulation match and personalDataConsents is 2"() { @@ -2651,7 +2628,7 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitEIDS with rejecting privacy regulation" @@ -2682,7 +2659,7 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitEIDS with rejecting privacy regulation" @@ -2731,7 +2708,7 @@ class GppTransmitEidsActivitiesSpec extends PrivacyBaseSpec { def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitEIDS with rejecting privacy regulation" diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitPreciseGeoActivitiesSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitPreciseGeoActivitiesSpec.groovy index 5532caaf523..9fd6b76e054 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitPreciseGeoActivitiesSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitPreciseGeoActivitiesSpec.groovy @@ -7,6 +7,16 @@ import org.prebid.server.functional.model.config.GppModuleConfig import org.prebid.server.functional.model.config.InequalityValueRule import org.prebid.server.functional.model.config.LogicalRestrictedRule import org.prebid.server.functional.model.db.StoredRequest +import org.prebid.server.functional.model.privacy.gpp.GppDataActivity +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsColoradoV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsConnecticutV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV2ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsVirginiaV1ChildSensitiveData import org.prebid.server.functional.model.request.amp.AmpRequest import org.prebid.server.functional.model.request.auction.Activity import org.prebid.server.functional.model.request.auction.ActivityRule @@ -16,15 +26,16 @@ import org.prebid.server.functional.model.request.auction.Geo import org.prebid.server.functional.model.request.auction.RegsExt import org.prebid.server.functional.service.PrebidServerException import org.prebid.server.functional.util.PBSUtils -import org.prebid.server.functional.util.privacy.gpp.UsCaV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCoV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsNatV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsUtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsVaV1Consent -import org.prebid.server.functional.util.privacy.gpp.data.UsCaliforniaSensitiveData -import org.prebid.server.functional.util.privacy.gpp.data.UsNationalSensitiveData -import org.prebid.server.functional.util.privacy.gpp.data.UsUtahSensitiveData +import org.prebid.server.functional.util.privacy.gpp.v1.UsCaV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCoV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsNatV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsUtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsVaV1Consent +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1SensitiveData +import org.prebid.server.functional.util.privacy.gpp.v2.UsNatV2Consent import java.time.Instant @@ -1038,7 +1049,7 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { privacyAllowRegulations << [IAB_US_GENERAL, IAB_ALL, ALL] } - def "PBS auction call when privacy module contain some part of disallow logic should round lat/lon data to 2 digits"() { + def "PBS auction call should round lat/lon data to 2 digits when privacy module contains disallowed GPP rules"() { given: "Default Generic BidRequests with gppConsent and account id" def accountId = PBSUtils.randomNumber as String def bidRequest = bidRequestWithGeo.tap { @@ -1096,36 +1107,114 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { where: disallowGppLogic << [ SIMPLE_GPC_DISALLOW_LOGIC, - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessingOptOutNotice(2).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 1).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(1, 0).build(), - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(2) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setMspaServiceProviderMode(MspaMode.YES) + .setMspaOptOutOptionMode(MspaMode.NO) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - geolocation: 2 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_PROVIDED) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NOT_APPLICABLE, GppDataActivity.NO_CONSENT)) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE)) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NO_CONSENT, GppDataActivity.NOT_APPLICABLE)) + .build(), + new UsNatV1Consent.Builder() + .setPersonalDataConsents(GppDataActivity.CONSENT) + .build(), + new UsNatV1Consent.Builder() + .setSensitiveDataLimitUseNotice(Notice.NOT_PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) + .build(), + new UsNatV1Consent.Builder() + .setSensitiveDataLimitUseNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geolocation: GppDataActivity.CONSENT )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - geolocation: 2 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geolocation: GppDataActivity.CONSENT )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - geolocation: 1 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geolocation: GppDataActivity.NO_CONSENT )).build() ] } - def "PBS auction call when request have different gpp consent but match and rejecting should round lat/lon data to 2 digits"() { + def "PBS auction call should round lat/lon data to 2 digits when privacy module contain disallow child sensitive data logic US nat v2 validation"() { + given: "Default Generic BidRequests with gppConsent and account id" + def accountId = PBSUtils.randomNumber as String + def bidRequest = bidRequestWithGeo.tap { + it.setAccountId(accountId) + regs.gppSid = [US_NAT_V1.intValue] + regs.gpp = new UsNatV2Consent.Builder() + .setKnownChildSensitiveDataConsents(usNationalV2ChildSensitiveData) + .build() + } + + and: "Activities set for transmitPreciseGeo with rejecting privacy regulation" + def rule = new ActivityRule().tap { + it.privacyRegulation = [IAB_US_GENERAL] + } + + def activities = AllowActivities.getDefaultAllowActivities(TRANSMIT_PRECISE_GEO, Activity.getDefaultActivity([rule])) + + and: "Account gpp configuration" + def accountGppConfig = new AccountGppConfig(code: IAB_US_GENERAL, enabled: true) + + and: "Existed account with privacy regulation setup" + def account = getAccountWithAllowActivitiesAndPrivacyModule(accountId, activities, [accountGppConfig]) + accountDao.save(account) + + when: "PBS processes auction requests" + activityPbsService.sendAuctionRequest(bidRequest) + + then: "Bidder request should contain rounded geo data for device and user to 2 digits" + def bidderRequests = bidder.getBidderRequest(bidRequest.id) + verifyAll { + bidderRequests.device.ip == "43.77.114.0" + bidderRequests.device.ipv6 == "af47:892b:3e98:b400::" + bidderRequests.device.geo.lat == bidRequest.device.geo.lat.round(2) + bidderRequests.device.geo.lon == bidRequest.device.geo.lon.round(2) + + bidderRequests.device.geo.country == bidRequest.device.geo.country + bidderRequests.device.geo.region == bidRequest.device.geo.region + bidderRequests.device.geo.utcoffset == bidRequest.device.geo.utcoffset + } + + and: "Bidder request should mask several geo fields" + verifyAll { + !bidderRequests.device.geo.metro + !bidderRequests.device.geo.city + !bidderRequests.device.geo.zip + !bidderRequests.device.geo.accuracy + !bidderRequests.device.geo.ipservice + !bidderRequests.device.geo.ext + } + + and: "Bidder request shouldn't mask geo.{lat,lon} fields" + verifyAll { + bidderRequests.user.geo.lat == bidRequest.user.geo.lat + bidderRequests.user.geo.lon == bidRequest.user.geo.lon + } + + where: + usNationalV2ChildSensitiveData << [ + new UsNationalV2ChildSensitiveData(childUnder13: GppDataActivity.NO_CONSENT), + new UsNationalV2ChildSensitiveData(childFrom13to16: GppDataActivity.NO_CONSENT), + new UsNationalV2ChildSensitiveData(childFrom16to17: GppDataActivity.NO_CONSENT) + ] + } + + def "PBS auction call should round lat/lon data to 2 digits when disallow gpp string match with #gppSid sid"() { given: "Default Generic BidRequests with gppConsent and account id" def accountId = PBSUtils.randomNumber as String def bidRequest = bidRequestWithGeo.tap { @@ -1181,16 +1270,16 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { } where: - gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + gppConsent | gppSid + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } - def "PBS auction call when privacy modules contain allowing settings should not round lat/lon data"() { + def "PBS auction call should not round lat/lon data when privacy modules contain allowing GPP settings"() { given: "Default basic generic BidRequest" def accountId = PBSUtils.randomNumber as String def bidRequest = bidRequestWithGeo.tap { @@ -1517,14 +1606,14 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { } where: - gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + gppConsent | valueRules + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS auction call when custom privacy regulation empty and normalize is disabled should not round lat/lon data and emit error log"() { @@ -1668,74 +1757,51 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS amp call with bidder allowed in activities should not round lat/lon data and update processed metrics"() { @@ -2282,7 +2348,7 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { privacyAllowRegulations << [IAB_US_GENERAL, IAB_ALL, ALL] } - def "PBS amp call when privacy module contain some part of disallow logic should round lat/lon data to 2 digits"() { + def "PBS amp call should round lat/lon data to 2 digits when privacy module contains disallowed GPP rules"() { given: "Default Generic BidRequest" def accountId = PBSUtils.randomNumber as String def ampStoredRequest = bidRequestWithGeo @@ -2348,36 +2414,49 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { where: disallowGppLogic << [ SIMPLE_GPC_DISALLOW_LOGIC, - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessingOptOutNotice(2).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 1).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2).build(), - new UsNatV1Consent.Builder().setKnownChildSensitiveDataConsents(1, 0).build(), - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(2) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setMspaServiceProviderMode(MspaMode.YES) + .setMspaOptOutOptionMode(MspaMode.NO) + .build(), + new UsNatV1Consent.Builder() + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_PROVIDED) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NOT_APPLICABLE, GppDataActivity.NO_CONSENT)) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE)) + .build(), + new UsNatV1Consent.Builder() + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NO_CONSENT, GppDataActivity.NOT_APPLICABLE)) + .build(), + new UsNatV1Consent.Builder() + .setPersonalDataConsents(GppDataActivity.CONSENT) + .build(), + new UsNatV1Consent.Builder() + .setSensitiveDataLimitUseNotice(Notice.NOT_PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - geolocation: 2 + .setSensitiveDataLimitUseNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geolocation: GppDataActivity.CONSENT )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - geolocation: 2 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geolocation: GppDataActivity.CONSENT )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - geolocation: 1 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geolocation: GppDataActivity.NO_CONSENT )).build() ] } - def "PBS amp call when request have different gpp consent but match and rejecting should round lat/lon data to 2 digits"() { + def "PBS amp call should round lat/lon data to 2 digits when disallow gpp string match with #gppSid sid"() { given: "Default Generic BidRequest" def accountId = PBSUtils.randomNumber as String def ampStoredRequest = bidRequestWithGeo @@ -2441,16 +2520,16 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { } where: - gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + gppConsent | gppSid + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } - def "PBS amp call when privacy modules contain allowing settings should not round lat/lon data"() { + def "PBS amp call should not round lat/lon data when privacy modules contain allowing settings"() { given: "Default Generic BidRequest" def accountId = PBSUtils.randomNumber as String def ampStoredRequest = bidRequestWithGeo @@ -2827,13 +2906,13 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { where: gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS amp call when custom privacy regulation empty and normalize is disabled should not round lat/lon data and emit error log"() { @@ -2993,74 +3072,51 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS auction should round lat/lon data to 2 digits call when privacy regulation match and personalDataConsents is 2"() { @@ -3069,7 +3125,7 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { def bidRequest = bidRequestWithGeo.tap { it.setAccountId(accountId) regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitPreciseGeo with rejecting privacy regulation" @@ -3125,7 +3181,7 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { def bidRequest = bidRequestWithGeo.tap { it.setAccountId(accountId) regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitPreciseGeo with rejecting privacy regulation" @@ -3199,7 +3255,7 @@ class GppTransmitPreciseGeoActivitiesSpec extends PrivacyBaseSpec { def bidRequest = bidRequestWithGeo.tap { it.setAccountId(accountId) regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitPreciseGeo with rejecting privacy regulation" diff --git a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitUfpdActivitiesSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitUfpdActivitiesSpec.groovy index 25f18381131..3af8bfe4d77 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitUfpdActivitiesSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitUfpdActivitiesSpec.groovy @@ -11,6 +11,18 @@ import org.prebid.server.functional.model.config.Purpose import org.prebid.server.functional.model.config.PurposeConfig import org.prebid.server.functional.model.config.PurposeEid import org.prebid.server.functional.model.db.StoredRequest +import org.prebid.server.functional.model.privacy.gpp.GppDataActivity +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsColoradoV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsConnecticutV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV2ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV2SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsVirginiaV1ChildSensitiveData import org.prebid.server.functional.model.request.amp.AmpRequest import org.prebid.server.functional.model.request.auction.Activity import org.prebid.server.functional.model.request.auction.ActivityRule @@ -21,15 +33,16 @@ import org.prebid.server.functional.model.request.auction.Geo import org.prebid.server.functional.model.request.auction.RegsExt import org.prebid.server.functional.service.PrebidServerException import org.prebid.server.functional.util.PBSUtils -import org.prebid.server.functional.util.privacy.gpp.UsCaV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCoV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsCtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsNatV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsUtV1Consent -import org.prebid.server.functional.util.privacy.gpp.UsVaV1Consent -import org.prebid.server.functional.util.privacy.gpp.data.UsCaliforniaSensitiveData -import org.prebid.server.functional.util.privacy.gpp.data.UsNationalSensitiveData -import org.prebid.server.functional.util.privacy.gpp.data.UsUtahSensitiveData +import org.prebid.server.functional.util.privacy.gpp.v1.UsCaV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCoV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsCtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsNatV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsUtV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsVaV1Consent +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1SensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1SensitiveData +import org.prebid.server.functional.util.privacy.gpp.v2.UsNatV2Consent import java.time.Instant @@ -880,7 +893,7 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { privacyAllowRegulations << [IAB_US_GENERAL, IAB_ALL, ALL] } - def "PBS auction call when privacy module contain some part of disallow logic should remove UFPD fields in request"() { + def "PBS auction call should remove UFPD fields in request when privacy module contains disallowed GPP v1 rules"() { given: "Default Generic BidRequests with UFPD fields and account id" def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { @@ -931,127 +944,126 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { disallowGppLogic << [ SIMPLE_GPC_DISALLOW_LOGIC, new UsNatV1Consent.Builder() - .setMspaServiceProviderMode(1) - .setMspaOptOutOptionMode(2) + .setMspaServiceProviderMode(MspaMode.YES) + .setMspaOptOutOptionMode(MspaMode.NO) .build(), new UsNatV1Consent.Builder() - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSaleOptOutNotice(2) - .setSaleOptOut(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSharingNotice(2) - .setSharingOptOutNotice(1) - .setSharingOptOut(1) - .setMspaServiceProviderMode(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSharingNotice(Notice.NOT_PROVIDED) + .setSharingOptOutNotice(Notice.PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSharingOptOutNotice(2) - .setSharingOptOut(1) - .setSharingNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setSharingNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOutNotice(2) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setTargetedAdvertisingOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOut(1) - .setTargetedAdvertisingOptOutNotice(1) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setTargetedAdvertisingOptOut(OptOut.OPTED_OUT) + .setTargetedAdvertisingOptOutNotice(Notice.PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(2) + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_PROVIDED) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(2) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSensitiveDataLimitUseNotice(Notice.NOT_PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 1) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NOT_APPLICABLE, GppDataActivity.NO_CONSENT)) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 2) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE)) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(1, 0) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NO_CONSENT, GppDataActivity.NOT_APPLICABLE)) .build(), new UsNatV1Consent.Builder() - .setPersonalDataConsents(2) + .setPersonalDataConsents(GppDataActivity.CONSENT) .build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 1, - religiousBeliefs: 1, - healthInfo: 1, - orientation: 1, - citizenshipStatus: 1, - unionMembership: 1, + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.NO_CONSENT, + religiousBeliefs: GppDataActivity.NO_CONSENT, + healthInfo: GppDataActivity.NO_CONSENT, + orientation: GppDataActivity.NO_CONSENT, + citizenshipStatus: GppDataActivity.NO_CONSENT, + unionMembership: GppDataActivity.NO_CONSENT, )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 2, - religiousBeliefs: 2, - healthInfo: 2, - orientation: 2, - citizenshipStatus: 2, - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - unionMembership: 2, - communicationContents: 2 + .setSensitiveDataLimitUseNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 2, - religiousBeliefs: 2, - healthInfo: 2, - orientation: 2, - citizenshipStatus: 2, - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - unionMembership: 2, - communicationContents: 2 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - geneticId: 1, - biometricId: 1, - idNumbers: 1, - accountInfo: 1, - communicationContents: 1 + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geneticId: GppDataActivity.NO_CONSENT, + biometricId: GppDataActivity.NO_CONSENT, + idNumbers: GppDataActivity.NO_CONSENT, + accountInfo: GppDataActivity.NO_CONSENT, + communicationContents: GppDataActivity.NO_CONSENT )).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - communicationContents: 2 + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build() ] } - def "PBS auction call when privacy module contain some part of disallow logic which violates GPP validation should remove UFPD fields in request"() { + def "PBS auction call should remove UFPD fields in request when privacy module contain opt out of disallow GPP UsNat v2 logic"() { given: "Default Generic BidRequests with UFPD fields and account id" def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { @@ -1099,11 +1111,161 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { where: disallowGppLogic << [ - 'DBABLA~BAAgAAAAAAA.QA', - 'DBABLA~BCAAAAAAAAA.QA', - 'DBABLA~BAAEAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA' + new UsNatV2Consent.Builder() + .setSaleOptOut(OptOut.DID_NOT_OPT_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.OPTED_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) + .build() + ] + } + + def "PBS auction call should remove UFPD fields in request when privacy module contain any of US nat v2 sensitive data processing match"() { + given: "Default Generic BidRequests with UFPD fields and account id" + def accountId = PBSUtils.randomNumber as String + def gppString = new UsNatV2Consent.Builder() + .setSensitiveDataLimitUseNotice(Notice.PROVIDED) + .setSensitiveDataProcessing(usNationalV2SensitiveData) + .build() + .toString() + def bidRequest = getBidRequestWithPersonalData(accountId).tap { + regs.gppSid = [US_NAT_V1.intValue] + regs.gpp = gppString + } + + and: "Activities set for transmitUfpd with rejecting privacy regulation" + def rule = new ActivityRule().tap { + it.privacyRegulation = [IAB_US_GENERAL] + } + def activities = AllowActivities.getDefaultAllowActivities(TRANSMIT_UFPD, Activity.getDefaultActivity([rule])) + + and: "Account gpp configuration" + def accountGppConfig = new AccountGppConfig(code: IAB_US_GENERAL, enabled: true) + + and: "Existed account with privacy regulation setup" + def account = getAccountWithAllowActivitiesAndPrivacyModule(accountId, activities, [accountGppConfig]) + accountDao.save(account) + + when: "PBS processes auction requests" + activityPbsService.sendAuctionRequest(bidRequest) + + then: "Generic bidder request should have empty UFPD fields" + def bidderRequest = bidder.getBidderRequest(bidRequest.id) + verifyAll { + !bidderRequest.device.didsha1 + !bidderRequest.device.didmd5 + !bidderRequest.device.dpidsha1 + !bidderRequest.device.ifa + !bidderRequest.device.macsha1 + !bidderRequest.device.macmd5 + !bidderRequest.device.dpidmd5 + !bidderRequest.user.id + !bidderRequest.user.buyeruid + !bidderRequest.user.yob + !bidderRequest.user.gender + !bidderRequest.user.data + !bidderRequest.user.ext + } + + and: "Generic bidder request should have data in EIDS fields" + assert bidderRequest.user.eids == bidRequest.user.eids + + where: + usNationalV2SensitiveData << [ + new UsNationalV2SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(religiousBeliefs: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(healthInfo: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(orientation: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(citizenshipStatus: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(geneticId: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(biometricId: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(idNumbers: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(accountInfo: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(unionMembership: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(communicationContents: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(consumerHealthData: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(crimeVictim: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(nationalOrigin: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(transgenderStatus: GppDataActivity.CONSENT), + + new UsNationalV2SensitiveData(racialEthnicOrigin: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(religiousBeliefs: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(healthInfo: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(orientation: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(citizenshipStatus: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(unionMembership: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(consumerHealthData: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(nationalOrigin: GppDataActivity.NO_CONSENT), + + new UsNationalV2SensitiveData(geneticId: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(biometricId: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(idNumbers: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(accountInfo: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(communicationContents: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(crimeVictim: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(transgenderStatus: GppDataActivity.NO_CONSENT) + ] + } + + def "PBS auction call should remove UFPD fields in request when privacy module contain disallow child sensitive data logic US nat v2 validation"() { + given: "Default Generic BidRequests with UFPD fields and account id" + def accountId = PBSUtils.randomNumber as String + def bidRequest = getBidRequestWithPersonalData(accountId).tap { + regs.gppSid = [US_NAT_V1.intValue] + regs.gpp = new UsNatV2Consent.Builder() + .setKnownChildSensitiveDataConsents(usNationalV2ChildSensitiveData) + .build() + } + + and: "Activities set for transmitUfpd with rejecting privacy regulation" + def rule = new ActivityRule().tap { + it.privacyRegulation = [IAB_US_GENERAL] + } + + def activities = AllowActivities.getDefaultAllowActivities(TRANSMIT_UFPD, Activity.getDefaultActivity([rule])) + + and: "Account gpp configuration" + def accountGppConfig = new AccountGppConfig(code: IAB_US_GENERAL, enabled: true) + + and: "Existed account with privacy regulation setup" + def account = getAccountWithAllowActivitiesAndPrivacyModule(accountId, activities, [accountGppConfig]) + accountDao.save(account) + + when: "PBS processes auction requests" + activityPbsService.sendAuctionRequest(bidRequest) + + then: "Generic bidder request should have empty UFPD fields" + def bidderRequest = bidder.getBidderRequest(bidRequest.id) + verifyAll { + !bidderRequest.device.didsha1 + !bidderRequest.device.didmd5 + !bidderRequest.device.dpidsha1 + !bidderRequest.device.ifa + !bidderRequest.device.macsha1 + !bidderRequest.device.macmd5 + !bidderRequest.device.dpidmd5 + !bidderRequest.user.id + !bidderRequest.user.buyeruid + !bidderRequest.user.yob + !bidderRequest.user.gender + !bidderRequest.user.data + !bidderRequest.user.ext + } + + and: "Generic bidder request should have data in EIDS fields" + assert bidderRequest.user.eids == bidRequest.user.eids + + where: + usNationalV2ChildSensitiveData << [ + new UsNationalV2ChildSensitiveData(childUnder13: GppDataActivity.NO_CONSENT), + new UsNationalV2ChildSensitiveData(childFrom13to16: GppDataActivity.NO_CONSENT), + new UsNationalV2ChildSensitiveData(childFrom16to17: GppDataActivity.NO_CONSENT) ] } @@ -1291,13 +1453,13 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { assert bidderRequest.user.eids == bidRequest.user.eids where: - gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + gppConsent | gppSid + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } def "PBS auction call when privacy modules contain allowing settings should leave UFPD fields in request"() { @@ -1620,14 +1782,14 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { assert bidderRequest.user.eids == bidRequest.user.eids where: - gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + gppConsent | valueRules + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS auction call when custom privacy regulation empty and normalize is disabled should leave UFPD fields in request and emit error log"() { @@ -1762,74 +1924,51 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS amp call when transmit UFPD activities is allowing request should leave UFPD fields field in active request and update proper metrics"() { @@ -2320,7 +2459,104 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { privacyAllowRegulations << [IAB_US_GENERAL, IAB_ALL, ALL] } - def "PBS amp call when privacy module contain some part of disallow logic should remove UFPD fields in request"() { + def "PBS amp should remove UFPD fields in request when privacy module contain any of US nat v2 sensitive data processing match"() { + given: "Default Generic BidRequest with UFPD fields field and account id" + def accountId = PBSUtils.randomNumber as String + def ampStoredRequest = getBidRequestWithPersonalData(accountId) + + and: "Default amp request with link to account" + def gppString = new UsNatV2Consent.Builder() + .setSensitiveDataLimitUseNotice(Notice.PROVIDED) + .setSensitiveDataProcessing(usNationalV2SensitiveData) + .build() + .toString() + def ampRequest = AmpRequest.defaultAmpRequest.tap { + it.account = accountId + it.gppSid = US_NAT_V1.value + it.consentString = gppString + it.consentType = GPP + } + + and: "Activities set for transmitUfpd with allowing privacy regulation" + def rule = new ActivityRule().tap { + it.privacyRegulation = [IAB_US_GENERAL] + } + + def activities = AllowActivities.getDefaultAllowActivities(TRANSMIT_UFPD, Activity.getDefaultActivity([rule])) + + and: "Account gpp configuration" + def accountGppConfig = new AccountGppConfig(code: IAB_US_GENERAL, enabled: true) + + and: "Existed account with privacy regulation setup" + def account = getAccountWithAllowActivitiesAndPrivacyModule(accountId, activities, [accountGppConfig]) + accountDao.save(account) + + and: "Stored request in DB" + def storedRequest = StoredRequest.getStoredRequest(ampRequest, ampStoredRequest) + storedRequestDao.save(storedRequest) + + when: "PBS processes amp request" + activityPbsService.sendAmpRequest(ampRequest) + + then: "Generic bidder request should have empty UFPD fields" + def bidderRequest = bidder.getBidderRequest(ampStoredRequest.id) + verifyAll { + !bidderRequest.device.didsha1 + !bidderRequest.device.didmd5 + !bidderRequest.device.dpidsha1 + !bidderRequest.device.ifa + !bidderRequest.device.macsha1 + !bidderRequest.device.macmd5 + !bidderRequest.device.dpidmd5 + !bidderRequest.user.id + !bidderRequest.user.buyeruid + !bidderRequest.user.yob + !bidderRequest.user.gender + !bidderRequest.user.data + !bidderRequest.user.ext + } + + and: "Generic bidder request should have data in EIDS fields" + assert bidderRequest.user.eids == ampStoredRequest.user.eids + + where: + usNationalV2SensitiveData << [ + new UsNationalV2SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(religiousBeliefs: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(healthInfo: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(orientation: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(citizenshipStatus: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(geneticId: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(biometricId: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(idNumbers: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(accountInfo: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(unionMembership: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(communicationContents: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(consumerHealthData: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(crimeVictim: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(nationalOrigin: GppDataActivity.CONSENT), + new UsNationalV2SensitiveData(transgenderStatus: GppDataActivity.CONSENT), + + new UsNationalV2SensitiveData(racialEthnicOrigin: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(religiousBeliefs: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(healthInfo: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(orientation: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(citizenshipStatus: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(unionMembership: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(consumerHealthData: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(nationalOrigin: GppDataActivity.NO_CONSENT), + + new UsNationalV2SensitiveData(geneticId: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(biometricId: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(idNumbers: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(accountInfo: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(communicationContents: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(crimeVictim: GppDataActivity.NO_CONSENT), + new UsNationalV2SensitiveData(transgenderStatus: GppDataActivity.NO_CONSENT) + ] + } + + def "PBS amp call should remove UFPD fields in request when privacy module contains disallowed GPP rules"() { given: "Default Generic BidRequest with UFPD fields field and account id" def accountId = PBSUtils.randomNumber as String def ampStoredRequest = getBidRequestWithPersonalData(accountId) @@ -2380,127 +2616,126 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { disallowGppLogic << [ SIMPLE_GPC_DISALLOW_LOGIC, new UsNatV1Consent.Builder() - .setMspaServiceProviderMode(1) - .setMspaOptOutOptionMode(2) + .setMspaServiceProviderMode(MspaMode.YES) + .setMspaOptOutOptionMode(MspaMode.NO) .build(), new UsNatV1Consent.Builder() - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSaleOptOutNotice(2) - .setSaleOptOut(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSaleOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSharingNotice(2) - .setSharingOptOutNotice(1) - .setSharingOptOut(1) - .setMspaServiceProviderMode(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSharingNotice(Notice.NOT_PROVIDED) + .setSharingOptOutNotice(Notice.PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSharingOptOutNotice(2) - .setSharingOptOut(1) - .setSharingNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .setSharingOptOut(OptOut.OPTED_OUT) + .setSharingNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOutNotice(2) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setTargetedAdvertisingOptOutNotice(Notice.NOT_PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setTargetedAdvertisingOptOut(1) - .setTargetedAdvertisingOptOutNotice(1) - .setSaleOptOut(1) - .setSaleOptOutNotice(1) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setTargetedAdvertisingOptOut(OptOut.OPTED_OUT) + .setTargetedAdvertisingOptOutNotice(Notice.PROVIDED) + .setSaleOptOut(OptOut.OPTED_OUT) + .setSaleOptOutNotice(Notice.PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(2) + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_PROVIDED) .build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(2) - .setMspaServiceProviderMode(2) - .setMspaOptOutOptionMode(1) + .setSensitiveDataLimitUseNotice(Notice.NOT_PROVIDED) + .setMspaServiceProviderMode(MspaMode.NO) + .setMspaOptOutOptionMode(MspaMode.YES) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 1) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NOT_APPLICABLE, GppDataActivity.NO_CONSENT)) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 2) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE)) .build(), new UsNatV1Consent.Builder() - .setKnownChildSensitiveDataConsents(1, 0) + .setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData.getDefault(GppDataActivity.NO_CONSENT, GppDataActivity.NOT_APPLICABLE)) .build(), new UsNatV1Consent.Builder() - .setPersonalDataConsents(2) + .setPersonalDataConsents(GppDataActivity.CONSENT) .build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 1, - religiousBeliefs: 1, - healthInfo: 1, - orientation: 1, - citizenshipStatus: 1, - unionMembership: 1, + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.NO_CONSENT, + religiousBeliefs: GppDataActivity.NO_CONSENT, + healthInfo: GppDataActivity.NO_CONSENT, + orientation: GppDataActivity.NO_CONSENT, + citizenshipStatus: GppDataActivity.NO_CONSENT, + unionMembership: GppDataActivity.NO_CONSENT, )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataLimitUseNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 2, - religiousBeliefs: 2, - healthInfo: 2, - orientation: 2, - citizenshipStatus: 2, - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - unionMembership: 2, - communicationContents: 2 + .setSensitiveDataLimitUseNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build(), new UsNatV1Consent.Builder() - .setSensitiveDataProcessingOptOutNotice(0) - .setSensitiveDataProcessing(new UsNationalSensitiveData( - racialEthnicOrigin: 2, - religiousBeliefs: 2, - healthInfo: 2, - orientation: 2, - citizenshipStatus: 2, - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - unionMembership: 2, - communicationContents: 2 + .setSensitiveDataProcessingOptOutNotice(Notice.NOT_APPLICABLE) + .setSensitiveDataProcessing(new UsNationalV1SensitiveData( + racialEthnicOrigin: GppDataActivity.CONSENT, + religiousBeliefs: GppDataActivity.CONSENT, + healthInfo: GppDataActivity.CONSENT, + orientation: GppDataActivity.CONSENT, + citizenshipStatus: GppDataActivity.CONSENT, + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + unionMembership: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - geneticId: 1, - biometricId: 1, - idNumbers: 1, - accountInfo: 1, - communicationContents: 1 + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geneticId: GppDataActivity.NO_CONSENT, + biometricId: GppDataActivity.NO_CONSENT, + idNumbers: GppDataActivity.NO_CONSENT, + accountInfo: GppDataActivity.NO_CONSENT, + communicationContents: GppDataActivity.NO_CONSENT )).build(), - new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalSensitiveData( - geneticId: 2, - biometricId: 2, - idNumbers: 2, - accountInfo: 2, - communicationContents: 2 + new UsNatV1Consent.Builder().setSensitiveDataProcessing(new UsNationalV1SensitiveData( + geneticId: GppDataActivity.CONSENT, + biometricId: GppDataActivity.CONSENT, + idNumbers: GppDataActivity.CONSENT, + accountInfo: GppDataActivity.CONSENT, + communicationContents: GppDataActivity.CONSENT )).build() ] } - def "PBS amp call when privacy module contain some part of disallow logic which violates GPP validation should remove UFPD fields in request"() { + def "PBS amp call should remove UFPD fields in request when privacy module contain opt out of disallow GPP UsNat v2 logic"() { given: "Default Generic BidRequest with UFPD fields field and account id" def accountId = PBSUtils.randomNumber as String def ampStoredRequest = getBidRequestWithPersonalData(accountId) @@ -2557,11 +2792,18 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { where: disallowGppLogic << [ - 'DBABLA~BAAgAAAAAAA.QA', - 'DBABLA~BCAAAAAAAAA.QA', - 'DBABLA~BAAEAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA', - 'DBABLA~BAAIAAAAAAA.QA' + new UsNatV2Consent.Builder() + .setSaleOptOut(OptOut.DID_NOT_OPT_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOutNotice(Notice.NOT_PROVIDED) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.OPTED_OUT) + .build(), + new UsNatV2Consent.Builder() + .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) + .build() ] } @@ -2774,13 +3016,13 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { assert bidderRequest.user.eids == ampStoredRequest.user.eids where: - gppConsent | gppSid - new UsNatV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_NAT_V1 - new UsCaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CA_V1 - new UsVaV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_VA_V1 - new UsCoV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CO_V1 - new UsUtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_UT_V1 - new UsCtV1Consent.Builder().setMspaServiceProviderMode(1).setMspaOptOutOptionMode(2).build() | US_CT_V1 + gppConsent | gppSid + new UsNatV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_NAT_V1 + new UsCaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CA_V1 + new UsVaV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_VA_V1 + new UsCoV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CO_V1 + new UsUtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_UT_V1 + new UsCtV1Consent.Builder().setMspaServiceProviderMode(MspaMode.YES).setMspaOptOutOptionMode(MspaMode.NO).build() | US_CT_V1 } def "PBS amp call when privacy modules contain allowing settings should leave UFPD fields in request"() { @@ -3221,14 +3463,14 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { assert bidderRequest.user.eids == ampStoredRequest.user.eids where: - gppConsent | valueRules - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] - new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] - new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), - new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + gppConsent | valueRules + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(false).build() | [new InequalityValueRule(GPC, NOTICE_PROVIDED)] + new UsNatV1Consent.Builder().setGpc(true).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(SHARING_NOTICE, NOTICE_NOT_PROVIDED)] + new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() | [new EqualityValueRule(GPC, NOTICE_PROVIDED), + new EqualityValueRule(PERSONAL_DATA_CONSENTS, NOTICE_NOT_PROVIDED)] } def "PBS amp call when custom privacy regulation empty and normalize is disabled should leave UFPD fields in request and emit error log"() { @@ -3380,74 +3622,51 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { where: gppSid | equalityValueRules | gppStateConsent - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(idNumbers: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(accountInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geolocation: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(racialEthnicOrigin: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(communicationContents: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(geneticId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(biometricId: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(healthInfo: 2)) - US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder() - .setSensitiveDataProcessing(new UsCaliforniaSensitiveData(orientation: 2)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ID_NUMBERS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(idNumbers: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ACCOUNT_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(accountInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geolocation: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_COMMUNICATION_CONTENTS, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(communicationContents: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_CA_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsCaV1Consent.Builder().setSensitiveDataProcessing(new UsCaliforniaV1SensitiveData(orientation: GppDataActivity.CONSENT)) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.default) US_CA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2), PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_VA_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsVaV1Consent.Builder().setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData.default) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_CO_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(0) - - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(racialEthnicOrigin: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(religiousBeliefs: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(orientation: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(citizenshipStatus: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(healthInfo: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geneticId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(biometricId: 2)) - US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder() - .setSensitiveDataProcessing(new UsUtahSensitiveData(geolocation: 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCoV1Consent.Builder().setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData.default) + + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(racialEthnicOrigin: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_RELIGIOUS_BELIEFS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(religiousBeliefs: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_ORIENTATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(orientation: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_CITIZENSHIP_STATUS, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(citizenshipStatus: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_HEALTH_INFO, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(healthInfo: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GENETIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geneticId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_BIOMETRIC_ID, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(biometricId: GppDataActivity.CONSENT)) + US_UT_V1 | [new EqualityValueRule(SENSITIVE_DATA_GEOLOCATION, CONSENT)] | new UsUtV1Consent.Builder().setSensitiveDataProcessing(new UsUtahV1SensitiveData(geolocation: GppDataActivity.CONSENT)) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(1, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.getRandom([GppDataActivity.NOT_APPLICABLE])) US_UT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsUtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NOT_APPLICABLE), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 0, 0) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NOT_APPLICABLE)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.default) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(0, 2, 2) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getDefault(GppDataActivity.CONSENT, GppDataActivity.NOT_APPLICABLE, GppDataActivity.CONSENT)) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), PBSUtils.getRandomNumber(0, 2), 1) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom16to18 = GppDataActivity.NO_CONSENT }) US_CT_V1 | [new EqualityValueRule(CHILD_CONSENTS_BELOW_13, NO_CONSENT), - new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder() - .setKnownChildSensitiveDataConsents(PBSUtils.getRandomNumber(0, 2), 1, PBSUtils.getRandomNumber(0, 2)) + new EqualityValueRule(CHILD_CONSENTS_FROM_13_TO_16, NO_CONSENT)] | new UsCtV1Consent.Builder().setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData.getRandom().tap { it.childFrom13to16 = GppDataActivity.NO_CONSENT }) } def "PBS auction call when transmit UFPD activities is rejecting requests with activityTransition false should remove only UFPD fields in request"() { @@ -3510,7 +3729,7 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitUfpd with rejecting privacy regulation" @@ -3558,7 +3777,7 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitUfpd with rejecting privacy regulation" @@ -3624,7 +3843,7 @@ class GppTransmitUfpdActivitiesSpec extends PrivacyBaseSpec { def accountId = PBSUtils.randomNumber as String def bidRequest = getBidRequestWithPersonalData(accountId).tap { regs.gppSid = [US_NAT_V1.intValue] - regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(2).build() + regs.gpp = new UsNatV1Consent.Builder().setPersonalDataConsents(GppDataActivity.CONSENT).build() } and: "Activities set for transmitUfpd with rejecting privacy regulation" 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 e16dc69dd62..34756f703ca 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 @@ -33,7 +33,7 @@ import org.prebid.server.functional.util.PBSUtils import org.prebid.server.functional.util.privacy.ConsentString import org.prebid.server.functional.util.privacy.TcfConsent import org.prebid.server.functional.util.privacy.gpp.GppConsent -import org.prebid.server.functional.util.privacy.gpp.UsNatV1Consent +import org.prebid.server.functional.util.privacy.gpp.v1.UsNatV1Consent import static org.prebid.server.functional.model.bidder.BidderName.GENERIC import static org.prebid.server.functional.model.bidder.BidderName.OPENX diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/GppConsent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/GppConsent.groovy index 3363ab73499..e4bc73c6410 100644 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/GppConsent.groovy +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/GppConsent.groovy @@ -53,7 +53,7 @@ abstract class GppConsent implements ConsentString { this } - Builder setVersion(int version) { + private Builder setVersion(int version) { fieldValue("Version", version) } @@ -64,12 +64,13 @@ abstract class GppConsent implements ConsentString { TCF_EU_V2(TcfEuV2.NAME, TcfEuV2.VERSION), //2 USP_V1(UspV1.NAME, UspV1.VERSION), //6 - US_NAT_V1(UsNat.NAME, UsNat.VERSION), //7 - US_CA_V1(UsCa.NAME, UsCa.VERSION), //8 - US_VA_V1(UsVa.NAME, UsVa.VERSION), //9 - US_CO_V1(UsCo.NAME, UsCo.VERSION), //10 - US_UT_V1(UsUt.NAME, UsUt.VERSION), //11 - US_CT_V1(UsCt.NAME, UsCt.VERSION), //12 + US_NAT_V1(UsNat.NAME, UsNat.VERSION), //7 + US_NAT_V2(UsNat.NAME, 2), //7 + US_CA_V1(UsCa.NAME, UsCa.VERSION), //8 + US_VA_V1(UsVa.NAME, UsVa.VERSION), //9 + US_CO_V1(UsCo.NAME, UsCo.VERSION), //10 + US_UT_V1(UsUt.NAME, UsUt.VERSION), //11 + US_CT_V1(UsCt.NAME, UsCt.VERSION), //12 final String name final int version diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCtV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCtV1Consent.groovy deleted file mode 100644 index ac8a8982eb3..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCtV1Consent.groovy +++ /dev/null @@ -1,100 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp - -import com.iab.gpp.encoder.field.UsCtField -import org.prebid.server.functional.util.privacy.gpp.data.UsConnecticutSensitiveData - -class UsCtV1Consent extends GppConsent { - - private static final Section SECTION = Section.US_CT_V1 - - protected UsCtV1Consent(Section section, Map fieldValues) { - super(section, fieldValues) - } - - @Override - protected String encodeSection() { - gppModel.encodeSection(SECTION.name) - } - - static class Builder extends GppConsent.Builder { - - Builder() { - super(SECTION) - } - - Builder setVersion(Integer version) { - fieldValue(UsCtField.VERSION, version) - this - } - - Builder setSharingNotice(Integer sharingNotice) { - fieldValue(UsCtField.SHARING_NOTICE, sharingNotice) - this - } - - Builder setSaleOptOutNotice(Integer saleOptOutNotice) { - fieldValue(UsCtField.SALE_OPT_OUT_NOTICE, saleOptOutNotice) - this - } - - Builder setTargetedAdvertisingOptOutNotice(Integer targetedAdvertisingOptOutNotice) { - fieldValue(UsCtField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice) - this - } - - Builder setSaleOptOut(Integer saleOptOut) { - fieldValue(UsCtField.SALE_OPT_OUT, saleOptOut) - this - } - - Builder setTargetedAdvertisingOptOut(Integer targetedAdvertisingOptOut) { - fieldValue(UsCtField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut) - this - } - - Builder setSensitiveDataProcessing(UsConnecticutSensitiveData sensitiveDataProcessing) { - fieldValue(UsCtField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) - this - } - - Builder setKnownChildSensitiveDataConsents(Integer childFrom13to16, Integer childBlow13, Integer childFrom16to18) { - fieldValue(UsCtField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, [childFrom13to16, childBlow13, childFrom16to18]) - this - } - - Builder setMspaCoveredTransaction(Integer mspaCoveredTransaction) { - fieldValue(UsCtField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction) - this - } - - Builder setMspaOptOutOptionMode(Integer mspaOptOutOptionMode) { - fieldValue(UsCtField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode) - this - } - - Builder setMspaServiceProviderMode(Integer mspaServiceProviderMode) { - fieldValue(UsCtField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode) - this - } - - Builder setGpcSegmentType(Integer gpcSegmentType) { - fieldValue(UsCtField.GPC_SEGMENT_TYPE, gpcSegmentType) - this - } - - Builder setGpcSegmentIncluded(Integer gpcSegmentIncluded) { - fieldValue(UsCtField.GPC_SEGMENT_INCLUDED, gpcSegmentIncluded) - this - } - - Builder setGpc(Boolean gpc) { - fieldValue(UsCtField.GPC, gpc) - this - } - - @Override - GppConsent build() { - return new UsCtV1Consent(section, fieldValues) - } - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsNatV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsNatV1Consent.groovy deleted file mode 100644 index 1318ba37c24..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsNatV1Consent.groovy +++ /dev/null @@ -1,125 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp - -import com.iab.gpp.encoder.field.UsNatField -import org.prebid.server.functional.util.privacy.gpp.data.UsNationalSensitiveData - -class UsNatV1Consent extends GppConsent { - - private static final Section SECTION = Section.US_NAT_V1 - - protected UsNatV1Consent(Section section, Map fieldValues) { - super(section, fieldValues) - } - - @Override - protected String encodeSection() { - gppModel.encodeSection(SECTION.name) - } - - static class Builder extends GppConsent.Builder { - - Builder() { - super(SECTION) - } - - Builder setVersion(Integer version) { - fieldValue(UsNatField.VERSION, version) - this - } - - Builder setSharingNotice(Integer sharingNotice) { - fieldValue(UsNatField.SHARING_NOTICE, sharingNotice) - this - } - - Builder setSaleOptOutNotice(Integer saleOptOutNotice) { - fieldValue(UsNatField.SALE_OPT_OUT_NOTICE, saleOptOutNotice) - this - } - - Builder setSharingOptOutNotice(Integer sharingOptOutNotice) { - fieldValue(UsNatField.SHARING_OPT_OUT_NOTICE, sharingOptOutNotice) - this - } - - Builder setTargetedAdvertisingOptOutNotice(Integer targetedAdvertisingOptOutNotice) { - fieldValue(UsNatField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice) - this - } - - Builder setSensitiveDataProcessingOptOutNotice(Integer sensitiveDataProcessingOptOutNotice) { - fieldValue(UsNatField.SENSITIVE_DATA_PROCESSING_OPT_OUT_NOTICE, sensitiveDataProcessingOptOutNotice) - this - } - - Builder setSensitiveDataLimitUseNotice(Integer sensitiveDataLimitUseNotice) { - fieldValue(UsNatField.SENSITIVE_DATA_LIMIT_USE_NOTICE, sensitiveDataLimitUseNotice) - this - } - - Builder setSaleOptOut(Integer saleOptOut) { - fieldValue(UsNatField.SALE_OPT_OUT, saleOptOut) - this - } - - Builder setSharingOptOut(Integer sharingOptOut) { - fieldValue(UsNatField.SHARING_OPT_OUT, sharingOptOut) - this - } - - Builder setTargetedAdvertisingOptOut(Integer targetedAdvertisingOptOut) { - fieldValue(UsNatField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut) - this - } - - Builder setSensitiveDataProcessing(UsNationalSensitiveData sensitiveDataProcessing) { - fieldValue(UsNatField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) - this - } - - Builder setPersonalDataConsents(Integer personalDataConsents) { - fieldValue(UsNatField.PERSONAL_DATA_CONSENTS, personalDataConsents) - this - } - - Builder setKnownChildSensitiveDataConsents(Integer childFrom13to16, Integer childBlow13) { - fieldValue(UsNatField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, [childFrom13to16, childBlow13]) - this - } - - Builder setMspaCoveredTransaction(Integer mspaCoveredTransaction) { - fieldValue(UsNatField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction) - this - } - - Builder setMspaOptOutOptionMode(Integer mspaOptOutOptionMode) { - fieldValue(UsNatField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode) - this - } - - Builder setMspaServiceProviderMode(Integer mspaServiceProviderMode) { - fieldValue(UsNatField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode) - this - } - - Builder setGpcSegmentType(Integer gpcSegmentType) { - fieldValue(UsNatField.GPC_SEGMENT_TYPE, gpcSegmentType) - this - } - - Builder setGpcSegmentIncluded(Boolean gpcSegmentIncluded) { - fieldValue(UsNatField.GPC_SEGMENT_INCLUDED, gpcSegmentIncluded) - this - } - - Builder setGpc(Boolean gpc) { - fieldValue(UsNatField.GPC, gpc) - this - } - - @Override - GppConsent build() { - new UsNatV1Consent(section, fieldValues) - } - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsUtV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsUtV1Consent.groovy deleted file mode 100644 index 960485c4fcb..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsUtV1Consent.groovy +++ /dev/null @@ -1,90 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp - -import com.iab.gpp.encoder.field.UsUtField -import org.prebid.server.functional.util.privacy.gpp.data.UsUtahSensitiveData - -class UsUtV1Consent extends GppConsent { - - private static final Section SECTION = Section.US_UT_V1 - - protected UsUtV1Consent(Section section, Map fieldValues) { - super(section, fieldValues) - } - - @Override - protected String encodeSection() { - gppModel.encodeSection(SECTION.name) - } - - static class Builder extends GppConsent.Builder { - - Builder() { - super(SECTION) - } - - Builder setVersion(Integer version) { - fieldValue(UsUtField.VERSION, version) - this - } - - Builder setSharingNotice(Integer sharingNotice) { - fieldValue(UsUtField.SHARING_NOTICE, sharingNotice) - this - } - - Builder setSaleOptOutNotice(Integer saleOptOutNotice) { - fieldValue(UsUtField.SALE_OPT_OUT_NOTICE, saleOptOutNotice) - this - } - - Builder setTargetedAdvertisingOptOutNotice(Integer targetedAdvertisingOptOutNotice) { - fieldValue(UsUtField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice) - this - } - - Builder setSensitiveDataProcessingOptOutNotice(Integer sensitiveDataProcessingOptOutNotice) { - fieldValue(UsUtField.SENSITIVE_DATA_PROCESSING_OPT_OUT_NOTICE, sensitiveDataProcessingOptOutNotice) - this - } - - Builder setSaleOptOut(Integer saleOptOut) { - fieldValue(UsUtField.SALE_OPT_OUT, saleOptOut) - this - } - - Builder setTargetedAdvertisingOptOut(Integer targetedAdvertisingOptOut) { - fieldValue(UsUtField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut) - this - } - - Builder setSensitiveDataProcessing(UsUtahSensitiveData sensitiveDataProcessing) { - fieldValue(UsUtField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) - this - } - - Builder setKnownChildSensitiveDataConsents(Integer knownChildSensitiveDataConsents) { - fieldValue(UsUtField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, knownChildSensitiveDataConsents) - this - } - - Builder setMspaCoveredTransaction(Integer mspaCoveredTransaction) { - fieldValue(UsUtField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction) - this - } - - Builder setMspaOptOutOptionMode(Integer mspaOptOutOptionMode) { - fieldValue(UsUtField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode) - this - } - - Builder setMspaServiceProviderMode(Integer mspaServiceProviderMode) { - fieldValue(UsUtField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode) - this - } - - @Override - GppConsent build() { - return new UsUtV1Consent(section, fieldValues) - } - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsVaV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsVaV1Consent.groovy deleted file mode 100644 index 07e75346ba4..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsVaV1Consent.groovy +++ /dev/null @@ -1,85 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp - -import com.iab.gpp.encoder.field.UsVaField -import org.prebid.server.functional.util.privacy.gpp.data.UsVirginiaSensitiveData - -class UsVaV1Consent extends GppConsent { - - private static final Section SECTION = Section.US_VA_V1 - - protected UsVaV1Consent(Section section, Map fieldValues) { - super(section, fieldValues) - } - - @Override - protected String encodeSection() { - gppModel.encodeSection(SECTION.name) - } - - static class Builder extends GppConsent.Builder { - - Builder() { - super(SECTION) - } - - Builder setVersion(Integer version) { - fieldValue(UsVaField.VERSION, version) - this - } - - Builder setSharingNotice(Integer sharingNotice) { - fieldValue(UsVaField.SHARING_NOTICE, sharingNotice) - this - } - - Builder setSaleOptOutNotice(Integer saleOptOutNotice) { - fieldValue(UsVaField.SALE_OPT_OUT_NOTICE, saleOptOutNotice) - this - } - - Builder setTargetedAdvertisingOptOutNotice(Integer targetedAdvertisingOptOutNotice) { - fieldValue(UsVaField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice) - this - } - - Builder setSaleOptOut(Integer saleOptOut) { - fieldValue(UsVaField.SALE_OPT_OUT, saleOptOut) - this - } - - Builder setTargetedAdvertisingOptOut(Integer targetedAdvertisingOptOut) { - fieldValue(UsVaField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut) - this - } - - Builder setSensitiveDataProcessing(UsVirginiaSensitiveData sensitiveDataProcessing) { - fieldValue(UsVaField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) - this - } - - Builder setKnownChildSensitiveDataConsents(Integer childSensitiveDataConsents) { - fieldValue(UsVaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, childSensitiveDataConsents) - this - } - - Builder setMspaCoveredTransaction(Integer mspaCoveredTransaction) { - fieldValue(UsVaField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction) - this - } - - Builder setMspaOptOutOptionMode(Integer mspaOptOutOptionMode) { - fieldValue(UsVaField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode) - this - } - - Builder setMspaServiceProviderMode(Integer mspaServiceProviderMode) { - fieldValue(UsVaField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode) - this - } - - @Override - GppConsent build() { - return new UsVaV1Consent(section, fieldValues) - } - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsCaliforniaSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsCaliforniaSensitiveData.groovy deleted file mode 100644 index d23e2cde1ac..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsCaliforniaSensitiveData.groovy +++ /dev/null @@ -1,52 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp.data - -import org.prebid.server.functional.util.PBSUtils - -class UsCaliforniaSensitiveData { - - int idNumbers - int accountInfo - int geolocation - int racialEthnicOrigin - int communicationContents - int geneticId - int biometricId - int healthInfo - int orientation - - static UsCaliforniaSensitiveData generateRandomSensitiveData() { - new UsCaliforniaSensitiveData().tap { - idNumbers = PBSUtils.getRandomNumber(0, 2) - accountInfo = PBSUtils.getRandomNumber(0, 2) - geolocation = PBSUtils.getRandomNumber(0, 2) - racialEthnicOrigin = PBSUtils.getRandomNumber(0, 2) - communicationContents = PBSUtils.getRandomNumber(0, 2) - geneticId = PBSUtils.getRandomNumber(0, 2) - biometricId = PBSUtils.getRandomNumber(0, 2) - healthInfo = PBSUtils.getRandomNumber(0, 2) - orientation = PBSUtils.getRandomNumber(0, 2) - } - } - - static UsCaliforniaSensitiveData fromList(List sensitiveData) { - if (sensitiveData.size() != 9) { - throw new IllegalArgumentException("Invalid data size. Expected 9 values.") - } - new UsCaliforniaSensitiveData().tap { - idNumbers = sensitiveData[0] - accountInfo = sensitiveData[1] - geolocation = sensitiveData[2] - racialEthnicOrigin = sensitiveData[3] - communicationContents = sensitiveData[4] - geneticId = sensitiveData[5] - biometricId = sensitiveData[6] - healthInfo = sensitiveData[7] - orientation = sensitiveData[8] - } - } - - List getContentList() { - [idNumbers, accountInfo, geolocation, racialEthnicOrigin, - communicationContents, geneticId, biometricId, healthInfo, orientation] - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsColoradoSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsColoradoSensitiveData.groovy deleted file mode 100644 index 00ca00d3d60..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsColoradoSensitiveData.groovy +++ /dev/null @@ -1,46 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp.data - -import org.prebid.server.functional.util.PBSUtils - -class UsColoradoSensitiveData { - - int racialEthnicOrigin - int religiousBeliefs - int healthInfo - int orientation - int citizenshipStatus - int geneticId - int biometricId - - static UsColoradoSensitiveData generateRandomSensitiveData() { - new UsColoradoSensitiveData().tap { - racialEthnicOrigin = PBSUtils.getRandomNumber(0, 2) - religiousBeliefs = PBSUtils.getRandomNumber(0, 2) - healthInfo = PBSUtils.getRandomNumber(0, 2) - orientation = PBSUtils.getRandomNumber(0, 2) - citizenshipStatus = PBSUtils.getRandomNumber(0, 2) - geneticId = PBSUtils.getRandomNumber(0, 2) - biometricId = PBSUtils.getRandomNumber(0, 2) - } - } - - static UsColoradoSensitiveData fromList(List data) { - if (data.size() != 7) { - throw new IllegalArgumentException("Invalid data size. Expected 7 values.") - } - new UsColoradoSensitiveData().tap { - racialEthnicOrigin = data[0] - religiousBeliefs = data[1] - healthInfo = data[2] - orientation = data[3] - citizenshipStatus = data[4] - geneticId = data[5] - biometricId = data[6] - } - } - - List getContentList() { - [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, - citizenshipStatus, geneticId, biometricId] - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsConnecticutSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsConnecticutSensitiveData.groovy deleted file mode 100644 index 8f0a6bfc18d..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsConnecticutSensitiveData.groovy +++ /dev/null @@ -1,52 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp.data - -import org.prebid.server.functional.util.PBSUtils - -class UsConnecticutSensitiveData { - - int racialEthnicOrigin - int religiousBeliefs - int healthInfo - int orientation - int citizenshipStatus - int geneticId - int biometricId - int geolocation - int idNumbers - - static UsConnecticutSensitiveData generateRandomSensitiveData() { - new UsConnecticutSensitiveData().tap { - racialEthnicOrigin = PBSUtils.getRandomNumber(0, 2) - religiousBeliefs = PBSUtils.getRandomNumber(0, 2) - healthInfo = PBSUtils.getRandomNumber(0, 2) - orientation = PBSUtils.getRandomNumber(0, 2) - citizenshipStatus = PBSUtils.getRandomNumber(0, 2) - geneticId = PBSUtils.getRandomNumber(0, 2) - biometricId = PBSUtils.getRandomNumber(0, 2) - geolocation = PBSUtils.getRandomNumber(0, 2) - idNumbers = PBSUtils.getRandomNumber(0, 2) - } - } - - static UsConnecticutSensitiveData fromList(List data) { - if (data.size() != 9) { - throw new IllegalArgumentException("Invalid data size. Expected 9 values.") - } - new UsConnecticutSensitiveData().tap { - racialEthnicOrigin = data[0] - religiousBeliefs = data[1] - healthInfo = data[2] - orientation = data[3] - citizenshipStatus = data[4] - geneticId = data[5] - biometricId = data[6] - geolocation = data[7] - idNumbers = data[8] - } - } - - List getContentList() { - [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, - citizenshipStatus, geneticId, biometricId, geolocation, idNumbers] - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsNationalSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsNationalSensitiveData.groovy deleted file mode 100644 index ff7fc963cf5..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsNationalSensitiveData.groovy +++ /dev/null @@ -1,62 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp.data - -import org.prebid.server.functional.util.PBSUtils - -class UsNationalSensitiveData { - - int racialEthnicOrigin - int religiousBeliefs - int healthInfo - int orientation - int citizenshipStatus - int geneticId - int biometricId - int geolocation - int idNumbers - int accountInfo - int unionMembership - int communicationContents - - static UsNationalSensitiveData generateRandomSensitiveData() { - new UsNationalSensitiveData().tap { - racialEthnicOrigin = PBSUtils.getRandomNumber(0, 2) - religiousBeliefs = PBSUtils.getRandomNumber(0, 2) - healthInfo = PBSUtils.getRandomNumber(0, 2) - orientation = PBSUtils.getRandomNumber(0, 2) - citizenshipStatus = PBSUtils.getRandomNumber(0, 2) - geneticId = PBSUtils.getRandomNumber(0, 2) - biometricId = PBSUtils.getRandomNumber(0, 2) - geolocation = PBSUtils.getRandomNumber(0, 2) - idNumbers = PBSUtils.getRandomNumber(0, 2) - accountInfo = PBSUtils.getRandomNumber(0, 2) - unionMembership = PBSUtils.getRandomNumber(0, 2) - communicationContents = PBSUtils.getRandomNumber(0, 2) - } - } - - static UsNationalSensitiveData fromList(List data) { - if (data.size() != 12) { - throw new IllegalArgumentException("Invalid data size. Expected 12 values.") - } - new UsNationalSensitiveData().tap { - racialEthnicOrigin = data[0] - religiousBeliefs = data[1] - healthInfo = data[2] - orientation = data[3] - citizenshipStatus = data[4] - geneticId = data[5] - biometricId = data[6] - geolocation = data[7] - idNumbers = data[8] - accountInfo = data[9] - unionMembership = data[10] - communicationContents = data[11] - } - } - - List getContentList() { - [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, - citizenshipStatus, geneticId, biometricId, geolocation, - idNumbers, accountInfo, unionMembership, communicationContents] - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsUtahSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsUtahSensitiveData.groovy deleted file mode 100644 index 8b92abaa3de..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsUtahSensitiveData.groovy +++ /dev/null @@ -1,49 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp.data - -import org.prebid.server.functional.util.PBSUtils - -class UsUtahSensitiveData { - - int racialEthnicOrigin - int religiousBeliefs - int orientation - int citizenshipStatus - int healthInfo - int geneticId - int biometricId - int geolocation - - static UsUtahSensitiveData generateRandomSensitiveData() { - new UsUtahSensitiveData().tap { - racialEthnicOrigin = PBSUtils.getRandomNumber(0, 2) - religiousBeliefs = PBSUtils.getRandomNumber(0, 2) - orientation = PBSUtils.getRandomNumber(0, 2) - citizenshipStatus = PBSUtils.getRandomNumber(0, 2) - healthInfo = PBSUtils.getRandomNumber(0, 2) - geneticId = PBSUtils.getRandomNumber(0, 2) - biometricId = PBSUtils.getRandomNumber(0, 2) - geolocation = PBSUtils.getRandomNumber(0, 2) - } - } - - static UsUtahSensitiveData fromList(List data) { - if (data.size() != 8) { - throw new IllegalArgumentException("Invalid data size. Expected 8 values.") - } - new UsUtahSensitiveData().tap { - racialEthnicOrigin = data[0] - religiousBeliefs = data[1] - orientation = data[2] - citizenshipStatus = data[3] - healthInfo = data[4] - geneticId = data[5] - biometricId = data[6] - geolocation = data[7] - } - } - - List getContentList() { - [racialEthnicOrigin, religiousBeliefs, orientation, citizenshipStatus, - healthInfo, geneticId, biometricId, geolocation] - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsVirginiaSensitiveData.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsVirginiaSensitiveData.groovy deleted file mode 100644 index e3f49eaaed1..00000000000 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/data/UsVirginiaSensitiveData.groovy +++ /dev/null @@ -1,49 +0,0 @@ -package org.prebid.server.functional.util.privacy.gpp.data - -import org.prebid.server.functional.util.PBSUtils - -class UsVirginiaSensitiveData { - - int racialEthnicOrigin - int religiousBeliefs - int healthInfo - int orientation - int citizenshipStatus - int geneticId - int biometricId - int geolocation - - static UsVirginiaSensitiveData generateRandomSensitiveData() { - new UsVirginiaSensitiveData().tap { - racialEthnicOrigin = PBSUtils.getRandomNumber(0, 2) - religiousBeliefs = PBSUtils.getRandomNumber(0, 2) - healthInfo = PBSUtils.getRandomNumber(0, 2) - orientation = PBSUtils.getRandomNumber(0, 2) - citizenshipStatus = PBSUtils.getRandomNumber(0, 2) - geneticId = PBSUtils.getRandomNumber(0, 2) - biometricId = PBSUtils.getRandomNumber(0, 2) - geolocation = PBSUtils.getRandomNumber(0, 2) - } - } - - static UsVirginiaSensitiveData fromList(List data) { - if (data.size() != 8) { - throw new IllegalArgumentException("Invalid data size. Expected 8 values.") - } - new UsVirginiaSensitiveData().tap { - racialEthnicOrigin = data[0] - religiousBeliefs = data[1] - healthInfo = data[2] - orientation = data[3] - citizenshipStatus = data[4] - geneticId = data[5] - biometricId = data[6] - geolocation = data[7] - } - } - - List getContentList() { - [racialEthnicOrigin, religiousBeliefs, healthInfo, orientation, - citizenshipStatus, geneticId, biometricId, geolocation] - } -} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCaV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCaV1Consent.groovy similarity index 54% rename from src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCaV1Consent.groovy rename to src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCaV1Consent.groovy index 035a9205d1e..9b256e8b2f8 100644 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCaV1Consent.groovy +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCaV1Consent.groovy @@ -1,7 +1,13 @@ -package org.prebid.server.functional.util.privacy.gpp +package org.prebid.server.functional.util.privacy.gpp.v1 import com.iab.gpp.encoder.field.UsCaField -import org.prebid.server.functional.util.privacy.gpp.data.UsCaliforniaSensitiveData +import org.prebid.server.functional.model.privacy.gpp.GppDataActivity +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1ChildSensitiveData +import org.prebid.server.functional.util.privacy.gpp.GppConsent +import org.prebid.server.functional.model.privacy.gpp.UsCaliforniaV1SensitiveData class UsCaV1Consent extends GppConsent { @@ -22,63 +28,58 @@ class UsCaV1Consent extends GppConsent { super(SECTION) } - Builder setVersion(Integer version) { - fieldValue(UsCaField.VERSION, version) + Builder setSaleOptOutNotice(Notice saleOptOutNotice) { + fieldValue(UsCaField.SALE_OPT_OUT_NOTICE, saleOptOutNotice.value) this } - Builder setSaleOptOutNotice(Integer saleOptOutNotice) { - fieldValue(UsCaField.SALE_OPT_OUT_NOTICE, saleOptOutNotice) + Builder setSharingOptOutNotice(Notice sharingOptOutNotice) { + fieldValue(UsCaField.SHARING_OPT_OUT_NOTICE, sharingOptOutNotice.value) this } - Builder setSharingOptOutNotice(Integer sharingOptOutNotice) { - fieldValue(UsCaField.SHARING_OPT_OUT_NOTICE, sharingOptOutNotice) + Builder setSensitiveDataLimitUseNotice(Notice sensitiveDataLimitUseNotice) { + fieldValue(UsCaField.SENSITIVE_DATA_LIMIT_USE_NOTICE, sensitiveDataLimitUseNotice.value) this } - Builder setSensitiveDataLimitUseNotice(Integer sensitiveDataLimitUseNotice) { - fieldValue(UsCaField.SENSITIVE_DATA_LIMIT_USE_NOTICE, sensitiveDataLimitUseNotice) + Builder setSaleOptOut(OptOut saleOptOut) { + fieldValue(UsCaField.SALE_OPT_OUT, saleOptOut.value) this } - Builder setSaleOptOut(Integer saleOptOut) { - fieldValue(UsCaField.SALE_OPT_OUT, saleOptOut) + Builder setSharingOptOut(OptOut sharingOptOut) { + fieldValue(UsCaField.SHARING_OPT_OUT, sharingOptOut.value) this } - Builder setSharingOptOut(Integer sharingOptOut) { - fieldValue(UsCaField.SHARING_OPT_OUT, sharingOptOut) - this - } - - Builder setSensitiveDataProcessing(UsCaliforniaSensitiveData sensitiveDataProcessing) { + Builder setSensitiveDataProcessing(UsCaliforniaV1SensitiveData sensitiveDataProcessing) { fieldValue(UsCaField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) this } - Builder setKnownChildSensitiveDataConsents(Integer childFrom13to16, Integer childBlow13) { - fieldValue(UsCaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, [childFrom13to16, childBlow13]) + Builder setKnownChildSensitiveDataConsents(UsCaliforniaV1ChildSensitiveData sensitiveData) { + fieldValue(UsCaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, sensitiveData.contentList) this } - Builder setPersonalDataConsents(Integer personalDataConsents) { - fieldValue(UsCaField.PERSONAL_DATA_CONSENTS, personalDataConsents) + Builder setPersonalDataConsents(GppDataActivity personalDataConsents) { + fieldValue(UsCaField.PERSONAL_DATA_CONSENTS, personalDataConsents.value) this } - Builder setMspaCoveredTransaction(Integer mspaCoveredTransaction) { + Builder setMspaCoveredTransaction(Boolean mspaCoveredTransaction) { fieldValue(UsCaField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction) this } - Builder setMspaOptOutOptionMode(Integer mspaOptOutOptionMode) { - fieldValue(UsCaField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode) + Builder setMspaOptOutOptionMode(MspaMode mspaOptOutOptionMode) { + fieldValue(UsCaField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode.value) this } - Builder setMspaServiceProviderMode(Integer mspaServiceProviderMode) { - fieldValue(UsCaField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode) + Builder setMspaServiceProviderMode(MspaMode mspaServiceProviderMode) { + fieldValue(UsCaField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode.value) this } diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCoV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCoV1Consent.groovy similarity index 52% rename from src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCoV1Consent.groovy rename to src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCoV1Consent.groovy index 9cd3dd997e8..2903be57f36 100644 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsCoV1Consent.groovy +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCoV1Consent.groovy @@ -1,7 +1,12 @@ -package org.prebid.server.functional.util.privacy.gpp +package org.prebid.server.functional.util.privacy.gpp.v1 import com.iab.gpp.encoder.field.UsCoField -import org.prebid.server.functional.util.privacy.gpp.data.UsColoradoSensitiveData +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsColoradoV1ChildSensitiveData +import org.prebid.server.functional.util.privacy.gpp.GppConsent +import org.prebid.server.functional.model.privacy.gpp.UsColoradoV1SensitiveData class UsCoV1Consent extends GppConsent { @@ -22,58 +27,53 @@ class UsCoV1Consent extends GppConsent { super(SECTION) } - Builder setVersion(Integer version) { - fieldValue(UsCoField.VERSION, version) + Builder setSharingNotice(Notice sharingNotice) { + fieldValue(UsCoField.SHARING_NOTICE, sharingNotice.value) this } - Builder setSharingNotice(Integer sharingNotice) { - fieldValue(UsCoField.SHARING_NOTICE, sharingNotice) + Builder setSaleOptOutNotice(Notice saleOptOutNotice) { + fieldValue(UsCoField.SALE_OPT_OUT_NOTICE, saleOptOutNotice.value) this } - Builder setSaleOptOutNotice(Integer saleOptOutNotice) { - fieldValue(UsCoField.SALE_OPT_OUT_NOTICE, saleOptOutNotice) + Builder setTargetedAdvertisingOptOutNotice(Notice targetedAdvertisingOptOutNotice) { + fieldValue(UsCoField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice.value) this } - Builder setTargetedAdvertisingOptOutNotice(Integer targetedAdvertisingOptOutNotice) { - fieldValue(UsCoField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice) + Builder setSaleOptOut(OptOut saleOptOut) { + fieldValue(UsCoField.SALE_OPT_OUT, saleOptOut.value) this } - Builder setSaleOptOut(Integer saleOptOut) { - fieldValue(UsCoField.SALE_OPT_OUT, saleOptOut) + Builder setTargetedAdvertisingOptOut(OptOut targetedAdvertisingOptOut) { + fieldValue(UsCoField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut.value) this } - Builder setTargetedAdvertisingOptOut(Integer targetedAdvertisingOptOut) { - fieldValue(UsCoField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut) - this - } - - Builder setSensitiveDataProcessing(UsColoradoSensitiveData sensitiveDataProcessing) { + Builder setSensitiveDataProcessing(UsColoradoV1SensitiveData sensitiveDataProcessing) { fieldValue(UsCoField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) this } - Builder setKnownChildSensitiveDataConsents(Integer knownChildSensitiveDataConsents) { - fieldValue(UsCoField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, knownChildSensitiveDataConsents) + Builder setKnownChildSensitiveDataConsents(UsColoradoV1ChildSensitiveData sensitiveData) { + fieldValue(UsCoField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, sensitiveData.contentList) this } - Builder setMspaCoveredTransaction(Integer mspaCoveredTransaction) { - fieldValue(UsCoField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction) + Builder setMspaCoveredTransaction(MspaMode mspaCoveredTransaction) { + fieldValue(UsCoField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction.value) this } - Builder setMspaOptOutOptionMode(Integer mspaOptOutOptionMode) { - fieldValue(UsCoField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode) + Builder setMspaOptOutOptionMode(MspaMode mspaOptOutOptionMode) { + fieldValue(UsCoField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode.value) this } - Builder setMspaServiceProviderMode(Integer mspaServiceProviderMode) { - fieldValue(UsCoField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode) + Builder setMspaServiceProviderMode(MspaMode mspaServiceProviderMode) { + fieldValue(UsCoField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode.value) this } @@ -82,7 +82,7 @@ class UsCoV1Consent extends GppConsent { this } - Builder setGpcSegmentIncluded(Integer gpcSegmentIncluded) { + Builder setGpcSegmentIncluded(Boolean gpcSegmentIncluded) { fieldValue(UsCoField.GPC_SEGMENT_INCLUDED, gpcSegmentIncluded) this } diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCtV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCtV1Consent.groovy new file mode 100644 index 00000000000..5f832b08d1e --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCtV1Consent.groovy @@ -0,0 +1,100 @@ +package org.prebid.server.functional.util.privacy.gpp.v1 + +import com.iab.gpp.encoder.field.UsCtField +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsConnecticutV1ChildSensitiveData +import org.prebid.server.functional.util.privacy.gpp.GppConsent +import org.prebid.server.functional.model.privacy.gpp.UsConnecticutV1SensitiveData + +class UsCtV1Consent extends GppConsent { + + private static final Section SECTION = Section.US_CT_V1 + + protected UsCtV1Consent(Section section, Map fieldValues) { + super(section, fieldValues) + } + + @Override + protected String encodeSection() { + gppModel.encodeSection(SECTION.name) + } + + static class Builder extends GppConsent.Builder { + + Builder() { + super(SECTION) + } + + Builder setSharingNotice(Notice sharingNotice) { + fieldValue(UsCtField.SHARING_NOTICE, sharingNotice.value) + this + } + + Builder setSaleOptOutNotice(Notice saleOptOutNotice) { + fieldValue(UsCtField.SALE_OPT_OUT_NOTICE, saleOptOutNotice.value) + this + } + + Builder setTargetedAdvertisingOptOutNotice(Notice targetedAdvertisingOptOutNotice) { + fieldValue(UsCtField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice.value) + this + } + + Builder setSaleOptOut(OptOut saleOptOut) { + fieldValue(UsCtField.SALE_OPT_OUT, saleOptOut.value) + this + } + + Builder setTargetedAdvertisingOptOut(OptOut targetedAdvertisingOptOut) { + fieldValue(UsCtField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut.value) + this + } + + Builder setSensitiveDataProcessing(UsConnecticutV1SensitiveData sensitiveDataProcessing) { + fieldValue(UsCtV1Field.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) + this + } + + Builder setKnownChildSensitiveDataConsents(UsConnecticutV1ChildSensitiveData sensitiveData) { + fieldValue(UsCtField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, sensitiveData.contentList) + this + } + + Builder setMspaCoveredTransaction(MspaMode mspaCoveredTransaction) { + fieldValue(UsCtField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction.value) + this + } + + Builder setMspaOptOutOptionMode(MspaMode mspaOptOutOptionMode) { + fieldValue(UsCtField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode.value) + this + } + + Builder setMspaServiceProviderMode(MspaMode mspaServiceProviderMode) { + fieldValue(UsCtField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode.value) + this + } + + Builder setGpcSegmentType(Integer gpcSegmentType) { + fieldValue(UsCtField.GPC_SEGMENT_TYPE, gpcSegmentType) + this + } + + Builder setGpcSegmentIncluded(Boolean gpcSegmentIncluded) { + fieldValue(UsCtField.GPC_SEGMENT_INCLUDED, gpcSegmentIncluded) + this + } + + Builder setGpc(Boolean gpc) { + fieldValue(UsCtField.GPC, gpc) + this + } + + @Override + GppConsent build() { + return new UsCtV1Consent(section, fieldValues) + } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsNatV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsNatV1Consent.groovy new file mode 100644 index 00000000000..eaa1a49c333 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsNatV1Consent.groovy @@ -0,0 +1,127 @@ +package org.prebid.server.functional.util.privacy.gpp.v1 + +import com.iab.gpp.encoder.field.UsNatField +import org.prebid.server.functional.model.privacy.gpp.GpcSubsectionType +import org.prebid.server.functional.model.privacy.gpp.GppDataActivity +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1ChildSensitiveData +import org.prebid.server.functional.util.privacy.gpp.GppConsent +import org.prebid.server.functional.model.privacy.gpp.UsNationalV1SensitiveData + +class UsNatV1Consent extends GppConsent { + + private static final Section SECTION = Section.US_NAT_V1 + + protected UsNatV1Consent(Section section, Map fieldValues) { + super(section, fieldValues) + } + + @Override + protected String encodeSection() { + gppModel.encodeSection(SECTION.name) + } + + static class Builder extends GppConsent.Builder { + + Builder() { + super(SECTION) + } + + Builder setSharingNotice(Notice sharingNotice) { + fieldValue(UsNatField.SHARING_NOTICE, sharingNotice.value) + this + } + + Builder setSaleOptOutNotice(Notice saleOptOutNotice) { + fieldValue(UsNatField.SALE_OPT_OUT_NOTICE, saleOptOutNotice.value) + this + } + + Builder setSharingOptOutNotice(Notice sharingOptOutNotice) { + fieldValue(UsNatField.SHARING_OPT_OUT_NOTICE, sharingOptOutNotice.value) + this + } + + Builder setTargetedAdvertisingOptOutNotice(Notice targetedAdvertisingOptOutNotice) { + fieldValue(UsNatField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice.value) + this + } + + Builder setSensitiveDataProcessingOptOutNotice(Notice sensitiveDataProcessingOptOutNotice) { + fieldValue(UsNatField.SENSITIVE_DATA_PROCESSING_OPT_OUT_NOTICE, sensitiveDataProcessingOptOutNotice.value) + this + } + + Builder setSensitiveDataLimitUseNotice(Notice sensitiveDataLimitUseNotice) { + fieldValue(UsNatField.SENSITIVE_DATA_LIMIT_USE_NOTICE, sensitiveDataLimitUseNotice.value) + this + } + + Builder setSaleOptOut(OptOut saleOptOut) { + fieldValue(UsNatField.SALE_OPT_OUT, saleOptOut.value) + this + } + + Builder setSharingOptOut(OptOut sharingOptOut) { + fieldValue(UsNatField.SHARING_OPT_OUT, sharingOptOut.value) + this + } + + Builder setTargetedAdvertisingOptOut(OptOut targetedAdvertisingOptOut) { + fieldValue(UsNatField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut.value) + this + } + + Builder setSensitiveDataProcessing(UsNationalV1SensitiveData sensitiveDataProcessing) { + fieldValue(UsNatField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) + this + } + + Builder setPersonalDataConsents(GppDataActivity personalDataConsents) { + fieldValue(UsNatField.PERSONAL_DATA_CONSENTS, personalDataConsents.value) + this + } + + Builder setKnownChildSensitiveDataConsents(UsNationalV1ChildSensitiveData sensitiveData) { + fieldValue(UsNatField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, sensitiveData.contentList) + this + } + + Builder setMspaCoveredTransaction(MspaMode mspaCoveredTransaction) { + fieldValue(UsNatField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction.value) + this + } + + Builder setMspaOptOutOptionMode(MspaMode mspaOptOutOptionMode) { + fieldValue(UsNatField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode.value) + this + } + + Builder setMspaServiceProviderMode(MspaMode mspaServiceProviderMode) { + fieldValue(UsNatField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode.value) + this + } + + Builder setGpcSegmentType(GpcSubsectionType gpcSegmentType) { + fieldValue(UsNatField.GPC_SEGMENT_TYPE, gpcSegmentType.value) + this + } + + Builder setGpcSegmentIncluded(Boolean gpcSegmentIncluded) { + fieldValue(UsNatField.GPC_SEGMENT_INCLUDED, gpcSegmentIncluded) + this + } + + Builder setGpc(Boolean gpc) { + fieldValue(UsNatField.GPC, gpc) + this + } + + @Override + GppConsent build() { + new UsNatV1Consent(section, fieldValues) + } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsUtV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsUtV1Consent.groovy new file mode 100644 index 00000000000..8b8dde2ad02 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsUtV1Consent.groovy @@ -0,0 +1,90 @@ +package org.prebid.server.functional.util.privacy.gpp.v1 + +import com.iab.gpp.encoder.field.UsUtField +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1ChildSensitiveData +import org.prebid.server.functional.util.privacy.gpp.GppConsent +import org.prebid.server.functional.model.privacy.gpp.UsUtahV1SensitiveData + +class UsUtV1Consent extends GppConsent { + + private static final Section SECTION = Section.US_UT_V1 + + protected UsUtV1Consent(Section section, Map fieldValues) { + super(section, fieldValues) + } + + @Override + protected String encodeSection() { + gppModel.encodeSection(SECTION.name) + } + + static class Builder extends GppConsent.Builder { + + Builder() { + super(SECTION) + } + + Builder setSharingNotice(Notice sharingNotice) { + fieldValue(UsUtField.SHARING_NOTICE, sharingNotice.value) + this + } + + Builder setSaleOptOutNotice(Notice saleOptOutNotice) { + fieldValue(UsUtField.SALE_OPT_OUT_NOTICE, saleOptOutNotice.value) + this + } + + Builder setTargetedAdvertisingOptOutNotice(Notice targetedAdvertisingOptOutNotice) { + fieldValue(UsUtField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice.value) + this + } + + Builder setSensitiveDataProcessingOptOutNotice(Notice sensitiveDataProcessingOptOutNotice) { + fieldValue(UsUtField.SENSITIVE_DATA_PROCESSING_OPT_OUT_NOTICE, sensitiveDataProcessingOptOutNotice.value) + this + } + + Builder setSaleOptOut(OptOut saleOptOut) { + fieldValue(UsUtField.SALE_OPT_OUT, saleOptOut.value) + this + } + + Builder setTargetedAdvertisingOptOut(OptOut targetedAdvertisingOptOut) { + fieldValue(UsUtField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut.value) + this + } + + Builder setSensitiveDataProcessing(UsUtahV1SensitiveData sensitiveDataProcessing) { + fieldValue(UsUtField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) + this + } + + Builder setKnownChildSensitiveDataConsents(UsUtahV1ChildSensitiveData knownChildSensitiveDataConsents) { + fieldValue(UsUtField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, knownChildSensitiveDataConsents.contentList) + this + } + + Builder setMspaCoveredTransaction(MspaMode mspaCoveredTransaction) { + fieldValue(UsUtField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction.value) + this + } + + Builder setMspaOptOutOptionMode(MspaMode mspaOptOutOptionMode) { + fieldValue(UsUtField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode.value) + this + } + + Builder setMspaServiceProviderMode(MspaMode mspaServiceProviderMode) { + fieldValue(UsUtField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode.value) + this + } + + @Override + GppConsent build() { + return new UsUtV1Consent(section, fieldValues) + } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsVaV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsVaV1Consent.groovy new file mode 100644 index 00000000000..596bcbf1da0 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsVaV1Consent.groovy @@ -0,0 +1,85 @@ +package org.prebid.server.functional.util.privacy.gpp.v1 + +import com.iab.gpp.encoder.field.UsVaField +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsVirginiaV1ChildSensitiveData +import org.prebid.server.functional.util.privacy.gpp.GppConsent +import org.prebid.server.functional.model.privacy.gpp.UsVirginiaV1SensitiveData + +class UsVaV1Consent extends GppConsent { + + private static final Section SECTION = Section.US_VA_V1 + + protected UsVaV1Consent(Section section, Map fieldValues) { + super(section, fieldValues) + } + + @Override + protected String encodeSection() { + gppModel.encodeSection(SECTION.name) + } + + static class Builder extends GppConsent.Builder { + + Builder() { + super(SECTION) + } + + Builder setSharingNotice(Notice sharingNotice) { + fieldValue(UsVaField.SHARING_NOTICE, sharingNotice.value) + this + } + + Builder setSaleOptOutNotice(Notice saleOptOutNotice) { + fieldValue(UsVaField.SALE_OPT_OUT_NOTICE, saleOptOutNotice.value) + this + } + + Builder setTargetedAdvertisingOptOutNotice(Notice targetedAdvertisingOptOutNotice) { + fieldValue(UsVaField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice.value) + this + } + + Builder setSaleOptOut(OptOut saleOptOut) { + fieldValue(UsVaField.SALE_OPT_OUT, saleOptOut.value) + this + } + + Builder setTargetedAdvertisingOptOut(OptOut targetedAdvertisingOptOut) { + fieldValue(UsVaField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut.value) + this + } + + Builder setSensitiveDataProcessing(UsVirginiaV1SensitiveData sensitiveDataProcessing) { + fieldValue(UsVaField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) + this + } + + Builder setKnownChildSensitiveDataConsents(UsVirginiaV1ChildSensitiveData childSensitiveDataConsents) { + fieldValue(UsVaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, childSensitiveDataConsents.contentList) + this + } + + Builder setMspaCoveredTransaction(MspaMode mspaCoveredTransaction) { + fieldValue(UsVaField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction.value) + this + } + + Builder setMspaOptOutOptionMode(MspaMode mspaOptOutOptionMode) { + fieldValue(UsVaField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode.value) + this + } + + Builder setMspaServiceProviderMode(MspaMode mspaServiceProviderMode) { + fieldValue(UsVaField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode.value) + this + } + + @Override + GppConsent build() { + return new UsVaV1Consent(section, fieldValues) + } + } +} diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsV1Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UspV1Consent.groovy similarity index 70% rename from src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsV1Consent.groovy rename to src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UspV1Consent.groovy index e3a0682ca73..f76b95a4af4 100644 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsV1Consent.groovy +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UspV1Consent.groovy @@ -1,10 +1,11 @@ -package org.prebid.server.functional.util.privacy.gpp +package org.prebid.server.functional.util.privacy.gpp.v1 import com.iab.gpp.encoder.field.UspV1Field +import org.prebid.server.functional.util.privacy.gpp.GppConsent -class UsV1Consent extends GppConsent { +class UspV1Consent extends GppConsent { - protected UsV1Consent(Section section, Map fieldValues) { + protected UspV1Consent(Section section, Map fieldValues) { super(section, fieldValues) } @@ -35,8 +36,8 @@ class UsV1Consent extends GppConsent { } @Override - UsV1Consent build() { - new UsV1Consent(section, fieldValues) + UspV1Consent build() { + new UspV1Consent(section, fieldValues) } } } diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/TcfEuV2Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v2/TcfEuV2Consent.groovy similarity index 92% rename from src/test/groovy/org/prebid/server/functional/util/privacy/gpp/TcfEuV2Consent.groovy rename to src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v2/TcfEuV2Consent.groovy index f37531563e0..fe72ec0d773 100644 --- a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/TcfEuV2Consent.groovy +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v2/TcfEuV2Consent.groovy @@ -1,6 +1,7 @@ -package org.prebid.server.functional.util.privacy.gpp +package org.prebid.server.functional.util.privacy.gpp.v2 import com.iab.gpp.encoder.field.TcfEuV2Field +import org.prebid.server.functional.util.privacy.gpp.GppConsent class TcfEuV2Consent extends GppConsent { diff --git a/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v2/UsNatV2Consent.groovy b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v2/UsNatV2Consent.groovy new file mode 100644 index 00000000000..8deb55fb3a0 --- /dev/null +++ b/src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v2/UsNatV2Consent.groovy @@ -0,0 +1,127 @@ +package org.prebid.server.functional.util.privacy.gpp.v2 + +import com.iab.gpp.encoder.field.UsNatField +import org.prebid.server.functional.model.privacy.gpp.GpcSubsectionType +import org.prebid.server.functional.model.privacy.gpp.GppDataActivity +import org.prebid.server.functional.model.privacy.gpp.MspaMode +import org.prebid.server.functional.model.privacy.gpp.Notice +import org.prebid.server.functional.model.privacy.gpp.OptOut +import org.prebid.server.functional.model.privacy.gpp.UsNationalV2ChildSensitiveData +import org.prebid.server.functional.model.privacy.gpp.UsNationalV2SensitiveData +import org.prebid.server.functional.util.privacy.gpp.GppConsent + +class UsNatV2Consent extends GppConsent { + + private static final Section SECTION = Section.US_NAT_V2 + + protected UsNatV2Consent(Section section, Map fieldValues) { + super(section, fieldValues) + } + + @Override + protected String encodeSection() { + gppModel.encodeSection(SECTION.name) + } + + static class Builder extends GppConsent.Builder { + + Builder() { + super(SECTION) + } + + Builder setSharingNotice(Notice sharingNotice) { + fieldValue(UsNatField.SHARING_NOTICE, sharingNotice.value) + this + } + + Builder setSaleOptOutNotice(Notice saleOptOutNotice) { + fieldValue(UsNatField.SALE_OPT_OUT_NOTICE, saleOptOutNotice.value) + this + } + + Builder setSharingOptOutNotice(Notice sharingOptOutNotice) { + fieldValue(UsNatField.SHARING_OPT_OUT_NOTICE, sharingOptOutNotice.value) + this + } + + Builder setTargetedAdvertisingOptOutNotice(Notice targetedAdvertisingOptOutNotice) { + fieldValue(UsNatField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, targetedAdvertisingOptOutNotice.value) + this + } + + Builder setSensitiveDataProcessingOptOutNotice(Notice sensitiveDataProcessingOptOutNotice) { + fieldValue(UsNatField.SENSITIVE_DATA_PROCESSING_OPT_OUT_NOTICE, sensitiveDataProcessingOptOutNotice.value) + this + } + + Builder setSensitiveDataLimitUseNotice(Notice sensitiveDataLimitUseNotice) { + fieldValue(UsNatField.SENSITIVE_DATA_LIMIT_USE_NOTICE, sensitiveDataLimitUseNotice.value) + this + } + + Builder setSaleOptOut(OptOut saleOptOut) { + fieldValue(UsNatField.SALE_OPT_OUT, saleOptOut.value) + this + } + + Builder setSharingOptOut(OptOut sharingOptOut) { + fieldValue(UsNatField.SHARING_OPT_OUT, sharingOptOut.value) + this + } + + Builder setTargetedAdvertisingOptOut(OptOut targetedAdvertisingOptOut) { + fieldValue(UsNatField.TARGETED_ADVERTISING_OPT_OUT, targetedAdvertisingOptOut.value) + this + } + + Builder setSensitiveDataProcessing(UsNationalV2SensitiveData sensitiveDataProcessing) { + fieldValue(UsNatField.SENSITIVE_DATA_PROCESSING, sensitiveDataProcessing.contentList) + this + } + + Builder setPersonalDataConsents(GppDataActivity personalDataConsents) { + fieldValue(UsNatField.PERSONAL_DATA_CONSENTS, personalDataConsents.value) + this + } + + Builder setKnownChildSensitiveDataConsents(UsNationalV2ChildSensitiveData childSensitiveData) { + fieldValue(UsNatField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, childSensitiveData.contentList) + this + } + + Builder setMspaCoveredTransaction(MspaMode mspaCoveredTransaction) { + fieldValue(UsNatField.MSPA_COVERED_TRANSACTION, mspaCoveredTransaction.value) + this + } + + Builder setMspaOptOutOptionMode(MspaMode mspaOptOutOptionMode) { + fieldValue(UsNatField.MSPA_OPT_OUT_OPTION_MODE, mspaOptOutOptionMode.value) + this + } + + Builder setMspaServiceProviderMode(MspaMode mspaServiceProviderMode) { + fieldValue(UsNatField.MSPA_SERVICE_PROVIDER_MODE, mspaServiceProviderMode.value) + this + } + + Builder setGpcSegmentType(GpcSubsectionType gpcSegmentType) { + fieldValue(UsNatField.GPC_SEGMENT_TYPE, gpcSegmentType.value) + this + } + + Builder setGpcSegmentIncluded(Boolean gpcSegmentIncluded) { + fieldValue(UsNatField.GPC_SEGMENT_INCLUDED, gpcSegmentIncluded) + this + } + + Builder setGpc(Boolean gpc) { + fieldValue(UsNatField.GPC, gpc) + this + } + + @Override + GppConsent build() { + new UsNatV2Consent(section, fieldValues) + } + } +} diff --git a/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUserTest.java b/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUserTest.java index 257c16c9a19..ab74148f50b 100644 --- a/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUserTest.java +++ b/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUserTest.java @@ -232,6 +232,19 @@ public void proceedShouldDisallowIfKnownChildSensitiveDataConsents2Equals2() { assertThat(result).isEqualTo(Rule.Result.DISALLOW); } + @Test + public void proceedShouldDisallowIfKnownChildSensitiveDataConsents3Equals1() { + // given + given(gppReader.getKnownChildSensitiveDataConsents()).willReturn(asList(3, 3, 1)); + final PrivacyModule target = new USNatSyncUser(gppReader, null); + + // when + final Rule.Result result = target.proceed(null); + + // then + assertThat(result).isEqualTo(Rule.Result.DISALLOW); + } + @Test public void proceedShouldDisallowIfPersonalDataConsentsEquals2() { // given diff --git a/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeoTest.java b/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeoTest.java index 2ce82b76370..93f8c5b799a 100644 --- a/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeoTest.java +++ b/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeoTest.java @@ -154,6 +154,19 @@ public void proceedShouldDisallowIfKnownChildSensitiveDataConsents2Equals2() { assertThat(result).isEqualTo(Rule.Result.DISALLOW); } + @Test + public void proceedShouldDisallowIfKnownChildSensitiveDataConsents3Equals1() { + // given + given(gppReader.getKnownChildSensitiveDataConsents()).willReturn(asList(3, 3, 1)); + final PrivacyModule target = new USNatTransmitGeo(gppReader, null); + + // when + final Rule.Result result = target.proceed(null); + + // then + assertThat(result).isEqualTo(Rule.Result.DISALLOW); + } + @Test public void proceedShouldDisallowIfPersonalDataConsentsEquals2() { // given diff --git a/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpdTest.java b/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpdTest.java index fe475d52989..d2be23a5d9e 100644 --- a/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpdTest.java +++ b/src/test/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpdTest.java @@ -210,11 +210,11 @@ public void proceedShouldDisallowIfSensitiveDataProcessingOptOutNoticeEquals2() @Test public void proceedShouldDisallowIfSensitiveDataProcessingOptOutNoticeEquals0AndOnCertainSensitiveDataProcessing() { - for (int i : Set.of(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11)) { + for (int i : Set.of(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15)) { // given given(gppReader.getSensitiveDataProcessingOptOutNotice()).willReturn(0); - final ArrayList data = new ArrayList<>(asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + final ArrayList data = new ArrayList<>(asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); data.remove(i); data.add(i, 2); given(gppReader.getSensitiveDataProcessing()).willReturn(data); @@ -231,11 +231,11 @@ public void proceedShouldDisallowIfSensitiveDataProcessingOptOutNoticeEquals0And @Test public void proceedShouldDisallowIfSensitiveDataLimitUseNoticeEquals0AndOnCertainSensitiveDataProcessing() { - for (int i : Set.of(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11)) { + for (int i : Set.of(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15)) { // given given(gppReader.getSensitiveDataLimitUseNotice()).willReturn(0); - final ArrayList data = new ArrayList<>(asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + final ArrayList data = new ArrayList<>(asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); data.remove(i); data.add(i, 2); given(gppReader.getSensitiveDataProcessing()).willReturn(data); @@ -252,9 +252,9 @@ public void proceedShouldDisallowIfSensitiveDataLimitUseNoticeEquals0AndOnCertai @Test public void proceedShouldDisallowIfSensitiveDataProcessingAtCertainIndicesEquals1() { - for (int i : Set.of(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11)) { + for (int i : Set.of(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15)) { // given - final ArrayList data = new ArrayList<>(asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + final ArrayList data = new ArrayList<>(asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); data.remove(i); data.add(i, 1); given(gppReader.getSensitiveDataProcessing()).willReturn(data); @@ -271,9 +271,9 @@ public void proceedShouldDisallowIfSensitiveDataProcessingAtCertainIndicesEquals @Test public void proceedShouldDisallowIfSensitiveDataProcessingAtCertainIndicesEquals2() { - for (int i : Set.of(5, 6, 8, 9, 11)) { + for (int i : Set.of(5, 6, 8, 9, 11, 13, 15)) { // given - final ArrayList data = new ArrayList<>(asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + final ArrayList data = new ArrayList<>(asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); data.remove(i); data.add(i, 2); given(gppReader.getSensitiveDataProcessing()).willReturn(data); @@ -314,6 +314,19 @@ public void proceedShouldDisallowIfKnownChildSensitiveDataConsents2NotEquals0() assertThat(result).isEqualTo(Rule.Result.DISALLOW); } + @Test + public void proceedShouldDisallowIfKnownChildSensitiveDataConsents3Equals1() { + // given + given(gppReader.getKnownChildSensitiveDataConsents()).willReturn(asList(3, 3, 1)); + final PrivacyModule target = new USNatTransmitUfpd(gppReader, null); + + // when + final Rule.Result result = target.proceed(null); + + // then + assertThat(result).isEqualTo(Rule.Result.DISALLOW); + } + @Test public void proceedShouldDisallowIfPersonalDataConsentsEquals2() { // given