Skip to content

Conversation

@dmueller
Copy link

@dmueller dmueller commented Aug 12, 2025

Possibly related issues

Problem

GPP strings encoded with the UsNat section are being encoded not in accordance to the spec.

Version 1 UsNat section should have 12 values for SensitiveDataProcessing and 2 values for KnownChildSensitiveDataConsents. https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/us-va_1.0/Sections/US-National/IAB%20Privacy%E2%80%99s%20National%20Privacy%20Technical%20Specification.md

Version 2 UsNat section has 16 values for SensitiveDataProcessing and 3 values for KnownChildSensitiveDataConsents

The support for the extra values was added in #67 UsNatCoreSegment.ts, but the VERSION constant was not updated. This means that the UsNat consent strings are being encoded as Version 1 but having 16 and 3 values for SensitiveDataProcessing and KnownChildSensitiveDataConsents

Adjustments

  1. Adjust the VERSION for UsNat, since this always encodes a Version 2 string.
  2. Add tests for parsing Version 1 strings to demonstrate they do get added 0s for the two expanded fields.
  3. Update UsNat tests to adjust the syntax. The tests as written were not actually working for me; I could adjust them in place and they would never fail.

Open Question

When parsing a Version 1 string, should the Version be updated to Version 2 in the internal storage? If a Version 1 string is decoded and then encoded, the result will be a Version 2 string. I think this would mainly help with confusion, to avoid the object indicating it is Version 1 while having expanded field values; even if they were padded with 0s for the additional options.

The package-lock.json updated when running npm install, so I included it.

@dmueller dmueller marked this pull request as ready for review August 12, 2025 18:40
Copy link

@efixler efixler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uc-bsam
Copy link

uc-bsam commented Oct 23, 2025

@chuff i think it makes sense to combine this with #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants