Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
30bb470
Merge pull request #1 from chuff/master
iabmayank Sep 27, 2022
1d54624
Merge pull request #2 from chuff/master
iabmayank Sep 28, 2022
7d2bf67
Merge pull request #3 from chuff/master
iabmayank Oct 12, 2022
85c03cd
initial multi state implementation
Oct 14, 2022
293e235
multi state
Nov 10, 2022
331b0d4
unit tests
Nov 10, 2022
dec10a5
Merge pull request #4 from chuff/master
iabmayank Nov 14, 2022
55d0573
exposing id based methods in GppModel
Nov 18, 2022
86d6c40
Merge pull request #5 from chuff/master
iabmayank Nov 18, 2022
ded14f1
personal data consents fix, reduce multi state subsection id (#10)
chuff Dec 6, 2022
ecd9ebe
3.0.0 (#11)
chuff Dec 9, 2022
1028adf
fix multi state name, add unit tests (#13)
chuff Dec 13, 2022
569a002
3.0.1 (#14)
chuff Dec 13, 2022
888f6e8
Convenience Methods (#15)
chuff Dec 22, 2022
3b0e704
full list of fields to readme (#16)
chuff Jan 1, 2023
4d08f67
tcfeuv2 backwards compatible (#19)
chuff Jan 10, 2023
1663a06
Update dependencies. Fix bitfield cast. (#20)
chuff Jan 12, 2023
2d39d96
Dedupe and sort lists. Added InvalidFieldError. (#24)
chuff Jan 20, 2023
fe36352
issue 26: wrong version number for TcfCaV1 (#27)
guofangli Aug 29, 2023
b4ce06d
Removes duplicate section in the GppModel.decodeSection if tree as Us…
SuprPhatAnon Aug 29, 2023
58fd339
Updating GVL code as V3 and adding some comments (#32)
chuff Aug 30, 2023
b539634
rename missed multistate usp* methods to us* (#35)
chuff Sep 14, 2023
cafab6a
Adding a new field in Vendor for "impConsPurposes" as the GVL for Can…
srinivas81 Sep 14, 2023
db78746
3.1.1
Sep 14, 2023
9824305
3.1.2-SNAPSHOT
Sep 14, 2023
2b303d1
Version Bump (#38)
chuff Sep 14, 2023
8106a9e
Merge remote-tracking branch 'upstream/master'
Sep 23, 2023
60eb664
lazy decoding (#34)
chuff Apr 9, 2024
a3f62d7
Update README.md (#46)
danielsao Apr 11, 2024
d51c324
Validation (#36)
chuff Apr 15, 2024
3e70a3e
tcfca pub restrictions and disclosed vendors (#39)
chuff Apr 15, 2024
9160114
Merge remote-tracking branch 'upstream/master'
Apr 16, 2024
310ae4d
3.2.0
Apr 16, 2024
cae4e3c
3.2.1-SNAPSHOT
Apr 16, 2024
fcd6061
Versioning (#47)
chuff Apr 16, 2024
c80ab0c
Merge remote-tracking branch 'upstream/master'
Jul 1, 2024
4c113b6
Remove multistate version (#60)
chuff Oct 11, 2024
30fd4e1
Merge branch 'IABTechLab:master' into master
chuff Nov 1, 2024
daffbe9
Post release version bump (#64)
chuff Nov 4, 2024
c4a3214
remove validation
Nov 16, 2024
7d0233a
fix lazy decoding in decodeSection
Nov 19, 2024
6d8bf77
3.2.2
aitsxhxl Mar 17, 2025
408ad34
3.2.3-SNAPSHOT
aitsxhxl Mar 17, 2025
bff6695
Tx fl or mt (#57)
chuff Mar 18, 2025
d3d5017
Update AbstractLazilyEncodableSection.java (#61)
naveenjr7 Mar 18, 2025
f5bc12d
Merge remote-tracking branch 'upstream/master'
Mar 21, 2025
8da3fe6
DE IA NE NH NJ TN MSPA USNAT (#65)
chuff Mar 22, 2025
3403e0c
Merge remote-tracking branch 'upstream/master'
Mar 25, 2025
81e4b04
Merge branch 'master' into remove-validation
chuff Mar 25, 2025
7c1acdd
Merge branch 'remove-validation'
Mar 25, 2025
f6e72f9
Updating CompressedBase64UrlEncoder to match the spec
Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 154 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

Encode/decode consent information with the IAB GPP Framework

https://iabtechlab.com/gpp/

### Usage

#### Maven

The official iabgpp java library is distributed through maven central. Please [search maven central](https://search.maven.org/search?q=g:com.iab.gpp) for the current release version.
The official iabgpp java library is distributed through maven central. Please [search maven central](https://search.maven.org/search?q=g:com.iabgpp) for the current release version.

#### Decoding

```
<dependency>
<groupId>com.iab.gpp</groupId>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-encoder</artifactId>
<version>VERSION</version>
</dependency>
Expand All @@ -25,7 +23,7 @@ import com.iab.gpp.encoder.GppModel;
import com.iab.gpp.encoder.section.TcfEuV2;
import com.iab.gpp.encoder.section.UspV1;

String gppString = "DBACDMA~CPdBusAPdBusANwAAAENAwCAAAAAAAAAAAAAAAAAAAA.QAAA.IAAA~BbA";
String gppString = "DBACNYA~CPSG_8APSG_8ANwAAAENAwCAAAAAAAAAAAAAAAAAAAAA.QAAA.IAAA~1YNN";
GppModel gppModel = new GppModel(gppString);

TcfEuV2 tcfEuV2Section = (TcfEuV2)gppModel.getSection(TcfEuV2.NAME);
Expand All @@ -41,7 +39,7 @@ Integer uspV1Notice = uspV1Section.getNotice();

```
<dependency>
<groupId>com.iab.gpp</groupId>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-encoder</artifactId>
<version>VERSION</version>
</dependency>
Expand Down Expand Up @@ -80,13 +78,13 @@ List respectively. The `iabgpp-extras-jackson` library uses Jackson 2.10.3 to pa

```
<dependency>
<groupId>com.iab.gpp</groupId>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-extras</artifactId>
<version>VERSION</version>
</dependency>

<dependency>
<groupId>com.iab.gpp</groupId>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-extras-jackson</artifactId>
<version>VERSION</version>
</dependency>
Expand Down Expand Up @@ -114,3 +112,151 @@ String cmpListContent = "...";
Loader loader = new Loader();
CmpList cmpList = loader.cmpList(cmpListContent);
```

### Fields

|Section Name|Section ID|Field|Data Type/Value|
|------------|----------|-----|---------------|
|tcfeuv2|2|Version|6 bit int. Value is 2.|
|tcfeuv2|2|Created|Datetime. Updated when fields are set|
|tcfeuv2|2|LastUpdated|Datetime. Updated when fields are set|
|tcfeuv2|2|CmpId|12 bit int|
|tcfeuv2|2|CmpVersion|12 bit int|
|tcfeuv2|2|ConsentScreen|6 bit int|
|tcfeuv2|2|ConsentLanguage|2 character country code|
|tcfeuv2|2|VendorListVersion|12 bit int|
|tcfeuv2|2|PolicyVersion|6 bit int. Value is 2|
|tcfeuv2|2|IsServiceSpecific|Boolean|
|tcfeuv2|2|UseNonStandardStacks|Boolean|
|tcfeuv2|2|SpecialFeatureOptins|Boolean list of size 12|
|tcfeuv2|2|PurposeConsents|Boolean list of size 24|
|tcfeuv2|2|PurposeLegitimateInterests|Boolean list of size 24|
|tcfeuv2|2|PurposeOneTreatment|Boolean|
|tcfeuv2|2|PublisherCountryCode|2 character country code|
|tcfeuv2|2|VendorConsents|Integer list of variable size|
|tcfeuv2|2|VendorLegitimateInterests|Integer list of variable size|
|tcfeuv2|2|PublisherRestrictions|Integer list of variable size|
|tcfeuv2|2|PublisherPurposesSegmentType|3 bit int. Value is 3|
|tcfeuv2|2|PublisherConsents|Boolean list of size 24|
|tcfeuv2|2|PublisherLegitimateInterests|Boolean list of size 24|
|tcfeuv2|2|NumCustomPurposes|6 bit int|
|tcfeuv2|2|PublisherCustomConsents|Boolean list where size is set by the NumCustomPurposes field|
|tcfeuv2|2|PublisherCustomLegitimateInterests|Boolean list where size is set by the NumCustomPurposes field|
|tcfeuv2|2|VendorsAllowedSegmentType|3 bit int. Value is 2|
|tcfeuv2|2|VendorsAllowed|Integer list of variable size|
|tcfeuv2|2|VendorsDisclosedSegmentType|3 bit int. Value is 1|
|tcfeuv2|2|VendorsDisclosed|Integer list of variable size|
|tcfcav1|5|Version|6 bit int. Value is 2.|
|tcfcav1|5|Created|Datetime. Updated when any fields are set|
|tcfcav1|5|LastUpdated|Datetime. Updated when any fields are set|
|tcfcav1|5|CmpId|12 bit int|
|tcfcav1|5|CmpVersion|12 bit int|
|tcfcav1|5|ConsentScreen|6 bit int|
|tcfcav1|5|ConsentLanguage|2 character country code|
|tcfcav1|5|VendorListVersion|12 bit int|
|tcfcav1|5|TcfPolicyVersion|6 bit int. Value is 2.|
|tcfcav1|5|UseNonStandardStacks|Boolean|
|tcfcav1|5|SpecialFeatureExpressConsent|Boolean list of size 12|
|tcfcav1|5|PurposesExpressConsent|Boolean list of size 24|
|tcfcav1|5|PurposesImpliedConsent|Boolean list of size 24|
|tcfcav1|5|VendorExpressConsent|Integer list of variable size|
|tcfcav1|5|VendorImpliedConsent|Integer list of variable size|
|tcfcav1|5|PubRestrictions|RangeEntry list of variable size|
|tcfcav1|5|PubPurposesSegmentType|3 bit int. Value is 3|
|tcfcav1|5|PubPurposesExpressConsent|Boolean list of size 24|
|tcfcav1|5|PubPurposesImpliedConsent|Boolean list of size 24|
|tcfcav1|5|NumCustomPurposes|6 bit int|
|tcfcav1|5|CustomPurposesExpressConsent|Boolean list where size is set by the NumCustomPurposes field|
|tcfcav1|5|CustomPurposesImpliedConsent|Boolean list where size is set by the NumCustomPurposes field|
|tcfcav1|5|DisclosedVendorsSegmentType|3 bit int. Value is 1|
|tcfcav1|5|DisclosedVendors|Integer list of variable size|
|uspv1|6|Version|6 bit int. Value is 1|
|uspv1|6|Notice|2 bit int|
|uspv1|6|OptOutSale|2 bit int|
|uspv1|6|LspaCovered|2 bit int|
|usnat|7|Version|6 bit int. Value is 1|
|usnat|7|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SharingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SensitiveDataProcessingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SensitiveDataLimitUseNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SharingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SensitiveDataProcessing|2 bit int list of size 12. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|KnownChildSensitiveDataConsents|2 bit int list of size 2. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|PersonalDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|GpcSegmentType|2 bit int. Value is 1|
|usnat|7|GpcSegmentIncluded|Boolean. Default value is true|
|usnat|7|Gpc|Boolean|
|usca|8|Version|6 bit int. Value is 1|
|usca|8|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SharingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SensitiveDataLimitUseNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SharingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SensitiveDataProcessing|2 bit int list of size 9. 0=Not applicable, 1=Yes, 2=No|
|usca|8|KnownChildSensitiveDataConsents|2 bit int list of size 2. 0=Not applicable, 1=Yes, 2=No|
|usca|8|PersonalDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|GpcSegmentType|2 bit int. Value is 1|
|usca|8|GpcSegmentIncluded|Boolean. Default value is true|
|usca|8|Gpc|Boolean|
|usva|9|Version|6 bit int. Value is 1|
|usva|9|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|SensitiveDataProcessing|2 bit int list of size 8. 0=Not applicable, 1=Yes, 2=No|
|usva|9|KnownChildSensitiveDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|Version|6 bit int. Value is 1|
|usco|10|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|SensitiveDataProcessing|2 bit int list of size 7. 0=Not applicable, 1=Yes, 2=No|
|usco|10|KnownChildSensitiveDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|GpcSegmentType|2 bit int. Value is 1|
|usco|10|GpcSegmentIncluded|Boolean. Default value is true|
|usco|10|Gpc|Boolean|
|usut|11|Version|6 bit int. Value is 1|
|usut|11|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|SensitiveDataProcessingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|SensitiveDataProcessing|2 bit int list of size 8. 0=Not applicable, 1=Yes, 2=No|
|usut|11|KnownChildSensitiveDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|Version|6 bit int. Value is 1|
|usct|12|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|SensitiveDataProcessing|2 bit int list of size 8. 0=Not applicable, 1=Yes, 2=No|
|usct|12|KnownChildSensitiveDataConsents|2 bit int list of size 3. 0=Not applicable, 1=Yes, 2=No|
|usct|12|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|GpcSegmentType|2 bit int. Value is 1|
|usct|12|GpcSegmentIncluded|Boolean. Default value is true|
|usct|12|Gpc|Boolean|

49 changes: 26 additions & 23 deletions iabgpp-encoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,50 @@
<parent>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-core</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.2.3-SNAPSHOT</version>
</parent>

<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-encoder</artifactId>
<name>IAB GPP Java Encoder Library</name>
<version>3.0.0-SNAPSHOT</version>
<description>Encode and decode consent information with the IAB GPP Framework</description>
<packaging>jar</packaging>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>


<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.0</version>
<version>5.9.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>surefire</artifactId>
<version>3.0.0-M7</version>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

Loading