Skip to content

test: update trust anchor examples/fixtures for anchors array - #305

Closed
scouten-adobe wants to merge 3 commits into
mainfrom
docs/sdk-trust-examples-and-fixtures
Closed

test: update trust anchor examples/fixtures for anchors array#305
scouten-adobe wants to merge 3 commits into
mainfrom
docs/sdk-trust-examples-and-fixtures

Conversation

@scouten-adobe

@scouten-adobe scouten-adobe commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

PR contentauth/c2pa-rs#2545 replaces Trust.trust_anchors / Trust.user_anchors (both Option<String>) with Trust.anchors (Option<Vec<TrustAnchor>>), where each TrustAnchor carries trust_anchors, trust_uri, and trust_kind. This updates the remaining examples/fixtures that still use the old flat fields so they match the new schema once that PR lands:

  • sdk/examples/c2pa.toml -- the commented-out [trust] template now shows [[trust.anchors]] instead of top-level trust_anchors/user_anchors. (Stays in contentauth/c2pa-rs -- sdk/ isn't part of this repo.)
  • tests/fixtures/trust/cawg_sign_settings.toml and tests/fixtures/trust/cawg_test_settings.toml -- both used [trust] trust_anchors = "..." (the C2PA-level trust, not cawg_trust, which is a separate, unaffected struct); restructured to [[trust.anchors]] with trust_uri and trust_kind = "signer", matching the convention contentauth/c2pa-rs#2388 itself uses in sdk/tests/fixtures/test_settings.toml.

Test plan

  • Verified all 3 files parse as valid TOML.
  • Ran cargo test -p c2patool --test integration cawg against current main -- all 4 CAWG integration tests still pass (the unknown [[trust.anchors]] key is currently ignored, since main doesn't yet have the anchors field; this becomes load-bearing once fix: C2PA 2.3 reporting c2pa-rs#2388 merges).
  • Re-verify once fix: C2PA 2.3 reporting c2pa-rs#2388 merges that these fixtures still produce a trusted validation result under the new schema.

Migrated from contentauth/c2pa-rs#2436 as part of the c2patool repo split. Only the two cli/tests/fixtures/trust/*.toml changes (now tests/fixtures/trust/*.toml) carried over here; the sdk/examples/c2pa.toml edit stays in the c2pa-rs PR.

crandmck and others added 3 commits August 6, 2026 14:14
PR contentauth/c2pa-rs#2388 replaces Trust.trust_anchors / Trust.user_anchors with
Trust.anchors (an array of TrustAnchor: trust_anchors, trust_uri,
trust_kind). Update the commented-out example in sdk/examples/c2pa.toml
and the two CLI trust fixtures that still used the old flat fields, so
they match the schema once that PR lands.

Verified cli/tests/integration.rs cawg_* tests still pass against
current main (the unknown [[trust.anchors]] key is ignored until
contentauth/c2pa-rs#2388 merges).
@scouten-adobe

Copy link
Copy Markdown
Collaborator Author

Closing as superseded. This was migrated from contentauth/c2pa-rs#2436 during the c2patool repo split, but both fixture files it touches (tests/fixtures/trust/cawg_sign_settings.toml and tests/fixtures/trust/cawg_test_settings.toml) were independently and correctly migrated to the [[trust.anchors]] schema by contentauth/c2pa-rs#2545 before the split landed.

Merging this PR as-is would actually break settings parsing: it conflicts with main on cawg_sign_settings.toml, and both files use trust_kind = "signer", which no longer exists (#2545 named the enum variant manifest, not signer). I confirmed against current main:

ERR: unknown variant `signer`, expected one of `manifest`, `tsa`, `cawg`

I found and fixed the identical issue while resolving merge conflicts on the sibling PR, contentauth/c2pa-rs#2436. Nothing here needs to be carried forward.

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.

3 participants