Skip to content

Commit 871d16d

Browse files
Core: Support GPP USNat v2 (#3690)
1 parent c2b3077 commit 871d16d

56 files changed

Lines changed: 2628 additions & 1995 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatSyncUser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ private static boolean checkKnownChildSensitiveDataConsents(USNatGppReader gppRe
8989

9090
return equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 0)
9191
|| equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 1)
92+
|| equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 2)
9293
|| equalsAtIndex(KnownChildSensitiveDataConsent.CONSENT, knownChildSensitiveDataConsents, 1);
9394
}
9495

src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitGeo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ private static boolean checkKnownChildSensitiveDataConsents(USNatGppReader gppRe
6262

6363
return equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 0)
6464
|| equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 1)
65+
|| equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 2)
6566
|| equalsAtIndex(KnownChildSensitiveDataConsent.CONSENT, knownChildSensitiveDataConsents, 1);
6667
}
6768

src/main/java/org/prebid/server/activity/infrastructure/privacy/usnat/inner/USNatTransmitUfpd.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030

3131
public class USNatTransmitUfpd implements PrivacyModule, Loggable {
3232

33-
private static final Set<Integer> SENSITIVE_DATA_INDICES_SET_1 = Set.of(0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11);
34-
private static final Set<Integer> SENSITIVE_DATA_INDICES_SET_2 = Set.of(0, 1, 2, 3, 4, 10);
35-
private static final Set<Integer> SENSITIVE_DATA_INDICES_SET_3 = Set.of(5, 6, 8, 9, 11);
33+
private static final Set<Integer> SENSITIVE_DATA_INDICES_SET_1 = Set.of(
34+
0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15);
35+
private static final Set<Integer> SENSITIVE_DATA_INDICES_SET_2 = Set.of(0, 1, 2, 3, 4, 10, 12, 14);
36+
private static final Set<Integer> SENSITIVE_DATA_INDICES_SET_3 = Set.of(5, 6, 8, 9, 11, 13, 15);
3637

3738
private final USNatGppReader gppReader;
3839
private final Result result;
@@ -125,6 +126,7 @@ private static boolean checkKnownChildSensitiveDataConsents(USNatGppReader gppRe
125126

126127
return equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 0)
127128
|| equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 1)
129+
|| equalsAtIndex(KnownChildSensitiveDataConsent.NO_CONSENT, knownChildSensitiveDataConsents, 2)
128130
|| equalsAtIndex(KnownChildSensitiveDataConsent.CONSENT, knownChildSensitiveDataConsents, 1);
129131
}
130132

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum GpcSubsectionType {
6+
7+
CORE(0),
8+
GPC(1)
9+
10+
@JsonValue
11+
final int value
12+
13+
GpcSubsectionType(int value) {
14+
this.value = value
15+
}
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum GppDataActivity {
6+
7+
NOT_APPLICABLE(0),
8+
NO_CONSENT(1),
9+
CONSENT(2)
10+
11+
@JsonValue
12+
final int value
13+
14+
GppDataActivity(int value) {
15+
this.value = value
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum MspaMode {
6+
7+
NOT_APPLICABLE(0),
8+
YES(1),
9+
NO(2)
10+
11+
@JsonValue
12+
final int value
13+
14+
MspaMode(int value) {
15+
this.value = value
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum Notice {
6+
7+
NOT_APPLICABLE(0),
8+
PROVIDED(1),
9+
NOT_PROVIDED(2)
10+
11+
@JsonValue
12+
final int value
13+
14+
Notice(int value) {
15+
this.value = value
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum OptOut {
6+
7+
NOT_APPLICABLE(0),
8+
OPTED_OUT(1),
9+
DID_NOT_OPT_OUT(2)
10+
11+
@JsonValue
12+
final int value
13+
14+
OptOut(int value) {
15+
this.value = value
16+
}
17+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import org.prebid.server.functional.util.PBSUtils
4+
5+
class UsCaliforniaV1ChildSensitiveData {
6+
7+
GppDataActivity childUnder13
8+
GppDataActivity childFrom13to16
9+
10+
static UsCaliforniaV1ChildSensitiveData getDefault(GppDataActivity childUnder13 = GppDataActivity.NOT_APPLICABLE,
11+
GppDataActivity childFrom13to16 = GppDataActivity.NOT_APPLICABLE) {
12+
13+
new UsCaliforniaV1ChildSensitiveData().tap {
14+
it.childUnder13 = childUnder13
15+
it.childFrom13to16 = childFrom13to16
16+
}
17+
}
18+
19+
static UsCaliforniaV1ChildSensitiveData getRandom(List<GppDataActivity> excludedActivities) {
20+
new UsCaliforniaV1ChildSensitiveData().tap {
21+
it.childUnder13 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities)
22+
it.childFrom13to16 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities)
23+
}
24+
}
25+
26+
List<Integer> getContentList() {
27+
[childFrom13to16, childUnder13]*.value.collect { it ?: 0 }
28+
}
29+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
class UsCaliforniaV1SensitiveData {
4+
5+
GppDataActivity idNumbers
6+
GppDataActivity accountInfo
7+
GppDataActivity geolocation
8+
GppDataActivity racialEthnicOrigin
9+
GppDataActivity communicationContents
10+
GppDataActivity geneticId
11+
GppDataActivity biometricId
12+
GppDataActivity healthInfo
13+
GppDataActivity orientation
14+
15+
List<Integer> getContentList() {
16+
[idNumbers, accountInfo, geolocation, racialEthnicOrigin,
17+
communicationContents, geneticId, biometricId, healthInfo, orientation]*.value.collect { it ?: 0 }
18+
}
19+
}

0 commit comments

Comments
 (0)