Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 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
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
03dcbfc
remove validation (#66)
chuff Mar 25, 2025
d8fa7f5
3.2.3
aitsxhxl Mar 25, 2025
a5a6ed5
3.2.4-SNAPSHOT
aitsxhxl Mar 25, 2025
eb6e8c7
Added GitHub Actions workflow file for iabgpp-java version release
aitsxhxl Apr 2, 2025
5fe18dd
Merge remote-tracking branch 'upstream/master'
Apr 25, 2025
d4c0c9d
Fail if gpp string doesnt start with DB
Apr 25, 2025
8f2bda7
Merge branch 'master' into fail-fast
chuff Jun 24, 2025
020135d
fix merge conflict
Jun 24, 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
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
rm -f secret_key.asc
# gpg --list-secret-keys


# Generate settings.xml with Maven repository credentials
- name: Create settings.xml
run: |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,4 @@ CmpList cmpList = loader.cmpList(cmpListContent);
## Contributing

Here you can find the [contributing guide](CONTRIBUTING.md) to help maintain and update the library. This library is managed by the Code Libraries Subgroup of the Global Privacy Working Group at the IAB Tech Lab. To join the group, please reach out to support@iabtechlab.com.

Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ protected String encodeModel(Map<String, EncodableSection> sections) {
}

protected Map<String, EncodableSection> decodeModel(String str) {
if (str == null || str.isEmpty() || str.startsWith("D")) {
if (str == null || str.isEmpty() || str.startsWith("DB")) {
Map<String, EncodableSection> sections = new HashMap<>();

if (str != null && !str.isEmpty()) {
Expand Down
43 changes: 26 additions & 17 deletions iabgpp-encoder/src/test/java/com/iab/gpp/encoder/GppModelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,6 @@ public void testEncodeDefault() {

}

@Test
public void testDecodingException() {
Assertions.assertThrows(DecodingException.class, () -> {
new GppModel("invalid gpp string").getHeader();
});
}

@Test()
public void testDecodeGarbage() {
Assertions.assertThrows(DecodingException.class, () -> {
new GppModel("z").getUsCtSection();
});
}

@Test
public void testEncodeDefaultAll() {
GppModel gppModel = new GppModel();
Expand Down Expand Up @@ -132,7 +118,6 @@ public void testEncodeDefaultAll() {
gppModel.setFieldValue(UsTn.NAME, UsTxField.VERSION, UsTx.VERSION);



Assertions.assertEquals(true, gppModel.hasSection(TcfEuV2.NAME));
Assertions.assertEquals(true, gppModel.hasSection(TcfCaV1.NAME));
Assertions.assertEquals(true, gppModel.hasSection(UspV1.NAME));
Expand All @@ -155,9 +140,22 @@ public void testEncodeDefaultAll() {

String gppString = gppModel.encode();
Assertions.assertEquals(
"DBACOdM~CPSG_8APSG_8AAAAAAENAACAAAAAAAAAAAAAAAAAAAAA.QAAA.IAAA~BPSG_8APSG_8AAAAAAENAACAAAAAAAAAAAAAAAAAAA.YAAAAAAAAAA~1---~BAAAAAAAAABA.QA~BAAAAABA.QA~BAAAABA~BAAAAEA.QA~BAAAAAQA~BAAAAAEA.QA~BAAAAABA~BAAAAABA.QA~BAAAAAABAA.QA~BAAAAAQA.QA~BAAAAAABAA.QA~BAAAAAQA.QA~BAAAAAQA.QA~BAAAAABA.QA~BAAAAAAAQA.QA~BAAAAAQA.QA",
gppString);
"DBACOdM~CPSG_8APSG_8AAAAAAENAACAAAAAAAAAAAAAAAAAAAAA.QAAA.IAAA~BPSG_8APSG_8AAAAAAENAACAAAAAAAAAAAAAAAAAAA.YAAAAAAAAAA~1---~BAAAAAAAAABA.QA~BAAAAABA.QA~BAAAABA~BAAAAEA.QA~BAAAAAQA~BAAAAAEA.QA~BAAAAABA~BAAAAABA.QA~BAAAAAABAA.QA~BAAAAAQA.QA~BAAAAAABAA.QA~BAAAAAQA.QA~BAAAAAQA.QA~BAAAAABA.QA~BAAAAAAAQA.QA~BAAAAAQA.QA",
gppString);
}

@Test
public void testDecodingException() {
Assertions.assertThrows(DecodingException.class, () -> {
new GppModel("invalid gpp string").getHeader();
});
}

@Test()
public void testDecodeGarbage() {
Assertions.assertThrows(DecodingException.class, () -> {
new GppModel("z").getUsCtSection();
});
}

@Test
Expand Down Expand Up @@ -821,6 +819,17 @@ public void testDecodingEmptyString() {
gppModel.setFieldValue("uspv1", UspV1Field.NOTICE, 'Y');
Assertions.assertEquals("DBABTA~1Y--", gppModel.encode());
}

@Test
public void testDecodingExceptionValidStringButNotGPP() {
try {
GppModel gppModel = new GppModel("DP48G0AP48G0AEsACCPLAkEgAAAAAEPgAB5YAAAQaQD2F2K2kKFkPCmQWYAQBCijYEAhQAAAAkCBIAAgAUgQAgFIIAgAIFAAAAAAAAAQEgCQAAQABAAAIACgAAAAAAIAAAAAAAQQAAAAAIAAAAAAAAEAAAAAAAQAAAAIAABEhCAAQQAEAAAAAAAQAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAgAA");
gppModel.getHeader().getName();
Assertions.fail("Expected LazyDecodingException");
} catch (DecodingException e) {

}
}


}