File tree Expand file tree Collapse file tree
main/java/org/prebid/server/privacy/gdpr
test/java/org/prebid/server/privacy/gdpr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public DisclosedVendorsStrictness(GdprConfig gdprConfig) {
2424
2525 public boolean isValid (TCString consent ) {
2626 return !strictnessEnabled
27+ || consent .getVersion () == 1
2728 || isCreatedBeforeTcfV2M3EnforcementCutoff (consent )
2829 || !consent .getDisclosedVendors ().isEmpty ();
2930 }
@@ -38,6 +39,7 @@ private boolean isCreatedBeforeTcfV2M3EnforcementCutoff(TCString consent) {
3839
3940 public boolean isVendorDisclosed (TCString consent , Integer vendorId ) {
4041 return !strictnessEnabled
42+ || consent .getVersion () == 1
4143 || (vendorId != null
4244 && (isCreatedBeforeTcfV2M3EnforcementCutoff (consent )
4345 || consent .getDisclosedVendors ().contains (vendorId )));
Original file line number Diff line number Diff line change @@ -52,6 +52,17 @@ public void isValidShouldReturnFalseIfStrictnessEnabledByDefault() {
5252 assertThat (target .isValid (tcString )).isFalse ();
5353 }
5454
55+ @ Test
56+ public void isValidShouldReturnTrueIfTCStringVersionEquals1 () {
57+ // given
58+ final TCString tcString = TCStringEncoder .newBuilder ()
59+ .version (1 )
60+ .toTCString ();
61+
62+ // when and then
63+ assertThat (target .isValid (tcString )).isTrue ();
64+ }
65+
5566 @ Test
5667 public void isValidShouldReturnTrueOnInvalidIfLatestUpdateBeforeCutoffDate () {
5768 // given
@@ -125,6 +136,17 @@ public void isVendorDisclosedShouldReturnFalseOnNull() {
125136 assertThat (target .isVendorDisclosed (tcString , null )).isFalse ();
126137 }
127138
139+ @ Test
140+ public void isVendorDisclosedShouldReturnTrueIfTCStringVersionEquals1 () {
141+ // given
142+ final TCString tcString = TCStringEncoder .newBuilder ()
143+ .version (1 )
144+ .toTCString ();
145+
146+ // when and then
147+ assertThat (target .isVendorDisclosed (tcString , 1 )).isTrue ();
148+ }
149+
128150 @ Test
129151 public void isVendorDisclosedShouldReturnTrueOnNotDisclosedIfLatestUpdateBeforeCutoffDate () {
130152 // given
You can’t perform that action at this time.
0 commit comments