Skip to content

specs: accept JSON whitespace in token and identity responses - #32

Closed
Wondertan wants to merge 1 commit into
specs/token-request-reveals-its-headersfrom
specs/json-field-whitespace
Closed

specs: accept JSON whitespace in token and identity responses#32
Wondertan wants to merge 1 commit into
specs/token-request-reveals-its-headersfrom
specs/json-field-whitespace

Conversation

@Wondertan

@Wondertan Wondertan commented Sep 10, 2026

Copy link
Copy Markdown
Member

GitHub’s real /user response contains valid JSON whitespace after colons, but the compact field templates reject it. Define JSON whitespace consistently for X/GitHub token and identity transcript readers, including whitespace before integer terminators. Preserve original attested bytes, contiguous reveal ranges, bearer-only commitments, canonical values, and duplicate detection across accepted spellings.

Adds REQ-COMMON-19F and TEST-COMMON-10A, and aligns the GitHub terminator requirement. OIDC circuit extraction is outside this change.

Stacked on #31 so its header/framing updates remain authoritative. This is the specification prerequisite for ceremony #28, libid-rs #20, and contracts #36; a separate Bridge patch consumes the Rust fix.

Validation: security/correctness, API/ownership and simplicity reviews are clear. Companion implementations passed 296 TypeScript, 54 Rust transcript and 318 contract tests. Spec lint retains pre-existing suite findings; no new findings were introduced.

Standalone Bridge implementation: libid-server-rs #11, based on token-exchange PR #8 without callback/localhost prerequisites.

Define one grammar for token and identity field prefixes while preserving original bytes, contiguous reveals, bearer-only commitments and duplicate detection.

Assisted-by: GPT-6
Signed-off-by: Wondertan <hlibwondertan@gmail.com>
xgreenx added a commit that referenced this pull request Sep 11, 2026
GitHub pretty-prints `/user` for the media type the profile pins, so the
compact delimiters this specification spells matched nothing it serves.
REQ-COMMON-19F fixes what libid-org/libid-contracts#37 does: the Platform
Verifier removes the JSON whitespace touching a structural byte and matches,
counts and reads over what is left; the Implementation reveals a member as
the wire carried it, whitespace inside, and never commits that whitespace
with a bearer; the compact spellings name the member after removal.
TEST-COMMON-10A lists the vectors. REQ-PLAT-51 judges GitHub's terminator
after that removal and REQ-PLAT-60 keeps the whitespace in the reveal.

Carries the vectors of #32 in the form the merged verifier
implements.

Co-authored-by: Wondertan <hlibwondertan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: xgreenx <xgreenx9999@gmail.com>
@xgreenx

xgreenx commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Closing in favor of #31, which now carries this rule as REQ-COMMON-19F with TEST-COMMON-10A — in the form the merged verifier implements: libid-org/libid-contracts#37 removes the JSON whitespace touching a structural byte before it matches, counts and reads, rather than matching a whitespace-aware delimiter as #36 did. The one sentence here that verifier cannot satisfy is "MUST NOT reconstruct it by dropping whitespace"; everything else — bytes revealed at their offsets, one contiguous range, bearer without prefix whitespace, duplicates counted across spellings, the GitHub terminator — is in #31, and your vector list was the base for TEST-COMMON-10A, credited as co-author.

@xgreenx xgreenx closed this Sep 11, 2026
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.

2 participants