Skip to content

Conversation

@tladesignz
Copy link

Changes in this pull request

This is a minimal implementation of

https://opensource.contentauthenticity.org/docs/manifest/json-ref/manifest-def
https://opensource.contentauthenticity.org/docs/manifest/writing/assertions-actions

and some related references:

https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_uri_references
https://cv.iptc.org/newscodes/imageregiontype/
https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_actions
https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_standard_c2pa_assertion_summary
https://spec.c2pa.org/specifications/specifications/1.0/specs/C2PA_Specification.html#_existing_manifests

This enables rendering and parsing of - at least - a minimal example like

import C2PA

let manifest = ManifestDefinition(
            assertions: [.actions(actions: [Action(action: .created, digitalSourceType: .digitalCapture)])],
            claimGeneratorInfo: [.init(operatingSystem: ClaimGeneratorInfo.operatingSystem)],
            format: mimeType,
            title: String(format: "c2pa-cam_%@.%@", timestamp.iso8601, ext))

print(manifest.description)

let builder = try Builder(manifestJSON: manifest.description)

Will render

{
    "claim_generator_info": [{
        "version": "0.1.0",
        "operating_system": "iOS 26.0.1",
        "name": "c2pa-cam"
    }],
    "claim_version": 1,
    "ingredients": [],
    "title": "c2pa-cam_2025-11-06T17.30.26.688+01.00.heic",
    "assertions": [{
        "data": {
            "actions": [{
                "action": "c2pa.created",
                "digitalSourceType": "http:\/\/cv.iptc.org\/newscodes\/digitalsourcetype\/digitalCapture",
                "softwareAgent": "c2pa-cam"
            }]
        },
        "label": "c2pa.actions"
    }],
    "format": "image\/heic"
}

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 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

@tladesignz
Copy link
Author

For context: I'm working with @redaranj for the Guardian Project.

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 83.03167% with 75 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.05%. Comparing base (006a8da) to head (d972922).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
Library/Sources/Manifest/AssertionDefinition.swift 57.30% 38 Missing ⚠️
TestShared/Sources/ManifestTests.swift 73.43% 34 Missing ⚠️
Library/Sources/Manifest/ClaimGeneratorInfo.swift 83.33% 2 Missing ⚠️
Library/Sources/Manifest/ManifestDefinition.swift 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   57.54%   61.05%   +3.51%     
==========================================
  Files          20       48      +28     
  Lines        2744     3184     +440     
==========================================
+ Hits         1579     1944     +365     
- Misses       1165     1240      +75     
Flag Coverage Δ
unittests 61.05% <83.03%> (+3.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

redaranj and others added 3 commits November 19, 2025 18:07
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