Skip to content

REVA-165: GPP US-States (MN/MD/IN/KY/RI) + IAB TCF v2.3#6

Merged
revcontent-paperclip[bot] merged 3 commits into
masterfrom
REVA-165-gpp-us-states-gdpr-2.3
Jun 17, 2026
Merged

REVA-165: GPP US-States (MN/MD/IN/KY/RI) + IAB TCF v2.3#6
revcontent-paperclip[bot] merged 3 commits into
masterfrom
REVA-165-gpp-us-states-gdpr-2.3

Conversation

@revcontent-paperclip

Copy link
Copy Markdown

REVA-165 — GPP US-States (MN/MD/IN/KY/RI) + IAB TCF v2.3

Consolidates the two sibling branches (REV-28, REV-32) into a single, conflict-free, test-verified deliverable for REVA-165. Supersedes #4 and #5, which conflict with each other (both declared UsMinnesotaSID).

What's included

1. New GPP US-State parsers (with tests, reusing MspaParsedConsent):

State SID Spec format Core fields
Minnesota (usmn) 23 older flat layout 12: …SensitiveData(8), KnownChild(1), AdditionalData, MspaCovered, MspaOptOutOptionMode, MspaServiceProviderMode
Maryland (usmd) 24 newer layout 9: MspaVersion, MspaCovered, MspaMode, …AdditionalData (no KnownChild / no sensitive-data); subsection 1 = GPC
Indiana (usin) 25 newer 10 (+KnownChild Int(2)); subsection 1 = Sensitive Data Consents
Kentucky (usky) 26 newer same as IN
Rhode Island (usri) 27 newer same as IN

The newer sections (MD/IN/KY/RI, IAB Oct-2025 v1.0 specs) genuinely differ from the older flat sections: a combined MspaMode Int(2) replaces the separate MspaOptOutOptionMode/MspaServiceProviderMode, the core ordering leads with MspaVersion, MspaCoveredTransaction, MspaMode, and sensitive-data moves to a dedicated subsection. Minnesota (SID 23, older spec) keeps the flat layout — hence two parser styles. Every field layout was verified field-by-field against the canonical IAB section specs (not just self-generated vectors).

2. IAB TCF v2.3 support: V2ParsedConsent.MinorVersion() now maps TCFPolicyVersion == 5 → minor 3. v2.3 did not change the Core String bit layout (it only made the Disclosed Vendors segment mandatory), so the existing v2 parser handles v2.3 strings unchanged. README updated to v2.0–v2.3.

Verification

  • go build ./... — clean
  • go test ./...PASS (55 gocheck assertions, 0 failures)
  • New/updated checks exercised: TestParseUsMd, TestParseUsInKyRi, TestParseUsMdViaGppString, TestParseUsStateV2Errors, TestMinorVersion (TCF v2.3), TestParseMSPA/TestParseMSPAError (Minnesota fixtures).

Notes for reviewer

🤖 Generated with Claude Code

OctoCTO and others added 2 commits June 17, 2026 20:08
Implements the IAB GPP Minnesota US-State section (Section ID 23, prefix
usmn) following its technical specification. Minnesota's core layout is
identical to the existing Texas/Tennessee parsers (Processing/Sale/
TargetedAdvertising notices, Sale/TargetedAdvertising opt-outs, an 8-entry
SensitiveDataProcessing bitfield, a single KnownChild consent, Additional
DataProcessingConsent, MspaCoveredTransaction, and separate MspaOptOut
OptionMode/MspaServiceProviderMode), so it reuses the existing
MspaParsedConsent struct and ConsentReader helpers and the GPC subsection
path.

Also adds IAB TCF (GDPR) v2.3 support: TCFPolicyVersion 5 now maps to
minor version 3 in V2ParsedConsent.MinorVersion() instead of erroring.
TCF v2.3 did not change the Core String bit layout (it only made the
Disclosed Vendors segment mandatory), so the existing v2 parser handles
v2.3 strings unchanged.

Tests: add usmn decode fixtures (with and without a GPC subsection),
add Minnesota to the MSPA error-path table, and update the MinorVersion
test so policy version 5 resolves to v2.3 (minor 3) with a new policy
version 6 unsupported-boundary case.

Co-Authored-By: Paperclip <[email protected]>
Implement IAB GPP US-State parsers for Maryland (24), Indiana (25),
Kentucky (26), and Rhode Island (27).

These sections differ from the older flat US-State sections in their core
field set, but use the same segment layout: section value = core segment
(segment 0) + optional subsection (segment 1), split on ".". The spec's
"Section Header" (SectionID/Version/SubSections) is part of the client-side
API representation and is NOT serialized into the encoded payload.

- Combined MspaMode Int(2) field (0=N/A, 1=Opt-Out Option, 2=Service
  Provider) replacing the separate OptOutOption/ServiceProvider fields.
  Core ordering: MspaVersion, MspaCoveredTransaction, MspaMode first.
- MD core omits SensitiveDataProcessing + KnownChildSensitiveDataConsents;
  MD subsection 1 is the legacy GPC subsection (carries SubsectionType).
- IN/KY/RI core adds a single KnownChildSensitiveDataConsents Int(2);
  subsection 1 is "Sensitive Data Consents" (N-Bitfield(2,8), no type prefix).
- Section IDs 24-27 added; dispatch wired through NewMspa / MapGppSectionToParser.

Wire format + field layout verified against the canonical IAB reference
encoder/decoder and test vectors in iabgpp-es PR #106 (UsMd "BQAA.QA" /
"BVVU.YA"; UsIn/UsKy/UsRi "BQAA.AAA" / "BVVV.kkk"). Tests decode those
canonical strings per state, plus an end-to-end ParseGppConsent routing test.
Build + full suite green.

Co-Authored-By: Paperclip <[email protected]>
Addresses reviewer feedback on PR #6:

1. Refactor mspa_sections.go: extract the shared decode/version/GPC-subsection
   envelope into parseMspaSection(); each flat US-State/US-National section now
   supplies only its core field reads via a readCore closure. Removes 17 copies
   of the identical scaffolding (-416 lines), no behavior change — full existing
   fixture + error suites stay green.

2. mspa_us_state_v2_test.go: add representative mixed-value, fixture-style tests
   for MD/IN/KY/RI (notices, opt-outs, MspaMode, known-child, per-category
   sensitive data, GPC true/false), modelled on mspa_parsed_consent_fixture_test.go.
   Vectors are minted by a small core/sensitive encoder that is pinned to the
   canonical iabgpp-es PR #106 reference vectors (BQAA/BVVU/BVVV/AAA/kkk) by
   TestUsStateV2EncoderMatchesCanonicalVectors, so they are real canonical
   encodings, then round-tripped through NewMspa(...).ParseConsent().

Co-Authored-By: Paperclip <[email protected]>
@revcontent-paperclip
revcontent-paperclip Bot merged commit 997f477 into master Jun 17, 2026
@revcontent-paperclip
revcontent-paperclip Bot deleted the REVA-165-gpp-us-states-gdpr-2.3 branch June 17, 2026 22:26
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.

0 participants