Add notification_url and batch_id to asset management params - #452
Merged
Conversation
Add both params to `destroy`, `rename`, `update_metadata`, `add_tag`, `remove_tag`, `replace_tag`, `remove_all_tags`, `add_context`, `remove_all_context`, `create_slideshow`, `api.update` and the `delete_resources` methods, so poll-based notifications can be correlated to the call that produced them. Add `type` to `explode` and `public_id` to `multi` and `generate_sprite`. The `tags`, `context` and `metadata` endpoints accept `notification_url` and `batch_id` but exclude them from their signed parameter sets, so `utils.sign_request` now honors an `options["non_signable"]` list of keys to send outside the signature. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Aligns notification parameter support across the asset management endpoints, so
notification_urlandbatch_idcan be used consistently for completionnotifications and polling.
Changes
Upload API (
cloudinary/uploader.py)destroy,rename,update_metadata,call_tags_api,call_context_apinowaccept and send
notification_urlandbatch_id.explodenow forwardstype.batch_idadded to_SLIDESHOW_PARAMS.Admin API (
cloudinary/api.py)updateacceptsbatch_id; delete-resource params acceptnotification_url.Signing (
cloudinary/utils.py)sign_requestgainedoptions["non_signable"]: listed keys are still sent butexcluded from the signature. The tags, context and metadata endpoints accept the
notification params but omit them from the signature, so they are registered via
_NON_SIGNABLE_NOTIFICATION_PARAMS.destroysigns them as usual.public_idfor multi/sprite (cloudinary/utils.py)build_multi_and_sprite_paramsnow forwardspublic_id, somultiandgenerate_spritecan name the generated asset instead of deriving it from the tag.Tests
test_notification_params_signingcovers all four endpoints, asserting the paramsare sent and that the signature excludes them where expected.
🤖 Generated with Claude Code