uploadcare / uploadcare-ruby

Ruby API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
https://uploadcare.com
MIT License
39 stars 28 forks source link

Library calculates request signature even if no secret key provided #158

Closed alxgsv closed 7 months ago

alxgsv commented 7 months ago

Describe the bug

This is a low priority bug.

If I run

Uploadcare::File.file("2f7f4987-40f1-4e9a-a5dc-3d603b6b00fb")

without any prior configuration, it will issue a request to the server with authorization header like this:

Authorization: Uploadcare :4aa0e8a4258531e1f5487fa74f6522ef7057eeda.

Public key here is blank, but signature is actually calculated by using blank string as a secret key.

Expected behavior

I think library should throw error if current public key or secret key are blank.

Code / screenshots

Key defaults are defined in uploadcare.rb