-
Couldn't load subscription status.
- Fork 100
feat: expand settings API #1192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
34380dd to
79d41ed
Compare
…nick/unified-config
f0a4600 to
ab32763
Compare
… and optional settings values
…nick/unified-config
94f8422 to
0abb2a1
Compare
…l settings, fix wasi issue by reset settings before test, resourceref icons
…nick/unified-config
4dcff28 to
c6948a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK with the changes to keep things moving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, we have some work to do before publishing, but this is ready to merge now. Thanks!
* feat: unified config foundation * refactor: separate user-facing settings and move thumbnail code * feat: impl profiles, thumbnail.prefer_smallest_format, remove default_format * feat: implement auto_opened, auto_created, and claim_generator_infos settings * feat: impl auto_opened setting * fix: default all_actions_included in actions assertion to true * fix: all test cases * docs: cleanup comments and document new functions * test: add thumbnail tests * fix: auto actions assertion, lots of tests, crash when empty actions, and optional settings values * fix: optional signer settings and document get_profile_settings_signer * docs: document Builder::add_auto_actions_assertion * test: remove test code in test * feat: add settings to CLI * docs: create an example c2pa.toml settings * fix: cli settings * feat: add config path and env vars for cli settings arg * fix: remove bmp and ico from supported thumbnails * fix: single claim generator info and rename load settings functions * test: remove scoped settings * refactor: remove profiles and document digital source type * feat: allow specifying digital source type for auto actions in settings * refactor: convert usage of json settings to toml * refactor: move global settings functions into public `Settings` struct * refactor: move builder settings into its own module * fix: add ingredient uris to auto actions, only add placed actions if not added already, and use builder claim gen info or settings * feat: add `Settings::from_url` * feat: setup base for remote signers and cawg signers in settings * feat: impl `RemoteSigner` and fix when pulling optional settings * feat: prefer_smallest_format tiff->jpeg * feat: allow specifying infer operating system for claim generator info * refactor: default test signer in `Settings` * fix: source type optional for auto add actions and use ref for test signer to prevent freeze * feat: add `ActionsSettings`, all_actions_included, action_templates, actions * docs: add new fields to c2pa.toml * fix: wip change serde_json::Value in settings to toml::Value (issues with this in TODO comments) * fix: actions/action_templates and add tests, use toml for defining settings instead of setting each field * test: cleanup and add more builder and settings tests * fix: make_thumbnail_from_stream format before stream in parameters * docs: finish documenting some settings structs * fix: private Settings set/get_value * test: add allActionsIncluded by default when signing to test * style: +nightly fmt * fix: feature flag thumbnails and wasm * test: fix hash_alg string * fix: remove cawg_signer, doc cli config path, move signer to top-level settings, fix wasi issue by reset settings before test, resourceref icons * feat: define ActionSettings * fix: remove Settings top-level export for now * test: add remote signer test with mock server * fix: change `builder.signer` setting to just `signer` * fix: test sample toml and fix up fields * test: don't use httpmock on wasm * test: fix wasi test
Changes in this pull request
Expands the interface of the
SettingsAPI, adding more ways to configure it and more ways to use it.As part of this change, it standardizes on using the toml format for settings. Narrowing down supported formats on the config crate is estimated to reduce around 40-50 dependencies in the latest version.
New Options
signerlocalalg- algorithm used for signingsign_cert- cert used for signingprivate_key- private key used for signingtsa_url- timestamp authority url used for signingremoteurl- URL to remote signer (simple POST sent for now)alg- algorithm used for signingsign_cert- cert used for signingtsa_url- timestamp authority url used for signingbuilderclaim_generator_info- claim generator info to use if not already specified in the builder when signingoperating_system- this is the only field that differs from the current claim generator info definitioninfer- whether to infer the current operating system (default)name- or override it manually with a specific stringthumbnailenabled- whether to enable thumbnail generationignore_errors- whether to ignore errors on thumbnails generation (current behavior)long_edge- longest edge of the thumbnail preserving aspect ratioformat- by default we now generate thumbnails matching the input, otherwise force this formatprefer_smallest_format- prefer smaller file size formats, like png/tiff with no alpha->jpegquality- low, medium, or high; we choose sensible defaults for each formatactionsall_actions_included- whether or not all actions are included in the actions assertion (default true)actions- list of additional actions to add to the actions assertiontemplates- list of additional templates to add to the actions assertionauto_created_actionandauto_opened_actionandauto_placed_actionenabled- whether to enable the auto_X_actionsource_tyoe- source type of the action (required for created action)New API
TODO: doc
TODO
Related Issues
Checklist
TO DOitems (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.