Skip to content

Conversation

@ok-nick
Copy link
Contributor

@ok-nick ok-nick commented Jul 24, 2025

Changes in this pull request

Define Actions::source_type as an enum so user's no longer need to manually specify the entire URL.

Questions

  • Do we want to provide the Other(String) variant or ensure they are only what we support?
    • This has the flexibility that it supports future c2pa versions but it can allow for incorrect URLs.
  • A side-effect of this implementation is that we allow digital source types to be deserialized as, e.g. digsrctype:digitalCapture in addition to the URL, which is technically incorrect according to the spec but offers a much more convenient JSON manifest/settings definition.

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.

@ok-nick ok-nick force-pushed the ok-nick/source-type-enum branch from ee9966b to ceb354e Compare July 25, 2025 18:54
@ok-nick ok-nick requested a review from gpeacock August 1, 2025 13:57
@ok-nick
Copy link
Contributor Author

ok-nick commented Aug 1, 2025

The failing test actually caught 2 issues: one that I should've untagged the DigitalSourceType::Other variant and second, our CAWG assets have invalid IPTC source type URLs.

Copy link
Collaborator

@gpeacock gpeacock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, It's great having this.

@crandmck crandmck added the needs-doc Any change that affects user documentation label Aug 1, 2025
@ok-nick
Copy link
Contributor Author

ok-nick commented Aug 1, 2025

@gpeacock I'm not sure if it is a mistake in the spec, but the C2PA empty digital source type is defined as part of the digsrctype namspace here:
https://c2pa.org/digitalsourcetype/empty/
Screenshot 2025-08-01 at 5 15 58 PM

Copy link
Collaborator

@gpeacock gpeacock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I just have one more question about using the digsrctype prefixes. I'm not sure we need those in the context in which we would be using this:

"digtialSourceType": "digsrctype:digitalCapture".
vs
"digtialSourceType": "digitalCapture".

@ok-nick ok-nick force-pushed the ok-nick/source-type-enum branch from 30328f8 to 3684ab9 Compare August 13, 2025 15:32
@ok-nick ok-nick merged commit 8a96b33 into main Aug 13, 2025
20 of 21 checks passed
@ok-nick ok-nick deleted the ok-nick/source-type-enum branch August 13, 2025 17:27
@caiopensrc caiopensrc mentioned this pull request Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-doc Any change that affects user documentation safe to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants