diff --git a/.github/workflows/4.x-release.yml b/.github/workflows/4.x-release.yml
new file mode 100644
index 00000000..95820f3d
--- /dev/null
+++ b/.github/workflows/4.x-release.yml
@@ -0,0 +1,109 @@
+# Release to Maven Central via Central Publisher Portal
+# https://central.sonatype.org/publish/publish-portal-guide/
+#
+# Required GitHub secrets (Settings → Secrets and variables → Actions):
+# CENTRAL_TOKEN_USERNAME - Portal token username (from https://central.sonatype.com/usertoken)
+# CENTRAL_TOKEN_PASSWORD - Portal token password (from same page; save on first view, cannot be retrieved later)
+# GPG_SECRET_KEY - Armored GPG private key for signing
+# GPG_PASSPHRASE - Passphrase for the GPG key
+# PAT - Personal access token with repo scope (for pushing commits/tags)
+#
+name: IABGPP-Java 4.X Release
+
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'The release version (e.g., 4.x.x)'
+ required: true
+ default: ''
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ # Checkout the repository with full history for tagging
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ # Set up Java
+ - name: Set up Java
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '21'
+
+ # Import GPG secret key for signing
+ - name: Import GPG key
+ run: |
+ echo "${{ secrets.GPG_SECRET_KEY }}" > secret_key.asc
+ gpg --import --no-tty --batch secret_key.asc || { echo "GPG import failed"; cat secret_key.asc; exit 1; }
+ rm -f secret_key.asc
+
+ # Generate settings.xml with Central Publisher Portal token credentials
+ # Token from: https://central.sonatype.com/usertoken
+ - name: Create settings.xml
+ env:
+ CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
+ CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
+ run: |
+ mkdir -p ~/.m2
+ cat > ~/.m2/settings.xml << EOF
+
+
+
+ central
+ ${CENTRAL_TOKEN_USERNAME}
+ ${CENTRAL_TOKEN_PASSWORD}
+
+
+
+ EOF
+
+ # Pull latest changes from master
+ - name: Pull latest changes
+ run: git pull origin 4.X
+
+ # Set the release version in pom.xml
+ - name: Set release version
+ run: mvn versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
+
+ # Build and deploy to Central Publisher Portal (mvn deploy uploads bundle and publishes)
+ - name: Deploy release
+ run: |
+ echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
+ echo "use-agent" >> ~/.gnupg/gpg.conf
+ export GPG_TTY=$(tty || echo /dev/tty)
+ mvn clean deploy --settings ~/.m2/settings.xml -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" -Prelease
+
+ # Commit the release version and create a tag
+ - name: Commit and tag release
+ run: |
+ git config user.email "mayank@iabtechlab.com"
+ git config user.name "Mayank Mishra"
+ git add .
+ git commit -m "${{ github.event.inputs.version }}"
+ git tag "${{ github.event.inputs.version }}"
+
+ # Set the next snapshot version
+ - name: Set next snapshot version
+ run: mvn versions:set -DnextSnapshot=true -DgenerateBackupPoms=false
+
+ # Commit the snapshot version
+ - name: Commit snapshot version
+ run: |
+ NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
+ git add .
+ git commit -m "$NEW_VERSION"
+
+ # Push commits and tags to GitHub
+ - name: Push changes
+ run: |
+ git status
+ git push; git push --tags
+ env:
+ GITHUB_TOKEN: ${{ secrets.PAT }}
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 3b0cdcf3..f40adc9e 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,3 +1,13 @@
+# Release to Maven Central via Central Publisher Portal
+# https://central.sonatype.org/publish/publish-portal-guide/
+#
+# Required GitHub secrets (Settings → Secrets and variables → Actions):
+# CENTRAL_TOKEN_USERNAME - Portal token username (from https://central.sonatype.com/usertoken)
+# CENTRAL_TOKEN_PASSWORD - Portal token password (from same page; save on first view, cannot be retrieved later)
+# GPG_SECRET_KEY - Armored GPG private key for signing
+# GPG_PASSPHRASE - Passphrase for the GPG key
+# PAT - Personal access token with repo scope (for pushing commits/tags)
+#
name: IABGPP-Java Release
on:
@@ -14,15 +24,15 @@ jobs:
steps:
# Checkout the repository with full history for tagging
- name: Checkout repository
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- # Set up Java (assuming Java 11, adjust if different)
+ # Set up Java
- name: Set up Java
- uses: actions/setup-java@v2
+ uses: actions/setup-java@v4
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '21'
# Import GPG secret key for signing
@@ -31,16 +41,26 @@ jobs:
echo "${{ secrets.GPG_SECRET_KEY }}" > secret_key.asc
gpg --import --no-tty --batch secret_key.asc || { echo "GPG import failed"; cat secret_key.asc; exit 1; }
rm -f secret_key.asc
- # gpg --list-secret-keys
-
- # Generate settings.xml with Maven repository credentials
+ # Generate settings.xml with Central Publisher Portal token credentials
+ # Token from: https://central.sonatype.com/usertoken
- name: Create settings.xml
+ env:
+ CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
+ CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
run: |
mkdir -p ~/.m2
cat > ~/.m2/settings.xml << EOF
-
- ~/.m2 false false org.sonatype.plugins sonatype-nexus-snapshots TiW/t45q ${{ secrets.SONATYPE_PWD }} sonatype-nexus-staging TiW/t45q ${{ secrets.SONATYPE_PWD_STAGING }}
+
+
+
+ central
+ ${CENTRAL_TOKEN_USERNAME}
+ ${CENTRAL_TOKEN_PASSWORD}
+
+
EOF
@@ -52,14 +72,13 @@ jobs:
- name: Set release version
run: mvn versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
- # Build and deploy the release
+ # Build and deploy to Central Publisher Portal (mvn deploy uploads bundle and publishes)
- name: Deploy release
run: |
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
echo "use-agent" >> ~/.gnupg/gpg.conf
export GPG_TTY=$(tty || echo /dev/tty)
mvn clean deploy --settings ~/.m2/settings.xml -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" -Prelease
- # mvn clean deploy --settings ~/.m2/settings.xml -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" -Prelease -Dmaven.javadoc.skip=true
# Commit the release version and create a tag
- name: Commit and tag release
@@ -80,7 +99,6 @@ jobs:
NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
git add .
git commit -m "$NEW_VERSION"
- # git commit -m "${{ github.event.inputs.version }}-SNAPSHOT"
# Push commits and tags to GitHub
- name: Push changes
@@ -88,4 +106,4 @@ jobs:
git status
git push; git push --tags
env:
- GITHUB_TOKEN: ${{secrets.PAT}}
+ GITHUB_TOKEN: ${{ secrets.PAT }}
diff --git a/README.md b/README.md
index b4c3ee2b..fa9345d3 100644
--- a/README.md
+++ b/README.md
@@ -115,151 +115,312 @@ 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|
-
+| 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 array of size 12 |
+| tcfeuv2 | 2 | PurposeConsents | Boolean array of size 24 |
+| tcfeuv2 | 2 | PurposeLegitimateInterests | Boolean array of size 24 |
+| tcfeuv2 | 2 | PurposeOneTreatment | Boolean |
+| tcfeuv2 | 2 | PublisherCountryCode | 2 character country code |
+| tcfeuv2 | 2 | VendorConsents | Integer array of variable size |
+| tcfeuv2 | 2 | VendorLegitimateInterests | Integer array of variable size |
+| tcfeuv2 | 2 | PublisherRestrictions | Integer array of variable size |
+| tcfeuv2 | 2 | PublisherPurposesSegmentType | 3 bit int. Value is 3 |
+| tcfeuv2 | 2 | PublisherConsents | Boolean array of size 24 |
+| tcfeuv2 | 2 | PublisherLegitimateInterests | Boolean array of size 24 |
+| tcfeuv2 | 2 | NumCustomPurposes | 6 bit int |
+| tcfeuv2 | 2 | PublisherCustomConsents | Boolean array where size is set by the NumCustomPurposes field |
+| tcfeuv2 | 2 | PublisherCustomLegitimateInterests | Boolean array where size is set by the NumCustomPurposes field |
+| tcfeuv2 | 2 | VendorsAllowedSegmentType | 3 bit int. Value is 2 |
+| tcfeuv2 | 2 | VendorsAllowed | Integer array of variable size |
+| tcfeuv2 | 2 | VendorsDisclosedSegmentType | 3 bit int. Value is 1 |
+| tcfeuv2 | 2 | VendorsDisclosed | Integer array 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 array of size 12 |
+| tcfcav1 | 5 | PurposesExpressConsent | Boolean array of size 24 |
+| tcfcav1 | 5 | PurposesImpliedConsent | Boolean array of size 24 |
+| tcfcav1 | 5 | VendorExpressConsent | Integer array of variable size |
+| tcfcav1 | 5 | VendorImpliedConsent | Integer array of variable size |
+| tcfcav1 | 5 | PubRestrictions | RangeEntry list of variable size |
+| tcfcav1 | 5 | PubPurposesSegmentType | 3 bit int. Value is 3 |
+| tcfcav1 | 5 | PubPurposesExpressConsent | Boolean array of size 24 |
+| tcfcav1 | 5 | PubPurposesImpliedConsent | Boolean array of size 24 |
+| tcfcav1 | 5 | NumCustomPurposes | 6 bit int |
+| tcfcav1 | 5 | CustomPurposesExpressConsent | Boolean array where size is set by the NumCustomPurposes field |
+| tcfcav1 | 5 | CustomPurposesImpliedConsent | Boolean array 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 array of size 16. 0=Not applicable, 1=Yes, 2=No |
+| usnat | 7 | KnownChildSensitiveDataConsents | 2 bit int array of size 3. 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 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 array of size 9. 0=Not applicable, 1=Yes, 2=No |
+| usca | 8 | KnownChildSensitiveDataConsents | 2 bit int array 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 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 array 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 array 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. Deafult 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 array 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 array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| usct | 12 | KnownChildSensitiveDataConsents | 2 bit int array 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 is true |
+| usct | 12 | Gpc | Boolean |
+| usfl | 13 | Version | 6 bit int. Value is 1 |
+| usfl | 13 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | SensitiveDataProcessing | 2 bit int array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | KnownChildSensitiveDataConsents | 2 bit int array of size 3. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usfl | 13 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | Version | 6 bit int. Value is 1 |
+| usmt | 14 | SharingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | SensitiveDataProcessing | 2 bit int array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | KnownChildSensitiveDataConsents | 2 bit int array of size 3. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmt | 14 | GpcSegmentType | 2 bit int. Value is 1 |
+| usmt | 14 | GpcSegmentIncluded | Boolean. Default is true |
+| usmt | 14 | Gpc | Boolean |
+| usor | 15 | Version | 6 bit int. Value is 1 |
+| usor | 15 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | SensitiveDataProcessing | 2 bit int array of size 11. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | KnownChildSensitiveDataConsents | 2 bit int array of size 3. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usor | 15 | GpcSegmentType | 2 bit int. Value is 1 |
+| usor | 15 | GpcSegmentIncluded | Boolean. Default is true |
+| usor | 15 | Gpc | Boolean |
+| ustx | 16 | Version | 6 bit int. Value is 1 |
+| ustx | 16 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | SensitiveDataProcessing | 2 bit int array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | KnownChildSensitiveDataConsents | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustx | 16 | GpcSegmentType | 2 bit int. Value is 1 |
+| ustx | 16 | GpcSegmentIncluded | Boolean. Default is true |
+| ustx | 16 | Gpc | Boolean |
+| usde | 17 | Version | 6 bit int. Value is 1 |
+| usde | 17 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | SensitiveDataProcessing | 2 bit int array of size 9. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | KnownChildSensitiveDataConsents | 2 bit int array of size 5. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usde | 17 | GpcSegmentType | 2 bit int. Value is 1 |
+| usde | 17 | GpcSegmentIncluded | Boolean. Default is true |
+| usde | 17 | Gpc | Boolean |
+| usia | 18 | Version | 6 bit int. Value is 1 |
+| usia | 18 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | SensitiveDataOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | SensitiveDataProcessing | 2 bit int array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | KnownChildSensitiveDataConsents | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usia | 18 | GpcSegmentType | 2 bit int. Value is 1 |
+| usia | 18 | GpcSegmentIncluded | Boolean. Default is true |
+| usia | 18 | Gpc | Boolean |
+| usne | 19 | Version | 6 bit int. Value is 1 |
+| usne | 19 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | SensitiveDataProcessing | 2 bit int array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | KnownChildSensitiveDataConsents | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usne | 19 | GpcSegmentType | 2 bit int. Value is 1 |
+| usne | 19 | GpcSegmentIncluded | Boolean. Default is true |
+| usne | 19 | Gpc | Boolean |
+| usnh | 20 | Version | 6 bit int. Value is 1 |
+| usnh | 20 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | SensitiveDataProcessing | 2 bit int array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | KnownChildSensitiveDataConsents | 2 bit int array of size 3. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnh | 20 | GpcSegmentType | 2 bit int. Value is 1 |
+| usnh | 20 | GpcSegmentIncluded | Boolean. Default is true |
+| usnh | 20 | Gpc | Boolean |
+| usnj | 21 | Version | 6 bit int. Value is 1 |
+| usnj | 21 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | SensitiveDataProcessing | 2 bit int array of size 10. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | KnownChildSensitiveDataConsents | 2 bit int array of size 5. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usnj | 21 | GpcSegmentType | 2 bit int. Value is 1 |
+| usnj | 21 | GpcSegmentIncluded | Boolean. Default is true |
+| usnj | 21 | Gpc | Boolean |
+| ustn | 22 | Version | 6 bit int. Value is 1 |
+| ustn | 22 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | SensitiveDataProcessing | 2 bit int array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | KnownChildSensitiveDataConsents | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| ustn | 22 | GpcSegmentType | 2 bit int. Value is 1 |
+| ustn | 22 | GpcSegmentIncluded | Boolean. Default is true |
+| ustn | 22 | Gpc | Boolean |
+| usmn | 23 | Version | 6 bit int. Value is 1 |
+| usmn | 23 | ProcessingNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | SaleOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | TargetedAdvertisingOptOutNotice | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | SaleOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | TargetedAdvertisingOptOut | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | SensitiveDataProcessing | 2 bit int array of size 8. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | KnownChildSensitiveDataConsents | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | AdditionalDataProcessingConsent | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | MspaCoveredTransaction | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | MspaOptOutOptionMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | MspaServiceProviderMode | 2 bit int. 0=Not applicable, 1=Yes, 2=No |
+| usmn | 23 | GpcSegmentType | 2 bit int. Value is 1 |
+| usmn | 23 | GpcSegmentIncluded | Boolean. Default is true |
+| usmn | 23 | Gpc | Boolean |
## 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.
diff --git a/iabgpp-encoder/pom.xml b/iabgpp-encoder/pom.xml
index 03e794e5..bf84bbbc 100644
--- a/iabgpp-encoder/pom.xml
+++ b/iabgpp-encoder/pom.xml
@@ -7,10 +7,11 @@
com.iabgpp
iabgpp-core
- 3.2.5-SNAPSHOT
+ 3.2.6-SNAPSHOT
iabgpp-encoder
+ IAB GPP Encoder
jar
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/GppModel.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/GppModel.java
index b4f8cba3..2eef8aa5 100644
--- a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/GppModel.java
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/GppModel.java
@@ -10,28 +10,7 @@
import com.iab.gpp.encoder.error.EncodingException;
import com.iab.gpp.encoder.error.InvalidFieldException;
import com.iab.gpp.encoder.field.HeaderV1Field;
-import com.iab.gpp.encoder.section.EncodableSection;
-import com.iab.gpp.encoder.section.HeaderV1;
-import com.iab.gpp.encoder.section.Sections;
-import com.iab.gpp.encoder.section.TcfCaV1;
-import com.iab.gpp.encoder.section.TcfEuV2;
-import com.iab.gpp.encoder.section.UsCa;
-import com.iab.gpp.encoder.section.UsCo;
-import com.iab.gpp.encoder.section.UsCt;
-import com.iab.gpp.encoder.section.UsDe;
-import com.iab.gpp.encoder.section.UsFl;
-import com.iab.gpp.encoder.section.UsIa;
-import com.iab.gpp.encoder.section.UsMt;
-import com.iab.gpp.encoder.section.UsNat;
-import com.iab.gpp.encoder.section.UsNe;
-import com.iab.gpp.encoder.section.UsNh;
-import com.iab.gpp.encoder.section.UsNj;
-import com.iab.gpp.encoder.section.UsOr;
-import com.iab.gpp.encoder.section.UsTn;
-import com.iab.gpp.encoder.section.UsTx;
-import com.iab.gpp.encoder.section.UsUt;
-import com.iab.gpp.encoder.section.UsVa;
-import com.iab.gpp.encoder.section.UspV1;
+import com.iab.gpp.encoder.section.*;
public class GppModel {
private Map sections = new HashMap<>();
@@ -119,6 +98,9 @@ public void setFieldValue(String sectionName, String fieldName, Object value) {
} else if (sectionName.equals(UsTn.NAME)) {
section = new UsTn();
this.sections.put(UsTn.NAME, section);
+ } else if (sectionName.equals(UsMn.NAME)) {
+ section = new UsMn();
+ this.sections.put(UsMn.NAME, section);
}
} else {
section = this.sections.get(sectionName);
@@ -316,6 +298,10 @@ public UsTn getUsTnSection() {
return (UsTn) getSection(UsTn.NAME);
}
+ public UsMn getUsMnSection() {
+ return (UsMn) getSection(UsMn.NAME);
+ }
+
public List getSectionIds() {
if (!this.decoded) {
this.sections = this.decodeModel(this.encodedString);
@@ -427,6 +413,9 @@ protected Map decodeModel(String str) {
} else if (sectionIds.get(i).equals(UsTn.ID)) {
UsTn section = new UsTn(encodedSections[i + 1]);
sections.put(UsTn.NAME, section);
+ } else if (sectionIds.get(i).equals(UsMn.ID)) {
+ UsMn section = new UsMn(encodedSections[i + 1]);
+ sections.put(UsMn.NAME, section);
}
}
}
@@ -537,6 +526,9 @@ public void decodeSection(String sectionName, String encodedString) {
}else if (sectionName.equals(UsTn.NAME)) {
section = new UsTn();
this.sections.put(UsTn.NAME, section);
+ }else if (sectionName.equals(UsMn.NAME)) {
+ section = new UsMn();
+ this.sections.put(UsMn.NAME, section);
}
} else {
section = this.sections.get(sectionName);
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/field/UsMnField.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/field/UsMnField.java
new file mode 100644
index 00000000..c86f828f
--- /dev/null
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/field/UsMnField.java
@@ -0,0 +1,48 @@
+package com.iab.gpp.encoder.field;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class UsMnField {
+
+ public static String VERSION = "Version";
+ public static String PROCESSING_NOTICE = "ProcessingNotice";
+ public static String SALE_OPT_OUT_NOTICE = "SaleOptOutNotice";
+ public static String TARGETED_ADVERTISING_OPT_OUT_NOTICE = "TargetedAdvertisingOptOutNotice";
+ public static String SALE_OPT_OUT = "SaleOptOut";
+ public static String TARGETED_ADVERTISING_OPT_OUT = "TargetedAdvertisingOptOut";
+ public static String SENSITIVE_DATA_PROCESSING = "SensitiveDataProcessing";
+ public static String KNOWN_CHILD_SENSITIVE_DATA_CONSENTS = "KnownChildSensitiveDataConsents";
+ public static String ADDITIONAL_DATA_PROCESSING_CONSENT = "AdditionalDataProcessingConsent";
+ public static String MSPA_COVERED_TRANSACTION = "MspaCoveredTransaction";
+ public static String MSPA_OPT_OUT_OPTION_MODE = "MspaOptOutOptionMode";
+ public static String MSPA_SERVICE_PROVIDER_MODE = "MspaServiceProviderMode";
+
+ public static String GPC_SEGMENT_TYPE = "GpcSegmentType";
+ public static String GPC_SEGMENT_INCLUDED = "GpcSegmentIncluded";
+ public static String GPC = "Gpc";
+
+ //@formatter:off
+ public static List USMN_CORE_SEGMENT_FIELD_NAMES = Arrays.asList(new String[] {
+ UsMnField.VERSION,
+ UsMnField.PROCESSING_NOTICE,
+ UsMnField.SALE_OPT_OUT_NOTICE,
+ UsMnField.TARGETED_ADVERTISING_OPT_OUT_NOTICE,
+ UsMnField.SALE_OPT_OUT,
+ UsMnField.TARGETED_ADVERTISING_OPT_OUT,
+ UsMnField.SENSITIVE_DATA_PROCESSING,
+ UsMnField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
+ UsMnField.ADDITIONAL_DATA_PROCESSING_CONSENT,
+ UsMnField.MSPA_COVERED_TRANSACTION,
+ UsMnField.MSPA_OPT_OUT_OPTION_MODE,
+ UsMnField.MSPA_SERVICE_PROVIDER_MODE
+ });
+ //@formatter:on
+
+ //@formatter:off
+ public static List USMN_GPC_SEGMENT_FIELD_NAMES = Arrays.asList(new String[] {
+ UsMnField.GPC_SEGMENT_TYPE,
+ UsMnField.GPC
+ });
+ //@formatter:on
+}
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/section/Sections.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/section/Sections.java
index 976805d3..fb69587c 100644
--- a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/section/Sections.java
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/section/Sections.java
@@ -34,6 +34,7 @@ public class Sections {
SECTION_ID_NAME_MAP.put(UsNh.ID, UsNh.NAME);
SECTION_ID_NAME_MAP.put(UsNj.ID, UsNj.NAME);
SECTION_ID_NAME_MAP.put(UsTn.ID, UsTn.NAME);
+ SECTION_ID_NAME_MAP.put(UsMn.ID, UsMn.NAME);
SECTION_ORDER = new ArrayList(SECTION_ID_NAME_MAP.keySet()).stream().sorted()
.map(id -> SECTION_ID_NAME_MAP.get(id)).collect(Collectors.toList());
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/section/UsMn.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/section/UsMn.java
new file mode 100644
index 00000000..961f4a91
--- /dev/null
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/section/UsMn.java
@@ -0,0 +1,141 @@
+package com.iab.gpp.encoder.section;
+
+import com.iab.gpp.encoder.field.UsMnField;
+import com.iab.gpp.encoder.segment.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class UsMn extends AbstractLazilyEncodableSection {
+
+ public static int ID = 23;
+ public static int VERSION = 1;
+ public static String NAME = "usmn";
+
+ public UsMn() {
+ super();
+ }
+
+ public UsMn(String encodedString) {
+ super();
+ decode(encodedString);
+ }
+
+ @Override
+ public int getId() {
+ return UsMn.ID;
+ }
+
+ @Override
+ public String getName() {
+ return UsMn.NAME;
+ }
+
+ @Override
+ public int getVersion() {
+ return UsMn.VERSION;
+ }
+
+ @Override
+ protected List initializeSegments() {
+ List segments = new ArrayList<>();
+ segments.add(new UsMnCoreSegment());
+ segments.add(new UsMnGpcSegment());
+ return segments;
+ }
+
+ @Override
+ protected List decodeSection(String encodedString) {
+ List segments = initializeSegments();
+
+ if (encodedString != null && !encodedString.isEmpty()) {
+ String[] encodedSegments = encodedString.split("\\.");
+
+ if (encodedSegments.length > 0) {
+ segments.get(0).decode(encodedSegments[0]);
+ }
+
+ if (encodedSegments.length > 1) {
+ segments.get(1).setFieldValue(UsMnField.GPC_SEGMENT_INCLUDED, true);
+ segments.get(1).decode(encodedSegments[1]);
+ } else {
+ segments.get(1).setFieldValue(UsMnField.GPC_SEGMENT_INCLUDED, false);
+ }
+ }
+
+ return segments;
+ }
+
+ @Override
+ protected String encodeSection(List segments) {
+ List encodedSegments = new ArrayList<>();
+
+ if (!segments.isEmpty()) {
+ encodedSegments.add(segments.get(0).encode());
+ if (segments.size() >= 2 && segments.get(1).getFieldValue(UsMnField.GPC_SEGMENT_INCLUDED).equals(true)) {
+ encodedSegments.add(segments.get(1).encode());
+ }
+ }
+
+ return String.join(".", encodedSegments);
+ }
+
+
+ public Integer getProcessingNotice() {
+ return (Integer) this.getFieldValue(UsMnField.PROCESSING_NOTICE);
+ }
+
+ public Integer getSaleOptOutNotice() {
+ return (Integer) this.getFieldValue(UsMnField.SALE_OPT_OUT_NOTICE);
+ }
+
+ public Integer getTargetedAdvertisingOptOutNotice() {
+ return (Integer) this.getFieldValue(UsMnField.TARGETED_ADVERTISING_OPT_OUT_NOTICE);
+ }
+
+ public Integer getSaleOptOut() {
+ return (Integer) this.getFieldValue(UsMnField.SALE_OPT_OUT);
+ }
+
+ public Integer getTargetedAdvertisingOptOut() {
+ return (Integer) this.getFieldValue(UsMnField.TARGETED_ADVERTISING_OPT_OUT);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List getSensitiveDataProcessing() {
+ return (List) this.getFieldValue(UsMnField.SENSITIVE_DATA_PROCESSING);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Integer getKnownChildSensitiveDataConsents() {
+ return (Integer) this.getFieldValue(UsMnField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS);
+ }
+
+ public Integer getAdditionalDataProcessingConsent() {
+ return (Integer) this.getFieldValue(UsMnField.ADDITIONAL_DATA_PROCESSING_CONSENT);
+ }
+
+ public Integer getMspaCoveredTransaction() {
+ return (Integer) this.getFieldValue(UsMnField.MSPA_COVERED_TRANSACTION);
+ }
+
+ public Integer getMspaOptOutOptionMode() {
+ return (Integer) this.getFieldValue(UsMnField.MSPA_OPT_OUT_OPTION_MODE);
+ }
+
+ public Integer getMspaServiceProviderMode() {
+ return (Integer) this.getFieldValue(UsMnField.MSPA_SERVICE_PROVIDER_MODE);
+ }
+
+ public Integer getGpcSegmentType() {
+ return (Integer) this.getFieldValue(UsMnField.GPC_SEGMENT_TYPE);
+ }
+
+ public Boolean getGpcSegmentIncluded() {
+ return (Boolean) this.getFieldValue(UsMnField.GPC_SEGMENT_INCLUDED);
+ }
+
+ public Boolean getGpc() {
+ return (Boolean) this.getFieldValue(UsMnField.GPC);
+ }
+}
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsDeCoreSegment.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsDeCoreSegment.java
index a011faa0..72953219 100644
--- a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsDeCoreSegment.java
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsDeCoreSegment.java
@@ -11,7 +11,6 @@
import com.iab.gpp.encoder.error.DecodingException;
import com.iab.gpp.encoder.field.EncodableBitStringFields;
import com.iab.gpp.encoder.field.UsDeField;
-import com.iab.gpp.encoder.field.UsVaField;
import com.iab.gpp.encoder.section.UsDe;
public class UsDeCoreSegment extends AbstractLazilyEncodableSegment {
@@ -61,7 +60,7 @@ protected EncodableBitStringFields initializeFields() {
fields.put(UsDeField.SENSITIVE_DATA_PROCESSING,
new EncodableFixedIntegerList(2, Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0))
.withValidator(nullableBooleanAsTwoBitIntegerListValidator));
- fields.put(UsVaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
+ fields.put(UsDeField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
new EncodableFixedIntegerList(2, Arrays.asList(0, 0, 0, 0, 0))
.withValidator(nullableBooleanAsTwoBitIntegerListValidator));
fields.put(UsDeField.ADDITIONAL_DATA_PROCESSING_CONSENT,
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsIaCoreSegment.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsIaCoreSegment.java
index 9cd9a917..aa3bd706 100644
--- a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsIaCoreSegment.java
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsIaCoreSegment.java
@@ -11,7 +11,6 @@
import com.iab.gpp.encoder.error.DecodingException;
import com.iab.gpp.encoder.field.EncodableBitStringFields;
import com.iab.gpp.encoder.field.UsIaField;
-import com.iab.gpp.encoder.field.UsVaField;
import com.iab.gpp.encoder.section.UsIa;
public class UsIaCoreSegment extends AbstractLazilyEncodableSegment {
@@ -63,7 +62,7 @@ protected EncodableBitStringFields initializeFields() {
fields.put(UsIaField.SENSITIVE_DATA_PROCESSING,
new EncodableFixedIntegerList(2, Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0))
.withValidator(nullableBooleanAsTwoBitIntegerListValidator));
- fields.put(UsVaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
+ fields.put(UsIaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
fields.put(UsIaField.MSPA_COVERED_TRANSACTION,
new EncodableFixedInteger(2, 1).withValidator(nonNullableBooleanAsTwoBitIntegerValidator));
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsMnCoreSegment.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsMnCoreSegment.java
new file mode 100644
index 00000000..1d48ea10
--- /dev/null
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsMnCoreSegment.java
@@ -0,0 +1,97 @@
+package com.iab.gpp.encoder.segment;
+
+import com.iab.gpp.encoder.base64.AbstractBase64UrlEncoder;
+import com.iab.gpp.encoder.base64.CompressedBase64UrlEncoder;
+import com.iab.gpp.encoder.bitstring.BitStringEncoder;
+import com.iab.gpp.encoder.datatype.EncodableFixedInteger;
+import com.iab.gpp.encoder.datatype.EncodableFixedIntegerList;
+import com.iab.gpp.encoder.error.DecodingException;
+import com.iab.gpp.encoder.field.EncodableBitStringFields;
+import com.iab.gpp.encoder.field.UsMnField;
+import com.iab.gpp.encoder.section.UsMn;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.Predicate;
+
+public class UsMnCoreSegment extends AbstractLazilyEncodableSegment {
+
+ private AbstractBase64UrlEncoder base64UrlEncoder = CompressedBase64UrlEncoder.getInstance();
+ private BitStringEncoder bitStringEncoder = BitStringEncoder.getInstance();
+
+ public UsMnCoreSegment() {
+ super();
+ }
+
+ public UsMnCoreSegment(String encodedString) {
+ super();
+ this.decode(encodedString);
+ }
+
+ @Override
+ public List getFieldNames() {
+ return UsMnField.USMN_CORE_SEGMENT_FIELD_NAMES;
+ }
+
+ @Override
+ protected EncodableBitStringFields initializeFields() {
+ Predicate nullableBooleanAsTwoBitIntegerValidator = (n -> n >= 0 && n <= 2);
+ Predicate nonNullableBooleanAsTwoBitIntegerValidator = (n -> n >= 1 && n <= 2);
+ Predicate> nullableBooleanAsTwoBitIntegerListValidator = (l -> {
+ for (int n : l) {
+ if (n < 0 || n > 2) {
+ return false;
+ }
+ }
+ return true;
+ });
+
+ EncodableBitStringFields fields = new EncodableBitStringFields();
+ fields.put(UsMnField.VERSION, new EncodableFixedInteger(6, UsMn.VERSION));
+ fields.put(UsMnField.PROCESSING_NOTICE,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.SALE_OPT_OUT_NOTICE,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.TARGETED_ADVERTISING_OPT_OUT_NOTICE,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.SALE_OPT_OUT,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.TARGETED_ADVERTISING_OPT_OUT,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.SENSITIVE_DATA_PROCESSING,
+ new EncodableFixedIntegerList(2, Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0))
+ .withValidator(nullableBooleanAsTwoBitIntegerListValidator));
+ fields.put(UsMnField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.ADDITIONAL_DATA_PROCESSING_CONSENT,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.MSPA_COVERED_TRANSACTION,
+ new EncodableFixedInteger(2, 1).withValidator(nonNullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.MSPA_OPT_OUT_OPTION_MODE,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ fields.put(UsMnField.MSPA_SERVICE_PROVIDER_MODE,
+ new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
+ return fields;
+ }
+
+ @Override
+ protected String encodeSegment(EncodableBitStringFields fields) {
+ String bitString = bitStringEncoder.encode(fields, getFieldNames());
+ String encodedString = base64UrlEncoder.encode(bitString);
+ return encodedString;
+ }
+
+ @Override
+ protected void decodeSegment(String encodedString, EncodableBitStringFields fields) {
+ if (encodedString == null || encodedString.isEmpty()) {
+ this.fields.reset(fields);
+ }
+ try {
+ String bitString = base64UrlEncoder.decode(encodedString);
+ bitStringEncoder.decode(bitString, getFieldNames(), fields);
+ } catch (Exception e) {
+ throw new DecodingException("Unable to decode UsMnCoreSegment '" + encodedString + "'", e);
+ }
+ }
+
+}
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsMnGpcSegment.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsMnGpcSegment.java
new file mode 100644
index 00000000..fbeb9df0
--- /dev/null
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsMnGpcSegment.java
@@ -0,0 +1,61 @@
+package com.iab.gpp.encoder.segment;
+
+import com.iab.gpp.encoder.base64.AbstractBase64UrlEncoder;
+import com.iab.gpp.encoder.base64.CompressedBase64UrlEncoder;
+import com.iab.gpp.encoder.bitstring.BitStringEncoder;
+import com.iab.gpp.encoder.datatype.EncodableBoolean;
+import com.iab.gpp.encoder.datatype.EncodableFixedInteger;
+import com.iab.gpp.encoder.error.DecodingException;
+import com.iab.gpp.encoder.field.EncodableBitStringFields;
+import com.iab.gpp.encoder.field.UsMnField;
+
+import java.util.List;
+
+public class UsMnGpcSegment extends AbstractLazilyEncodableSegment {
+
+ private AbstractBase64UrlEncoder base64UrlEncoder = CompressedBase64UrlEncoder.getInstance();
+ private BitStringEncoder bitStringEncoder = BitStringEncoder.getInstance();
+
+ public UsMnGpcSegment() {
+ super();
+ }
+
+ public UsMnGpcSegment(String encodedString) {
+ super();
+ this.decode(encodedString);
+ }
+
+ @Override
+ public List getFieldNames() {
+ return UsMnField.USMN_GPC_SEGMENT_FIELD_NAMES;
+ }
+
+ @Override
+ protected EncodableBitStringFields initializeFields() {
+ EncodableBitStringFields fields = new EncodableBitStringFields();
+ fields.put(UsMnField.GPC_SEGMENT_TYPE, new EncodableFixedInteger(2, 1));
+ fields.put(UsMnField.GPC_SEGMENT_INCLUDED, new EncodableBoolean(true));
+ fields.put(UsMnField.GPC, new EncodableBoolean(false));
+ return fields;
+ }
+
+ @Override
+ protected String encodeSegment(EncodableBitStringFields fields) {
+ String bitString = bitStringEncoder.encode(fields, getFieldNames());
+ String encodedString = base64UrlEncoder.encode(bitString);
+ return encodedString;
+ }
+
+ @Override
+ protected void decodeSegment(String encodedString, EncodableBitStringFields fields) {
+ if(encodedString == null || encodedString.isEmpty()) {
+ this.fields.reset(fields);
+ }
+ try {
+ String bitString = base64UrlEncoder.decode(encodedString);
+ bitStringEncoder.decode(bitString, getFieldNames(), fields);
+ } catch (Exception e) {
+ throw new DecodingException("Unable to decode UsMnGpcSegment '" + encodedString + "'", e);
+ }
+ }
+}
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsNatCoreSegment.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsNatCoreSegment.java
index 6c7a7945..0c4769ad 100644
--- a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsNatCoreSegment.java
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsNatCoreSegment.java
@@ -99,7 +99,11 @@ protected void decodeSegment(String encodedString, EncodableBitStringFields fiel
// Necessary to maintain backwards compatibility when sensitive data processing changed from a
// length of 12 to 16 and known child sensitive data consents changed from a length of 2 to 3 in the
// DE, IA, NE, NH, NJ, TN release
- if (bitString.length() == 66) {
+ if (bitString.length() == 60) {
+ bitString =
+ bitString.substring(0, 48) + "00000000" + bitString.substring(48, 52) + "00" + bitString.substring(52, 60) + "00";
+ }
+ else if (bitString.length() == 66) {
bitString =
bitString.substring(0, 48) + "00000000" + bitString.substring(48, 52) + "00" + bitString.substring(52, 62);
}
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsNeCoreSegment.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsNeCoreSegment.java
index 7a98c30f..626b9c93 100644
--- a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsNeCoreSegment.java
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsNeCoreSegment.java
@@ -11,7 +11,6 @@
import com.iab.gpp.encoder.error.DecodingException;
import com.iab.gpp.encoder.field.EncodableBitStringFields;
import com.iab.gpp.encoder.field.UsNeField;
-import com.iab.gpp.encoder.field.UsVaField;
import com.iab.gpp.encoder.section.UsNe;
public class UsNeCoreSegment extends AbstractLazilyEncodableSegment {
@@ -61,7 +60,7 @@ protected EncodableBitStringFields initializeFields() {
fields.put(UsNeField.SENSITIVE_DATA_PROCESSING,
new EncodableFixedIntegerList(2, Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0))
.withValidator(nullableBooleanAsTwoBitIntegerListValidator));
- fields.put(UsVaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
+ fields.put(UsNeField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
fields.put(UsNeField.ADDITIONAL_DATA_PROCESSING_CONSENT,
new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
diff --git a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsTxCoreSegment.java b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsTxCoreSegment.java
index 53463d20..a983a2ce 100644
--- a/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsTxCoreSegment.java
+++ b/iabgpp-encoder/src/main/java/com/iab/gpp/encoder/segment/UsTxCoreSegment.java
@@ -11,7 +11,6 @@
import com.iab.gpp.encoder.error.DecodingException;
import com.iab.gpp.encoder.field.EncodableBitStringFields;
import com.iab.gpp.encoder.field.UsTxField;
-import com.iab.gpp.encoder.field.UsVaField;
import com.iab.gpp.encoder.section.UsTx;
public class UsTxCoreSegment extends AbstractLazilyEncodableSegment {
@@ -61,7 +60,7 @@ protected EncodableBitStringFields initializeFields() {
fields.put(UsTxField.SENSITIVE_DATA_PROCESSING,
new EncodableFixedIntegerList(2, Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0))
.withValidator(nullableBooleanAsTwoBitIntegerListValidator));
- fields.put(UsVaField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
+ fields.put(UsTxField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS,
new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
fields.put(UsTxField.ADDITIONAL_DATA_PROCESSING_CONSENT,
new EncodableFixedInteger(2, 0).withValidator(nullableBooleanAsTwoBitIntegerValidator));
diff --git a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/GppModelTest.java b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/GppModelTest.java
index d1890a59..bb5f2336 100644
--- a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/GppModelTest.java
+++ b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/GppModelTest.java
@@ -4,22 +4,11 @@
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
+
+import com.iab.gpp.encoder.field.*;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import com.iab.gpp.encoder.error.DecodingException;
-import com.iab.gpp.encoder.field.TcfCaV1Field;
-import com.iab.gpp.encoder.field.TcfEuV2Field;
-import com.iab.gpp.encoder.field.UsCaField;
-import com.iab.gpp.encoder.field.UsCoField;
-import com.iab.gpp.encoder.field.UsCtField;
-import com.iab.gpp.encoder.field.UsFlField;
-import com.iab.gpp.encoder.field.UsMtField;
-import com.iab.gpp.encoder.field.UsNatField;
-import com.iab.gpp.encoder.field.UsOrField;
-import com.iab.gpp.encoder.field.UsTxField;
-import com.iab.gpp.encoder.field.UsUtField;
-import com.iab.gpp.encoder.field.UsVaField;
-import com.iab.gpp.encoder.field.UspV1Field;
import com.iab.gpp.encoder.section.TcfCaV1;
import com.iab.gpp.encoder.section.TcfEuV2;
import com.iab.gpp.encoder.section.UsCa;
@@ -28,6 +17,7 @@
import com.iab.gpp.encoder.section.UsDe;
import com.iab.gpp.encoder.section.UsFl;
import com.iab.gpp.encoder.section.UsIa;
+import com.iab.gpp.encoder.section.UsMn;
import com.iab.gpp.encoder.section.UsMt;
import com.iab.gpp.encoder.section.UsNat;
import com.iab.gpp.encoder.section.UsNe;
@@ -92,6 +82,7 @@ public void testEncodeDefaultAll() {
Assertions.assertEquals(false, gppModel.hasSection(UsNh.NAME));
Assertions.assertEquals(false, gppModel.hasSection(UsNj.NAME));
Assertions.assertEquals(false, gppModel.hasSection(UsTn.NAME));
+ Assertions.assertEquals(false, gppModel.hasSection(UsMn.NAME));
gppModel.setFieldValue(TcfEuV2.NAME, TcfEuV2Field.VERSION, TcfEuV2.VERSION);
gppModel.setFieldValue(TcfEuV2.NAME, TcfCaV1Field.CREATED, utcDateTime);
@@ -110,12 +101,13 @@ public void testEncodeDefaultAll() {
gppModel.setFieldValue(UsMt.NAME, UsMtField.VERSION, UsMt.VERSION);
gppModel.setFieldValue(UsOr.NAME, UsOrField.VERSION, UsOr.VERSION);
gppModel.setFieldValue(UsTx.NAME, UsTxField.VERSION, UsTx.VERSION);
- gppModel.setFieldValue(UsDe.NAME, UsTxField.VERSION, UsTx.VERSION);
- gppModel.setFieldValue(UsIa.NAME, UsTxField.VERSION, UsTx.VERSION);
- gppModel.setFieldValue(UsNe.NAME, UsTxField.VERSION, UsTx.VERSION);
- gppModel.setFieldValue(UsNh.NAME, UsTxField.VERSION, UsTx.VERSION);
- gppModel.setFieldValue(UsNj.NAME, UsTxField.VERSION, UsTx.VERSION);
- gppModel.setFieldValue(UsTn.NAME, UsTxField.VERSION, UsTx.VERSION);
+ gppModel.setFieldValue(UsDe.NAME, UsDeField.VERSION, UsDe.VERSION);
+ gppModel.setFieldValue(UsIa.NAME, UsIaField.VERSION, UsIa.VERSION);
+ gppModel.setFieldValue(UsNe.NAME, UsNeField.VERSION, UsNe.VERSION);
+ gppModel.setFieldValue(UsNh.NAME, UsNhField.VERSION, UsNh.VERSION);
+ gppModel.setFieldValue(UsNj.NAME, UsNjField.VERSION, UsNj.VERSION);
+ gppModel.setFieldValue(UsTn.NAME, UsTnField.VERSION, UsTn.VERSION);
+ gppModel.setFieldValue(UsMn.NAME, UsMnField.VERSION, UsMn.VERSION);
Assertions.assertEquals(true, gppModel.hasSection(TcfEuV2.NAME));
@@ -137,10 +129,11 @@ public void testEncodeDefaultAll() {
Assertions.assertEquals(true, gppModel.hasSection(UsNh.NAME));
Assertions.assertEquals(true, gppModel.hasSection(UsNj.NAME));
Assertions.assertEquals(true, gppModel.hasSection(UsTn.NAME));
+ Assertions.assertEquals(true, gppModel.hasSection(UsMn.NAME));
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",
+ "DBACOYs~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~BAAAAAQA.QA",
gppString);
}
@@ -413,7 +406,7 @@ public void testDecodeDefaults() {
@Test
public void testDecodeDefaultsAll() {
String 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";
+ "DBACOYs~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~BAAAAAABAA.QA";
GppModel gppModel = new GppModel(gppString);
Assertions.assertEquals(true, gppModel.hasSection(TcfEuV2.NAME));
@@ -435,6 +428,7 @@ public void testDecodeDefaultsAll() {
Assertions.assertEquals(true, gppModel.hasSection(UsNh.NAME));
Assertions.assertEquals(true, gppModel.hasSection(UsNj.NAME));
Assertions.assertEquals(true, gppModel.hasSection(UsTn.NAME));
+ Assertions.assertEquals(true, gppModel.hasSection(UsMn.NAME));
}
@Test
diff --git a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FibonacciIntegerRangeEncoderTest.java b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FibonacciIntegerRangeEncoderTest.java
index f0cb813f..1cae6e34 100644
--- a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FibonacciIntegerRangeEncoderTest.java
+++ b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FibonacciIntegerRangeEncoderTest.java
@@ -102,6 +102,6 @@ public void testDecode8() {
@Test
public void testGiantRange() {
String max = FibonacciIntegerEncoder.encode(FibonacciIntegerRangeEncoder.MAX_SIZE + 1);
- Assertions.assertEquals(List.of(), FibonacciIntegerRangeEncoder.decode("000000000001111" + max));
+ Assertions.assertEquals(new ArrayList<>(), FibonacciIntegerRangeEncoder.decode("000000000001111" + max));
}
}
diff --git a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FixedIntegerRangeEncoderTest.java b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FixedIntegerRangeEncoderTest.java
index 769763ea..b781cd4c 100644
--- a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FixedIntegerRangeEncoderTest.java
+++ b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FixedIntegerRangeEncoderTest.java
@@ -132,6 +132,6 @@ public void testDecode10() {
@Test
public void testGiantRange() {
String max = FibonacciIntegerEncoder.encode(FibonacciIntegerRangeEncoder.MAX_SIZE + 1);
- Assertions.assertEquals(List.of(), FixedIntegerRangeEncoder.decode("00000000000110000000000000001" + max));
+ Assertions.assertEquals(new ArrayList<>(), FixedIntegerRangeEncoder.decode("00000000000110000000000000001" + max));
}
}
diff --git a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/.UsNatV1Test.java.swp b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/.UsNatV1Test.java.swp
deleted file mode 100644
index 686ae751..00000000
Binary files a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/.UsNatV1Test.java.swp and /dev/null differ
diff --git a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/UsMnTest.java b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/UsMnTest.java
new file mode 100644
index 00000000..3b397757
--- /dev/null
+++ b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/UsMnTest.java
@@ -0,0 +1,171 @@
+package com.iab.gpp.encoder.section;
+
+
+import com.iab.gpp.encoder.error.DecodingException;
+import com.iab.gpp.encoder.error.ValidationException;
+import com.iab.gpp.encoder.field.UsMnField;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.Arrays;
+
+public class UsMnTest {
+
+ @Test
+ public void testEncode1() {
+ UsMn usMn = new UsMn();
+ Assertions.assertEquals("BAAAAAQA.QA", usMn.encode());
+ }
+
+ @Test
+ public void testEncode2() {
+ UsMn usMn = new UsMn();
+
+ usMn.setFieldValue(UsMnField.PROCESSING_NOTICE, 1);
+ usMn.setFieldValue(UsMnField.SALE_OPT_OUT_NOTICE, 1);
+ usMn.setFieldValue(UsMnField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, 1);
+ usMn.setFieldValue(UsMnField.SALE_OPT_OUT, 1);
+ usMn.setFieldValue(UsMnField.TARGETED_ADVERTISING_OPT_OUT, 1);
+ usMn.setFieldValue(UsMnField.SENSITIVE_DATA_PROCESSING, Arrays.asList(2, 1, 0, 2, 1, 0, 2, 1));
+ usMn.setFieldValue(UsMnField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, 1);
+ usMn.setFieldValue(UsMnField.ADDITIONAL_DATA_PROCESSING_CONSENT, 1);
+ usMn.setFieldValue(UsMnField.MSPA_COVERED_TRANSACTION, 1);
+ usMn.setFieldValue(UsMnField.MSPA_OPT_OUT_OPTION_MODE, 1);
+ usMn.setFieldValue(UsMnField.MSPA_SERVICE_PROVIDER_MODE, 2);
+ usMn.setFieldValue(UsMnField.GPC, true);
+
+ Assertions.assertEquals("BVWSSVWA.YA", usMn.encode());
+ }
+
+ @Test
+ public void testSetInvalidValues() {
+ UsMn usMn = new UsMn();
+
+ try {
+ usMn.setFieldValue(UsMnField.PROCESSING_NOTICE, 3);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.SALE_OPT_OUT_NOTICE, 3);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.TARGETED_ADVERTISING_OPT_OUT_NOTICE, 3);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.SALE_OPT_OUT, 3);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.TARGETED_ADVERTISING_OPT_OUT, -1);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.SENSITIVE_DATA_PROCESSING, Arrays.asList(0, 1, 2, 3, 1, 2, 0, 1));
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.KNOWN_CHILD_SENSITIVE_DATA_CONSENTS, 3);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.ADDITIONAL_DATA_PROCESSING_CONSENT, 3);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.MSPA_COVERED_TRANSACTION, 0);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.MSPA_OPT_OUT_OPTION_MODE, 4);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+
+ try {
+ usMn.setFieldValue(UsMnField.MSPA_SERVICE_PROVIDER_MODE, -1);
+ Assertions.fail("Expected ValidationException");
+ } catch (ValidationException e) {
+
+ }
+ }
+
+ @Test
+ public void testEncodeWithGpcSegmentExcluded() {
+ UsMn usMn = new UsMn();
+ usMn.setFieldValue(UsMnField.GPC_SEGMENT_INCLUDED, false);
+ Assertions.assertEquals("BAAAAAQA", usMn.encode());
+ }
+
+ @Test
+ public void testDecode1() throws DecodingException {
+ UsMn usMn = new UsMn("BVWSSVWA.YA");
+
+ Assertions.assertEquals(1, usMn.getProcessingNotice());
+ Assertions.assertEquals(1, usMn.getSaleOptOutNotice());
+ Assertions.assertEquals(1, usMn.getTargetedAdvertisingOptOutNotice());
+ Assertions.assertEquals(1, usMn.getSaleOptOut());
+ Assertions.assertEquals(1, usMn.getTargetedAdvertisingOptOut());
+ Assertions.assertEquals(Arrays.asList(2, 1, 0, 2, 1, 0, 2, 1), usMn.getSensitiveDataProcessing());
+ Assertions.assertEquals(1, usMn.getKnownChildSensitiveDataConsents());
+ Assertions.assertEquals(1, usMn.getAdditionalDataProcessingConsent());
+ Assertions.assertEquals(1, usMn.getMspaCoveredTransaction());
+ Assertions.assertEquals(1, usMn.getMspaOptOutOptionMode());
+ Assertions.assertEquals(2, usMn.getMspaServiceProviderMode());
+ Assertions.assertEquals(true, usMn.getGpc());
+ }
+
+ @Test
+ public void testDecodeWithGpcSegmentExcluded() throws DecodingException {
+ UsMn usMn = new UsMn("BVWSSVWA");
+
+ Assertions.assertEquals(1, usMn.getProcessingNotice());
+ Assertions.assertEquals(1, usMn.getSaleOptOutNotice());
+ Assertions.assertEquals(1, usMn.getTargetedAdvertisingOptOutNotice());
+ Assertions.assertEquals(1, usMn.getSaleOptOut());
+ Assertions.assertEquals(1, usMn.getTargetedAdvertisingOptOut());
+ Assertions.assertEquals(Arrays.asList(2, 1, 0, 2, 1, 0, 2, 1), usMn.getSensitiveDataProcessing());
+ Assertions.assertEquals(1, usMn.getKnownChildSensitiveDataConsents());
+ Assertions.assertEquals(1, usMn.getAdditionalDataProcessingConsent());
+ Assertions.assertEquals(1, usMn.getMspaCoveredTransaction());
+ Assertions.assertEquals(1, usMn.getMspaOptOutOptionMode());
+ Assertions.assertEquals(2, usMn.getMspaServiceProviderMode());
+ Assertions.assertEquals(false, usMn.getGpcSegmentIncluded());
+ }
+
+ @Test()
+ public void testDecodeGarbage() {
+ Assertions.assertThrows(DecodingException.class, () -> {
+ new UsMn("z").getProcessingNotice();
+ });
+ }
+}
diff --git a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/UsNatTest.java b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/UsNatTest.java
index 67029545..4d32c057 100644
--- a/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/UsNatTest.java
+++ b/iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/UsNatTest.java
@@ -228,6 +228,28 @@ public void testDecodeWithGpcSegmentExcluded() throws DecodingException {
Assertions.assertEquals(2, usNat.getMspaServiceProviderMode());
Assertions.assertEquals(false, usNat.getGpcSegmentIncluded());
}
+
+ @Test
+ public void testDecodeBackwardsCompatibility() throws DecodingException {
+ UsNat usNat = new UsNat("BVQqAAAACg");
+
+ Assertions.assertEquals(1, usNat.getSharingNotice());
+ Assertions.assertEquals(1, usNat.getSaleOptOutNotice());
+ Assertions.assertEquals(1, usNat.getSharingOptOutNotice());
+ Assertions.assertEquals(1, usNat.getTargetedAdvertisingOptOutNotice());
+ Assertions.assertEquals(0, usNat.getSensitiveDataProcessingOptOutNotice());
+ Assertions.assertEquals(0, usNat.getSensitiveDataLimitUseNotice());
+ Assertions.assertEquals(2, usNat.getSaleOptOut());
+ Assertions.assertEquals(2, usNat.getSharingOptOut());
+ Assertions.assertEquals(2, usNat.getTargetedAdvertisingOptOut());
+ Assertions.assertEquals(Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), usNat.getSensitiveDataProcessing());
+ Assertions.assertEquals(Arrays.asList(0, 0, 0), usNat.getKnownChildSensitiveDataConsents());
+ Assertions.assertEquals(2, usNat.getPersonalDataConsents());
+ Assertions.assertEquals(2, usNat.getMspaCoveredTransaction());
+ Assertions.assertEquals(0, usNat.getMspaOptOutOptionMode());
+ Assertions.assertEquals(0, usNat.getMspaServiceProviderMode());
+ Assertions.assertEquals(false, usNat.getGpc());
+ }
@Test()
public void testDecodeGarbage() {
diff --git a/iabgpp-extras-jackson/pom.xml b/iabgpp-extras-jackson/pom.xml
index 99819c6e..bd0d839c 100644
--- a/iabgpp-extras-jackson/pom.xml
+++ b/iabgpp-extras-jackson/pom.xml
@@ -7,10 +7,11 @@
iabgpp-core
com.iabgpp
- 3.2.5-SNAPSHOT
+ 3.2.6-SNAPSHOT
iabgpp-extras-jackson
+ IAB GPP Extras Jackson
jar
@@ -24,7 +25,7 @@
com.iabgpp
iabgpp-extras
- 3.2.5-SNAPSHOT
+ 3.2.6-SNAPSHOT
diff --git a/iabgpp-extras/pom.xml b/iabgpp-extras/pom.xml
index 592a99ad..61879021 100644
--- a/iabgpp-extras/pom.xml
+++ b/iabgpp-extras/pom.xml
@@ -7,10 +7,11 @@
com.iabgpp
iabgpp-core
- 3.2.5-SNAPSHOT
+ 3.2.6-SNAPSHOT
iabgpp-extras
+ IAB GPP Extras
jar
diff --git a/pom.xml b/pom.xml
index 892005fc..5d5bd6a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.iabgpp
iabgpp-core
- 3.2.5-SNAPSHOT
+ 3.2.6-SNAPSHOT
IAB GPP Core Library
https://github.com/IABTechLabs/iabtcf-java
Encode and decode consent information with the IAB GPP v3.0.
@@ -40,11 +40,7 @@
Sonatype Nexus Snapshots
https://s01.oss.sonatype.org/content/repositories/snapshots/
-
- sonatype-nexus-staging
- Nexus Release Repository
- https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
-
+
@@ -113,6 +109,17 @@
release
+
+ org.sonatype.central
+ central-publishing-maven-plugin
+ 0.10.0
+ true
+
+ central
+ true
+ published
+
+
org.apache.maven.plugins
maven-source-plugin