Skip to content

Allow jwt 3.x - #6

Merged
romanoff merged 1 commit into
masterfrom
relax-jwt-constraint-allow-3x
Jul 31, 2026
Merged

Allow jwt 3.x#6
romanoff merged 1 commit into
masterfrom
relax-jwt-constraint-allow-3x

Conversation

@romanoff

@romanoff romanoff commented Jul 30, 2026

Copy link
Copy Markdown

What

Relaxes the jwt runtime dependency from ~> 2 to >= 2, < 4 so consumers (Jobber) can upgrade to jwt 3.2.0. The Gemfile/lockfile now resolve jwt 3.2.0 so CI exercises the new major.

Why

Jobber is upgrading jwt 2.10.2 → 3.2.0 (includes the fix for CVE-2026-45363). This gem's ~> 2 constraint is the last blocker for bundler resolution; upstream auth0/omniauth-auth0 still caps at ~> 2 as well, so this needs to land on the fork.

Compatibility

JWTValidator uses the classic JWT.decode(jwt, key, true, opts) API, which is unchanged in jwt 3. Full spec suite passes against jwt 3.2.0 (128 examples, 0 failures).

One spec updated: jwt 3 decodes token segments with strict base64 (RFC 4648), so the invalid-signature spec now swaps in a valid-base64 signature from another token instead of appending raw characters (which now raises JWT::Base64DecodeError — still a JWT::DecodeError subclass — before signature verification runs).

Related issue in original gem

auth0#223

🤖 Generated with Claude Code

Co-Authored-By: Amplify 3.0.1 amplify@getjobber.com

Relax the jwt runtime dependency from ~> 2 to >= 2, < 4 so consumers can
upgrade to jwt 3.x. The lockfile now resolves jwt 3.2.0 so CI exercises
the new major.

The only spec change needed: jwt 3 decodes base64 strictly (RFC 4648),
so the invalid-signature spec now tampers the signature with a valid
base64 segment instead of appending raw characters.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Amplify 3.0.1 <amplify@getjobber.com>
@romanoff

Copy link
Copy Markdown
Author

Note on the failing Check for Vulnerabilities (Snyk) job: this is pre-existing and unrelated to this PR. Every Snyk run in this repo fails with the same SNYK-0005 / 401 authentication error, including scheduled runs on master going back to at least Aug 2025 (e.g. Jul 15 master run). The repo has no SNYK_TOKEN Actions secret configured, so the job has no valid credentials — it needs an org admin to provision the shared Snyk token to this repo (or the repo to be added to the Snyk org).

All unit test jobs (Ruby 3.0/3.1/3.2) pass on this PR.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Relaxes this gem’s jwt dependency constraint to support jwt 3.x, allowing downstream consumers to upgrade (and pick up the referenced security fix) while keeping the library behavior and test suite compatible.

Changes:

  • Relax jwt runtime dependency from ~> 2 to >= 2, < 4 in the gemspec (and align the Gemfile).
  • Update Gemfile.lock to resolve and exercise jwt 3.2.0 in CI.
  • Adjust the invalid-signature spec to remain valid under JWT 3.x’s stricter base64 decoding behavior.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
spec/omniauth/auth0/jwt_validator_spec.rb Updates a signature-failure test to avoid base64 decoding errors under jwt 3.x.
omniauth-auth0.gemspec Relaxes the runtime jwt dependency constraint to allow 3.x.
Gemfile Aligns the dev/test dependency constraint for jwt with the gemspec.
Gemfile.lock Locks resolution to jwt 3.2.0 so CI runs against the new major.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread omniauth-auth0.gemspec
@@ -21,7 +21,7 @@ omniauth-auth0 is the OmniAuth strategy for Auth0.
s.executables = `git ls-files -- bin/*`.split('\n').map{ |f| File.basename(f) }

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct observation, but this line is pre-existing upstream code (verbatim from auth0/omniauth-auth0, untouched by this PR) and has no effect: the gem ships no bin/ files, so git ls-files -- bin/* is empty and the split returns [] regardless of the delimiter. Leaving it as-is to keep the fork's diff from upstream minimal — worth fixing upstream if anyone ever adds an executable.

@graham-jobber graham-jobber left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@romanoff
romanoff merged commit a6278da into master Jul 31, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants