Skip to content

Commit bd373e1

Browse files
tmathernTania Matherndependabot[bot]crandmck
authored
feat: Enable trust by default, add Context+Settings API, bump c2pa-rs (#192)
* feat: c2pa-rs and c2pa_c_ffi 0.68.0 update (#189) * feat: Prepare 0.68.0 update * fix: Load trust for some tests * fix: Trust settings * fix: Update tests * fix: Restore deleted file * fix: Update the examples * fix: Clarify comment * fix: CLean up old tmp test * fix: Switch to json * fix: Add sign all files test with V2 spec * fix: Remove toml example * chore: Update c2pa version from v0.68.0 to v0.69.0 (#190) * Update c2pa version from v0.68.0 to v0.69.0 * fix: Test version number check * fix: Version bump from c2pa-rs and c2pa-c-ffi from v0.69.0 to v0.70.0 (#191) * fix: Version bump from c2pa-rs v0.70.0 to v0.71.0 (#193) * feat: Add set_intent APIs (#194) * fix: Version bump * fix: New bindings * fix: Initial bindings * fix: Few more tests * fix: Add a test * fix: Renamings * chore: c2pa-v0.71.1 * chore: c2pa-v0.71.1 * fix: Update tests * fix: Clean up logs * fix: Clean up logs from native lib * chore: Update c2pa version to v0.72.0 (#198) * chore: Update c2pa version to v0.72.0 * chore: Update expected SDK version in unit tests * chore: Update c2pa version to v0.72.1 (#200) * chore: Update c2pa version to v0.72.1 * chore: Update c2pa version to v0.72.1 * fix: Makefile indent typo * fix: Update the tests * chore: Update c2pa version to v0.73.0 (#201) * chore: Update c2pa version to v0.73.0 * chore: Update expected SDK version in unit test * fix: Remove retired runner * fix: Update retired runner * fix: Update retired runner 2 * fix: Update retired runner 3 * chore: Update c2pa version to v0.73.1 (#204) * chore: Update c2pa version to v0.73.1 * fix: Update expected SDK version in unit test * chore: Update to native version 0.73.2 (#210) * chore: Update expected SDK version in unit test * chore: Update c2pa version to v0.73.2 * fix: Improve typings for errors (#213) * fix: Clarify version docs * fix: Add the test that verifies direct instance throws * fix: Add the tests for the factory method * fix: Add tests for from_asset * fix: Add tests * fix: Typos in docs * fix: Add docs * fix: Docs * fix: Typo * fix: Rename method * fix: Exception classes hierarchy * fix: COmment typos... * fix: Typos in comments * fix: In examples, add link to the app repo example * fix: In examples, add link to the app repo example * fix: In examples, add link to the app repo example * fix: Add docs link * fix: Add docs link * fix: Clean up exception handling * feat: Add a factory method to the Reader class (#214) * fix: Clarify version docs * fix: Add the test that verifies direct instance throws * fix: Add the tests for the factory method * fix: Add tests for from_asset * fix: Add tests * fix: Typos in docs * fix: Add docs * fix: Docs * fix: Typo * fix: Rename method * fix: Exception classes hierarchy * fix: COmment typos... * fix: Typos in comments * fix: In examples, add link to the app repo example * fix: In examples, add link to the app repo example * fix: In examples, add link to the app repo example * fix: Add docs link * fix: Add docs link * fix: Clean up exception handling * fix: try_read * chore: Bump to c2pa-rs v0.74.0 (#215) * fix: Clarify version docs * fix: Add the test that verifies direct instance throws * fix: Add the tests for the factory method * fix: Add tests for from_asset * fix: Add tests * fix: Typos in docs * fix: Add docs * fix: Docs * fix: Typo * fix: Rename method * fix: Exception classes hierarchy * fix: COmment typos... * fix: Typos in comments * fix: In examples, add link to the app repo example * fix: In examples, add link to the app repo example * fix: In examples, add link to the app repo example * fix: Add docs link * fix: Add docs link * fix: Clean up exception handling * fix: try_read * fix: Bump version * fix: Load settings order * fix: Retrigger tests * chore: Update c2pa version to v0.75.2 * chore: Update SDK version in unit tests * fix: export C2paBuilderIntent * fix: c2pa v0.75.4 (#217) * fix: Update expected SDK version in unit tests * fix: Update c2pa version to v0.75.3 * fix: Update SDK version in unit tests to 0.75.4 * fix: Update c2pa version to v0.75.4 * fix: Update comment to clarify legacy settings loading * chore: Update c2pa version to v0.75.6 (#219) * Update c2pa version to v0.75.6 * fix: Update SDK version in unit test * chore: Update c2pa version to v0.75.7 (#220) * Update c2pa version to v0.75.7 * Update SDK version in unit tests * fix: Bump c2pa version to v0.75.8 (#222) * fix: Bump c2pa version to v0.75.8 * fix: Update SDK version in unit tests * fix: Export types moved files (#221) * chore: Bump c2pa-rs version to c2pa-v0.75.10 (#223) * Update c2pa-native-version.txt * Update test_unit_tests.py * Update test_unit_tests.py * Update c2pa-native-version.txt * Retrigger all tests at once * chore: Update c2pa-native-version.txt to use c2pa v0.75.16 (#224) * chore: Update c2pa-native-version.txt * fix: Update test_unit_tests.py * Update test_unit_tests.py * Update c2pa-native-version.txt * Update test_unit_tests.py * Update c2pa-native-version.txt * fix: Remove obsolete test * fix: Prep for 0.75.16 * fix: Retrigger all tests * chore: Up to c2pa-v0.75.19 (#226) * chore: Up to c2pa-v0.75.18 * chore: Update test_unit_tests.py to check c2pa-v0.75.18 * Update test_unit_tests.py * Update c2pa-native-version.txt * Update test_unit_tests.py * chore Update c2pa-native-version.txt to c2pa-v0.75.21 (#227) * Update c2pa-native-version.txt * chore: Update test_unit_tests.py * feat: Context and Settings WIP * fix: Docs 1 * fix: WIP * fix: WIP * chore(deps): bump cryptography from 45.0.6 to 46.0.5 (#229) Bumps [cryptography](https://github.com/pyca/cryptography) from 45.0.6 to 46.0.5. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](pyca/cryptography@45.0.6...46.0.5) --- updated-dependencies: - dependency-name: cryptography dependency-version: 46.0.5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Delete docs/faqs.md * Update settings.md * Update usage instructions for context managers Clarified usage of context managers with Builder, Reader, and Signer classes. * fix: WIP * fix: Docs * fix: Clean up * fix: Move docs out * Delete tests/test_docs.py * fix: Switch to Interface and not protocol * fix: Updates * fix: Update things * fix: CLean up notes * fix: Require funcs * fix: Examples * fix: Refactor * fix: Refactor * fix: Unnest example * fix: The exampels * fix: The useless refactors * fix: Refactor * fix: Refactor 2 * fix: Refactor 3 * fix: Refactor * fix: Refactor 4 * fix: Version bump * fix: Deprec warning * fix: Test also the contextual APIs in threading * fix: Refactor * fix: Native handles handling refactoring (#232) * fix: Native handles handling * fix: Clean up notes * fix: Native handles handling --------- Co-authored-by: Tania Mathern <tania.mathern@gmail.comn> * fix: Format * fix: Tests * fix: Test with trust * Clean up comments in read.py Removed unnecessary comments about trust anchor configuration. * Update read.py * fix: Typos * fix: Typos * fix: Notes for WIP * fix: Refactor * Remove version vNext details from release notes Removed details about new features and deprecations for version vNext. * fix: docs * fix:signfile * fix: Clean up * fix: Clean up * fix: Remove unused APIs * feat: Drop the WIP docs * fix: Doc in branch is reference, this one is done * fix: Remove unused APIs, with_archive added * fix: Clean up notes and tests * fix: WIP docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Double free * fix: Wording and examples * fix: Wording and examples * fix: Ownership handling * fix: Improve resources handling * chore(deps): bump cryptography from 45.0.6 to 46.0.5 (#236) Bumps [cryptography](https://github.com/pyca/cryptography) from 45.0.6 to 46.0.5. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](pyca/cryptography@45.0.6...46.0.5) --- updated-dependencies: - dependency-name: cryptography dependency-version: 46.0.5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Docs * fix: refactor & docs * fix: refactor & docs * fix: refactor & docs * fix: refactor * fix: refactor * feat: Fragment APIs (e.g. for video) (#237) * fix: Fragment API * fix: Only show APIs with cotnext * feat: Context+Settings APIs (#230) * feat: Context and Settings WIP * fix: Docs 1 * fix: WIP * fix: WIP * Delete docs/faqs.md * Update settings.md * Update usage instructions for context managers Clarified usage of context managers with Builder, Reader, and Signer classes. * fix: WIP * fix: Docs * fix: Clean up * fix: Move docs out * Delete tests/test_docs.py * fix: Switch to Interface and not protocol * fix: Updates * fix: Update things * fix: CLean up notes * fix: Require funcs * fix: Examples * fix: Refactor * fix: Refactor * fix: Unnest example * fix: The exampels * fix: The useless refactors * fix: Refactor * fix: Refactor 2 * fix: Refactor 3 * fix: Refactor * fix: Refactor 4 * fix: Version bump * fix: Deprec warning * fix: Test also the contextual APIs in threading * fix: Refactor * fix: Native handles handling refactoring (#232) * fix: Native handles handling * fix: Clean up notes * fix: Native handles handling --------- Co-authored-by: Tania Mathern <tania.mathern@gmail.comn> * fix: Format * fix: Tests * fix: Test with trust * Clean up comments in read.py Removed unnecessary comments about trust anchor configuration. * Update read.py * fix: Typos * fix: Typos * fix: Notes for WIP * fix: Refactor * Remove version vNext details from release notes Removed details about new features and deprecations for version vNext. * fix: docs * fix:signfile * fix: Clean up * fix: Clean up * fix: Remove unused APIs * fix: Remove unused APIs, with_archive added * fix: Clean up notes and tests * fix: Double free * fix: Wording and examples * fix: Ownership handling * fix: Improve resources handling * fix: Docs * fix: refactor & docs * fix: refactor & docs * fix: refactor & docs * fix: refactor * fix: refactor * feat: Fragment APIs (e.g. for video) (#237) * fix: Fragment API * fix: Refactor * fix: Refactor * docs: Managed resources (#238) * fix: Managed resources docs * fix: Docs * fix: Docs * fix: Docs * fix: Docs * fix: Update docs --------- Co-authored-by: Tania Mathern <tania.mathern@gmail.comn> * fix: refactor * fix: refactor * fix: refactor * fix: refactor * fix: refactor * fix: refactor * fix: refactor * fix: refactor * fix: Memory handling * fix: Remote manifest support in Reader with Context (#233) * fix: New API * fix: Review feedback on c2pa-rs PR * fix: Docs * v0.77.1 of c2pa-rs is released * Update c2pa version to v0.77.1 * fix: Merge conflict mistake --------- Co-authored-by: Tania Mathern <tania.mathern@gmail.comn> * fix: Master of typos * fix: Docs * fix: Fix a typo * chore: Update c2pa version to v0.78.2 (#239) * Update c2pa version to v0.78.0 * Update expected SDK version in unit test * Update expected SDK version in unit test * Update c2pa version from v0.78.0 to v0.78.1 * Update expected SDK version in unit test * Update c2pa version to v0.78.2 * fix: Lifecycle handling handler leaks * fix: Review comments 2 * fix: Lifecycle handling handler leaks * fix: Docs * fix: Docs * fix: Docs --------- Co-authored-by: Tania Mathern <tania.mathern@gmail.comn> * fix: Merge commit Removed the 'with_archive' method from the Builder class, which was responsible for loading an archive into the builder and replacing its manifest definition. * fix: Merge commit 2 * Add combined context and settings doc * Remove context.md and settings.md which were combined into context-settings.md, Put class diagram into sep file, various other edits * Edit intents and make it follow style, org of c2pa-c version * Remove sections about not using Context, other clean up * General copy edits * chore: Bump c2pa-v0.78.3 (#240) * chore: Bump c2pa-v0.78.3 * fix: Update test_unit_tests.py * chore: Update c2pa-rs to v 0.78.4 (#241) * Update c2pa-native-version.txt * Update test_unit_tests.py * fix: Update pyproject.toml to bump version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Tania Mathern <tania.mathern@gmail.comn> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rand McKinney <crandmck@yahoo.com>
1 parent 84c7602 commit bd373e1

28 files changed

Lines changed: 8729 additions & 1873 deletions

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ rebuild: clean-c2pa-env install-deps download-native-artifacts build-python
3232
run-examples:
3333
python3 ./examples/sign.py
3434
python3 ./examples/sign_info.py
35+
python3 ./examples/no_thumbnails.py
3536
python3 ./examples/training.py
3637
rm -rf output/
3738

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ Features:
1212
- Add assertions and ingredients to assets.
1313
- Examples and unit tests to demonstrate usage.
1414

15+
<div style={{display: 'none'}}>
16+
17+
For the best experience, read the docs on the [CAI Open Source SDK documentation website](https://opensource.contentauthenticity.org/docs/c2pa-c).
18+
19+
If you want to view the documentation in GitHub, see:
20+
- [Using the Python library](docs/usage.md)
21+
- [Supported formats](https://github.com/contentauth/c2pa-rs/blob/main/docs/supported-formats.md)
22+
- [Configuring the SDK using `Context` and `Settings`](docs/context-settings.md)
23+
- [Using Builder intents](docs/intents.md) to ensure spec-compliant manifests
24+
- Using [working stores and archvies](docs/working-stores.md)
25+
- Selectively constructing manifests by [filtering actions and ingredients](docs/selective-manifests.md)
26+
- [Diagram of public classes in the Python library and their relationships](docs/class-diagram.md)
27+
- [Release notes](docs/release-notes.md)
28+
29+
</div>
30+
1531
## Prerequisites
1632

1733
This library requires Python version 3.10+.
@@ -40,7 +56,9 @@ See the [`examples` directory](https://github.com/contentauth/c2pa-python/tree/m
4056

4157
## API reference documentation
4258

43-
See [the section in Contributing to the project](https://github.com/contentauth/c2pa-python/blob/main/docs/project-contributions.md#api-reference-documentation).
59+
Documentation is published at [github.io/c2pa-python/api/c2pa](https://contentauth.github.io/c2pa-python/api/c2pa/index.html).
60+
61+
To build documentation locally, refer to [this section in Contributing to the project](https://github.com/contentauth/c2pa-python/blob/main/docs/project-contributions.md#api-reference-documentation).
4462

4563
## Contributing
4664

c2pa-native-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c2pa-v0.67.1
1+
c2pa-v0.78.4

docs/class-diagram.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
2+
# Class diagram
3+
4+
This diagram shows the public classes in the Python library and their relationships.
5+
6+
```mermaid
7+
classDiagram
8+
direction LR
9+
10+
class Settings {
11+
+from_json(json_str) Settings$
12+
+from_dict(config) Settings$
13+
+set(path, value) Settings
14+
+update(data) Settings
15+
+close()
16+
+is_valid bool
17+
}
18+
19+
class ContextProvider {
20+
<<abstract>>
21+
+is_valid bool*
22+
+execution_context*
23+
}
24+
25+
class Context {
26+
+from_json(json_str, signer) Context$
27+
+from_dict(config, signer) Context$
28+
+has_signer bool
29+
+is_valid bool
30+
+close()
31+
}
32+
33+
class Reader {
34+
+get_supported_mime_types() list~str~$
35+
+try_create(format_or_path, stream, manifest_data, context) Reader | None$
36+
+json() str
37+
+detailed_json() str
38+
+get_active_manifest() dict | None
39+
+get_manifest(label) dict
40+
+get_validation_state() str | None
41+
+get_validation_results() dict | None
42+
+resource_to_stream(uri, stream) int
43+
+is_embedded() bool
44+
+get_remote_url() str | None
45+
+close()
46+
}
47+
48+
class Builder {
49+
+from_json(manifest_json, context) Builder$
50+
+from_archive(stream) Builder$
51+
+get_supported_mime_types() list~str~$
52+
+set_no_embed()
53+
+set_remote_url(url)
54+
+set_intent(intent, digital_source_type)
55+
+add_resource(uri, stream)
56+
+add_ingredient(json, format, source)
57+
+add_action(action_json)
58+
+to_archive(stream)
59+
+with_archive(stream) Builder
60+
+sign(signer, format, source, dest) bytes
61+
+sign(format, source, dest) bytes
62+
+sign_file(source_path, dest_path, signer) bytes
63+
+close()
64+
}
65+
66+
class Signer {
67+
+from_info(signer_info) Signer$
68+
+from_callback(callback, alg, certs, tsa_url) Signer$
69+
+reserve_size() int
70+
+close()
71+
}
72+
73+
class C2paSignerInfo {
74+
<<ctypes.Structure>>
75+
+alg
76+
+sign_cert
77+
+private_key
78+
+ta_url
79+
}
80+
81+
class C2paSigningAlg {
82+
<<IntEnum>>
83+
ES256
84+
ES384
85+
ES512
86+
PS256
87+
PS384
88+
PS512
89+
ED25519
90+
}
91+
92+
class C2paBuilderIntent {
93+
<<IntEnum>>
94+
CREATE
95+
EDIT
96+
UPDATE
97+
}
98+
99+
class C2paDigitalSourceType {
100+
<<IntEnum>>
101+
DIGITAL_CAPTURE
102+
DIGITAL_CREATION
103+
TRAINED_ALGORITHMIC_MEDIA
104+
...
105+
}
106+
107+
class C2paError {
108+
<<Exception>>
109+
+message str
110+
}
111+
112+
class C2paError_Subtypes {
113+
<<nested classes>>
114+
ManifestNotFound
115+
NotSupported
116+
Json
117+
Io
118+
Verify
119+
Signature
120+
...
121+
}
122+
123+
ContextProvider <|-- Context : extends
124+
Settings --> Context : optional input
125+
Signer --> Context : optional, consumed
126+
C2paSignerInfo --> Signer : creates via from_info
127+
C2paSigningAlg --> C2paSignerInfo : alg field
128+
C2paSigningAlg --> Signer : from_callback alg
129+
Context --> Reader : context=
130+
Context --> Builder : context=
131+
Signer --> Builder : sign(signer)
132+
C2paBuilderIntent --> Builder : set_intent
133+
C2paDigitalSourceType --> Builder : set_intent
134+
C2paError --> C2paError_Subtypes : subclasses
135+
```

0 commit comments

Comments
 (0)