Skip to main content

Cloudinary upload widget v2 does not include context in params

Comments

8 comments

  • Stephen Doyle

    Hi Tyler,

    To answer your last question first, there isn't a 'v2' of the client side javascript code, but the GitHub repository for the Node SDK with the api_sign_request method you referenced is here: https://github.com/cloudinary/cloudinary_npm In that SDK the distinction between the 'v2' methods and those without v2 is related to the order of the parameters, but they should be otherwise identical.

    Specifically, in the v2 methods, the callback function is always the last parameter, but in earlier versions of the SDK, there were often parameters after the callback, which made writing and reading the code more difficult at times.

    Regarding the format of the context values; when the request is sent to the API, it should be a single string, with a pipe character separating each key/value pair. In our SDKs, it's usually passed as a map or associative array, and the SDK will escape it to the correct string format before passing it to the server.

    I've created a bug report internally for the widget not sending the context for signing; I can provide you with any further updates as I receive them. In the meantime, another option for you may be to use the 'string' method of providing the signature, where if you know which parameters will be sent with the upload request, you can re-generate the appropriate signature on the server side and pass the signature as a simple string when initializing the widget

    Thanks
    Stephen

    0
  • Tyler Collier

    I'm referring to this blog post labeled Introducing Cloudinary Upload Widget v2 for why I called it v2. What matters to me is why isn't it on Github, like the old version, which is at https://github.com/cloudinary/cloudinary_js. If it were there I could submit a PR. Also, if it were there, I could see the license. May I ask, what is the license? If it's MIT (or something open source friendly) like v1, then I could wrap it into an npm library.

    Thanks for sharing updates with me on the internal bug report, I'd appreciate that. For now I have a workaround but I'd rather have the fix; I doubt I would've figured out that multiple context values should be separated with a pipe. I think it's one more reason to use Github though for the client side library; that way I could follow the bug report myself :-)

    0
  • Stephen Doyle

    Hi Tyler,

    Apologies, I thought you referring to the v2 methods in the Node SDK because you mentioned `cloudinary.v2.utils` in your message.

    There isn't currently a GitHub repository available for v2 of the upload widget with a full source listing, at this time we don’t have plans to license it for reuse or release it in formats other than its current distribution.

    An earlier version of this comment suggested it was distributed under a different license but I was was mistaken - apologies for any confusion caused by that 

    -Stephen

     

    0
  • Andres

    Hi, the widget is still not including the context in the params_to_sign value.

    Are there any updates on the internal bug report?

    0
  • Mo Ip

    Hi Andres,

    I am checking with our Dev and will update you on the status of the fix.

    -Mo

    0
  • Mikel

    Hi,

    Any update on this?

    0
  • Mo Ip

    Hi Mikel,

    I will check when it's available and update when I have the ETA.

    Thanks,

    -Mo

    0
  • Stephen Doyle

    Hi Mikel,

    We deployed a new version of the upload widget today, and the context params are now included in the request to generate the signature as expected - may I ask you to please check it and let me know if it works for you?

    Thanks,

    Stephen

    0

Post is closed for comments.