filestack / filestack-ruby

Official Ruby SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
34 stars 27 forks source link

fix #18: symbolize_keys of options hash when generating security policy #19

Closed taylorthurlow closed 6 years ago

taylorthurlow commented 6 years ago

Corrects an issue where the expiry timestamp of the options hash when creating a security policy is ignored, because the options hash was passed in using string hash keys, and not symbol hash keys. Solved by calling symbolize_keys on the options hash when generating.

Fixes https://github.com/filestack/filestack-ruby/issues/18

I decided against adding or altering any tests, because the current generate test stubs out the hash and signature anyways.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-60.8%) to 34.737% when pulling 21acbd01773118f0e6449e5e90b7e38256315015 on taylorthurlow:contrib/issue-18 into 245d69b7c8ffb46f8b7c8a688e7e8a140d265c65 on filestack:master.

taylorthurlow commented 6 years ago

Looks like I made the incorrect assumption that symbolize_keys was a ruby thing, and not an ActiveSupport thing. Builds are failing. I'm wondering if the best solution would be to implement something similar and use that? Or just make sure that documentation explicitly states that hashes must use symbols and not strings? Personally I'm not a fan of the latter.