Set the digitalSourceType of c2pa_sign manifests from the resolved disclosure

Problem/Motivation

C2PA Sign (c2pa_sign) signs uploads and image style derivatives with c2patool. Its manifests carry no digitalSourceType from the AI disclosure of the file, and the "AI disclosure icon" effect shows up as c2pa.unknown.

c2pa_sign 1.4.11 dispatches ManifestCreateEvent before signing, but the event does not expose the file. For a derivative it carries no entity either. The module signs derivatives on kernel.response of the image.style_public and image.style_private routes, after the icon and the XMP are in the file.

Proposed resolution

No dependency on c2pa_sign:

  • c2paAction() and c2paMetadata() on the icon effect, which c2pa_sign reads when they exist: c2pa.edited.
  • A subscriber to c2pa_sign_manifest_create_event. On an image style route it finds the original from the request, as c2pa_sign does. It sets the IPTC digitalSourceType of the resolved disclosure on the c2pa.created action. A c2pa.opened action is left alone, the provider's manifest already says it.
  • The subscriber drops the c2pa.edited action when the effect did not draw the icon on that file.

Remaining tasks

  • Effect methods and the subscriber
  • Kernel tests with a stand-in event, since c2pa_sign is not a dev dependency
  • Docs: only derivatives served through the image style routes are signed

Part of #80 (closed).

AI Compliance

🤖 Generated with the help of an LLM, reviewed and approved by me before posting.

Edited by Giorgio Alfredo Pagano