cloudinary / cloudinary-go

Cloudinary Golang package
MIT License
42 stars 21 forks source link

Request params passed in for signing in Upload API request are not filtered in accordance with documentation #26

Closed udipl closed 3 years ago

udipl commented 3 years ago

Bug report for Cloudinary Go SDK

The Upload API request signing includes all passed parameters to the signing method, despite the documentation clearly states that All parameters added to the method call should be included except: file, cloud_name, resource_type and your api_key. The server rejects signatures that include one of these values.

This breaks when a ResourceType field is non-empty in in an UploadParams struct for a request; it gets marshaled as resource_type and included in the signature, which doesn't match the server's logic.

See proposed fix #25

Describe the bug in a sentence or two.

Issue Type (Can be multiple)

Steps to reproduce

Enter a ResourceType field that is non-empty in an UploadParams struct for a request, e.g. "video".

OS

Versions and Libraries (fill in the version numbers)

Repository

If possible, please provide a link to a reproducible repository that showcases the problem

const-cloudinary commented 3 years ago

Fixed in #25