-
Notifications
You must be signed in to change notification settings - Fork 18
Remove SF1 (precise geolocation) consent validation for EUID #2338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,17 @@ | |
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import com.iabtcf.encoder.TCStringEncoder; | ||
| import com.iabtcf.utils.BitSetIntIterable; | ||
| import com.uid2.operator.model.IdentityScope; | ||
| import com.uid2.shared.auth.Role; | ||
|
|
||
| import io.vertx.core.Vertx; | ||
| import io.vertx.core.json.JsonObject; | ||
| import io.vertx.junit5.VertxTestContext; | ||
|
|
||
| import java.time.Instant; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| class EUIDOperatorVerticleTest extends UIDOperatorVerticleTest { | ||
|
|
@@ -75,5 +79,54 @@ void noContentOnInsufficientTcfConsent(Vertx vertx, VertxTestContext testContext | |
| testContext.completeNow(); | ||
| }); | ||
| } | ||
|
|
||
| @Test | ||
| void consentPassesWhenPreciseGeolocationSpecialFeatureIsMissing(Vertx vertx, VertxTestContext testContext) { | ||
| final int clientSiteId = 201; | ||
| fakeAuth(clientSiteId, Role.GENERATOR); | ||
| setupSalts(); | ||
| setupKeys(); | ||
|
|
||
| final String emailAddress = "test@uid2.com"; | ||
| final JsonObject v2Payload = new JsonObject(); | ||
| v2Payload.put("email", emailAddress); | ||
| // TCF string with all required purposes but WITHOUT PreciseGeolocation special feature (feature 1) | ||
| String tcfStringWithoutPreciseGeolocation = createTcfConsentString( | ||
| new int[] { 21 }, // vendor consent | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: Is it possible to rewrite this without needing Only worthwhile if we don't have to include unrelated fields such as version().
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm i'll leave it for now |
||
| new int[] { 21 }, // vendor LI | ||
| new int[] { 1, 3, 4 }, // purpose consents (1, 3, 4) | ||
| new int[] { 2, 7, 10 }, // purpose LI (2, 7, 10) | ||
| new int[] {} // NO special features - PreciseGeolocation (1) is missing | ||
| ); | ||
| v2Payload.put("tcf_consent_string", tcfStringWithoutPreciseGeolocation); | ||
| sendTokenGenerate(vertx, v2Payload, 200, json -> { | ||
| assertTrue(json.containsKey("body")); | ||
| assertEquals("success", json.getString("status")); | ||
| testContext.completeNow(); | ||
| }); | ||
| } | ||
|
|
||
| private String createTcfConsentString(int[] vendorConsent, int[] vendorLI, int[] purposesConsent, int[] purposesLI, int[] specialFeatureOptIns) { | ||
| return TCStringEncoder.newBuilder() | ||
| .version(2) | ||
| .created(Instant.now()) | ||
| .lastUpdated(Instant.now()) | ||
| .cmpId(1) | ||
| .cmpVersion(12) | ||
| .consentScreen(1) | ||
| .consentLanguage("FR") | ||
| .vendorListVersion(2) | ||
| .tcfPolicyVersion(1) | ||
| .isServiceSpecific(true) | ||
| .useNonStandardStacks(false) | ||
| .addSpecialFeatureOptIns(BitSetIntIterable.from(specialFeatureOptIns)) | ||
| .publisherCC("DE") | ||
| .addVendorConsent(BitSetIntIterable.from(vendorConsent)) | ||
| .addVendorLegitimateInterest(BitSetIntIterable.from(vendorLI)) | ||
| .purposeOneTreatment(true) | ||
| .addPurposesConsent(BitSetIntIterable.from(purposesConsent)) | ||
| .addPurposesLITransparency(BitSetIntIterable.from(purposesLI)) | ||
| .encode(); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like
TransparentConsentSpecialFeatureis no longer used, should we remove it or remove the values it has currently?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok removed