Skip to content

Byh/ingredient digital source type support#2078

Open
trufo-ai wants to merge 2 commits into
contentauth:mainfrom
trufo-ai:byh/ingredient-digital-source-type-support
Open

Byh/ingredient digital source type support#2078
trufo-ai wants to merge 2 commits into
contentauth:mainfrom
trufo-ai:byh/ingredient-digital-source-type-support

Conversation

@trufo-ai
Copy link
Copy Markdown

@trufo-ai trufo-ai commented Apr 20, 2026

Changes in this pull request

Give a narrative description of what has been changed.

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

Add digital_source_type field to Ingredient, allowing callers to specify
an IPTC digital source type URI on ingredients that lack their own C2PA
manifest, per C2PA v2.4 §18.16.12.3.

- Add digital_source_type field to both ingredient assertion and public
  Ingredient structs
- Serialize/deserialize as "digitalSourceType" in CBOR and JSON
- Enforce mutual exclusivity with activeManifest during serialization
- Include field in V3 allowed-fields list
- Propagate through merge, to_assertion, and from_assertion paths
- Add getter and setter on Ingredient
Cover the new digitalSourceType field in existing and new tests:

- Add setter/getter coverage to test_ingredient_api alongside other fields
- Add digital_source_type: None to test_serialization struct literal
- Add test_digital_source_type_in_ingredient: v3 CBOR round-trip with
  digitalSourceType set (no active_manifest), and mutual exclusivity
  check when both digitalSourceType and active_manifest are present
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.

1 participant