-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for ruby 3.0 #883
Support for ruby 3.0 #883
Conversation
06d853a
to
a3199c2
Compare
Perhaps we can test core against this branch to verify? |
Let's also update |
Will do.
WIll do. |
185e5d5
to
5b6ed0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One non-blocking comment but otherwise LGTM!
Please note at https://github.com/Shopify/shopify/pull/316649 represents a green test suite against this branch (modulo some attribute changes related to upgrading I think this is ready for review. |
5b6ed0f
to
7e9a8bd
Compare
Add tests describing the encoding behaviors for keys and values during signature validation. These tests are _descriptive_ of the current behavior, and not _prescriptive_.
Replace it with similar methods from WEBrick::HTTPUtils. Note that this introduces webrick as an explicit dependency because webrick is available as a separate gem, and because Ruby 3.0 ships without it in the standard library.
instead of string equivalence.
instead of URI.escape which is deprecated.
7e9a8bd
to
714c86f
Compare
This changeset allows
shopify_api
to run with Ruby 3.0. The notable changes introduced are:URI.escape
usage in HMAC-signature parameter handling withWEBrick::HTTPUtils
method callsURI.escape
usage in OAuth URL construction withURI.encode_www_form
Note that tests have been added around the parameter-handling as it relates to HMAC signature validation, because the keys and values are encoded differently and in very specific ways. I've tried to reproduce the existing behavior insofar as I understand it.
Note that URI equivalence in the tests is now asserted by using
Addressable::URI#equals
instead of directly comparing strings. There are small differences in howURI.encode_www_form
encodes CGI parameters (compared toURI.escape
), but they're not semantic differences.