Skip to content

Add build_unsigned_with_eqty_contexts helper#22

Merged
makew0rld merged 1 commit into
mainfrom
add-eqty-vc-builder
May 21, 2026
Merged

Add build_unsigned_with_eqty_contexts helper#22
makew0rld merged 1 commit into
mainfrom
add-eqty-vc-builder

Conversation

@makew0rld
Copy link
Copy Markdown
Contributor

The previous downstream pattern in integrity-monorepo had two call sites
(vcomp evidence VC, policy compliance VC) each manually constructing a
`JsonCredential` via `JsonCredential::new(...)` + `context.insert(...)`,
reaching directly into ssi (`IdOr`, `NonEmptyVec`, `NonEmptyObject`,
`ContextEntry::IriRef`), iref (`UriBuf`, `IriRefBuf`), and xsd-types
(`DateTimeStamp`). That meant every caller had to learn the ssi-internal
type marshalling, and the EQTY context bundle (v2 base + security/v2 +
`ig_common_context_link()`) was restated inline in two places — risking
drift if a third entry is ever added.

Move that ceremony upstream. Callers now hand over their semantic inputs
(id, issuer DID, subject JSON, optional valid_from / valid_until, and
evidence entries as JSON values) and get back an unsigned `JsonCredential`
ready to feed to `sign_vc`. The EQTY-flavored `@context` bundle is
attached by the helper, so changes to the bundle live in one place.

Tests cover:
- vcomp-shape VC (subject + custom EQTY evidence terms) — sign and verify
  end-to-end through the new helper.
- compliance-shape VC (policy-subject struct, `valid_until` set,
  no evidence) — same.
- Non-object subject rejected with a clear error rather than a panic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@makew0rld makew0rld requested a review from TJbrunk May 21, 2026 20:12
@makew0rld makew0rld merged commit f589ebc into main May 21, 2026
2 of 3 checks passed
@makew0rld makew0rld deleted the add-eqty-vc-builder branch May 21, 2026 20:17
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