Skip to content
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

Add test support for Ruby 2.6 and 2.7 and 3.0 #256

Merged
merged 5 commits into from
Feb 1, 2021

Conversation

fursich
Copy link
Contributor

@fursich fursich commented Jan 30, 2021

Hello, maintainers - thank you for the great gem.
This is super useful, and makes our life a lot easier to work with auth0!

This PR is a suggestion to explicitly cover latest versions of Ruby using circle ci.

While it make sense to provide support to apps that relies on older ruby, I hope this gem to also cover latest versions, 2.6 and 2.7. (Ideally up to Ruby 3.0, which I didn't include in this PR for the sake of keeping this PR concise. Let me submit a separate PR if needed)

Changes

Test codes only. No changes have been made that impacts on the actual running codes.

  • Circle CI settings that allows matrix build against wider range of ruby images (2.5.8, 2.6.6, 2.7.2).
  • Test configuration to display deprecation warnings, so that we can be aware of them before getting crushed with Ruby 3.0

With a few further steps , this gem would pass tests against Ruby 3.0 (at least it did at my local environment), but I'd like to stop here to avoid making the purpose of this PR overcomplicated.

References

Testing

  • This change adds unit test coverage (N/A - no changes on running codes)
  • This change adds integration test coverage (N/A)
  • This change has been tested on the latest version of Ruby

Checklist

@fursich fursich requested a review from a team as a code owner January 30, 2021 05:56
@davidpatrick davidpatrick changed the title Add tests against Ruby2.6 and 2.7 Add tests against Ruby2.6 and 2.7 and 3.0 Feb 1, 2021
@davidpatrick davidpatrick merged commit 4ab6fe0 into auth0:master Feb 1, 2021
@davidpatrick davidpatrick added this to the v5.0.1 milestone Feb 2, 2021
@davidpatrick davidpatrick changed the title Add tests against Ruby2.6 and 2.7 and 3.0 Add test support for Ruby 2.6 and 2.7 and 3.0 Feb 2, 2021
@davidpatrick davidpatrick mentioned this pull request Feb 2, 2021
eric-hemasystems pushed a commit to eric-hemasystems/sync_attr_with_auth0 that referenced this pull request Feb 18, 2021
For BloodRelay I want to use a newer version of the Auth0 library.
URI.escape has been throwing deprecation warnings for a while but
now it's removed from Ruby 3 which means we need to be on a newer
version of Auth0 that no longer uses that method[1].

Had to decide if we want to stay on the 4.x series of Auth0 or the
5.x series due to a breaking change in `create_user` (or have our
library detect the version and call with the right arguments)[2]. I
opted to require v5 since it is better tested against recent versions
of Ruby[3].

Upgrading the auth0 gem required moving to the 2.2.x series of the JWT
library. The method doing the base64 encoding of the JWT signature has
moved. Also the `typ` header is no longer generated[4]. It seems it is
not required by the spec but Auth0 does require it so adding it as
a parameter manually. The algorithm param is the same as the default.
I just had to specify it to pass in header options.

Other than these library upgrades and the code changes caused by the
upgrades this commit includes no change in functionality. The test
suite passes but since it's heavily mocked I'll also note I have already
tested this against an upgraded version of BR to verify it really
doesn't break anything (this is how the `typ` thing was discovered).

1. auth0/ruby-auth0#202
2. auth0/ruby-auth0#244
3. auth0/ruby-auth0#256
4. jwt/ruby-jwt#233
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants