REVA-165: GPP US-States (MN/MD/IN/KY/RI) + IAB TCF v2.3#6
Merged
revcontent-paperclip[bot] merged 3 commits intoJun 17, 2026
Merged
Conversation
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]>
This was referenced Jun 17, 2026
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 declaredUsMinnesotaSID).What's included
1. New GPP US-State parsers (with tests, reusing
MspaParsedConsent):usmn)…SensitiveData(8), KnownChild(1), AdditionalData, MspaCovered, MspaOptOutOptionMode, MspaServiceProviderModeusmd)MspaVersion, MspaCovered, MspaMode, …AdditionalData(no KnownChild / no sensitive-data); subsection 1 = GPCusin)KnownChild Int(2)); subsection 1 = Sensitive Data Consentsusky)usri)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 separateMspaOptOutOptionMode/MspaServiceProviderMode, the core ordering leads withMspaVersion, 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 mapsTCFPolicyVersion == 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 tov2.0–v2.3.Verification
go build ./...— cleango test ./...— PASS (55 gocheck assertions, 0 failures)TestParseUsMd,TestParseUsInKyRi,TestParseUsMdViaGppString,TestParseUsStateV2Errors,TestMinorVersion(TCF v2.3),TestParseMSPA/TestParseMSPAError(Minnesota fixtures).Notes for reviewer
mastermerge to human review per governance.🤖 Generated with Claude Code