Repository navigation
feat: Add tsa_headers to Signer.from_callback - #371
Open
dfradehubs wants to merge 1 commit into
Open
dfradehubs wants to merge 1 commit into
dfradehubs wants to merge 1 commit into
Conversation
Time stamp authorities on the C2PA TSA trust list usually require an API key header. Signer.from_callback only took a TSA URL, so a signer backed by a remote key (Cloud KMS, HSM) could not get trusted timestamps without a local proxy that adds the header. tsa_headers is applied through the new C API function c2pa_signer_with_tsa_header (contentauth/c2pa-rs#3112), one call per header. The binding is optional: with a native library that does not export it yet, everything else works and tsa_headers raises a clear C2paError. On a failed call the signer that was not consumed is freed. Closes contentauth#370
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in this pull request
Adds an optional
tsa_headersargument toSigner.from_callback, for time stamp authorities that authenticate clients (usually an API key header, e.g. Trufo's production TSA requiresX-API-Key). Without it, a Python signer backed by a remote key (Cloud KMS, HSM) cannot get trusted timestamps without a local proxy that adds the header.c2pa_signer_with_tsa_header(feat: Add c2pa_signer_with_tsa_header to send headers with time stamp requests c2pa-rs#3112), which wraps the native signer.c2pa-v0.92.2), the module imports and everything works as today; onlytsa_headersraises a clearC2paError. That way this can be merged before or with the native version bump.Closes #370.
Depends on contentauth/c2pa-rs#3112 for the native function. Once a c2pa-rs release includes it,
c2pa-native-version.txtcan be bumped (here or in a follow-up).Tests
tsa_headersraisesC2paError.c2pa_c_ffibuilt from feat: Add c2pa_signer_with_tsa_header to send headers with time stamp requests c2pa-rs#3112 (C2PA_LIBRARY_NAME): it passes. End to end against a local TSA, theX-API-Keyheader arrives on every attempt.flake8clean.Checklist
TO DOitems (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.