diff --git a/Gemfile b/Gemfile index f4baf9a9..40e1e48b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' gemspec -gem 'oauth2' +gem 'oauth2', '>= 2.0.12' gem 'typhoeus' gem 'warning' gem 'zeitwerk' diff --git a/Gemfile.lock b/Gemfile.lock index c8920166..7bd445fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,20 +75,21 @@ GEM mutex_m (0.3.0) net-http (0.6.0) uri - oauth2 (2.0.9) - faraday (>= 0.17.3, < 3.0) - jwt (>= 1.0, < 3.0) + oauth2 (2.0.12) + faraday (>= 0.17.3, < 4.0) + jwt (>= 1.0, < 4.0) + logger (~> 1.2) multi_xml (~> 0.5) rack (>= 1.2, < 4) - snaky_hash (~> 2.0) - version_gem (~> 1.1) + snaky_hash (~> 2.0, >= 2.0.3) + version_gem (>= 1.1.8, < 3) parallel (1.27.0) parser (3.3.8.0) ast (~> 2.4.1) racc prism (1.4.0) racc (1.8.1) - rack (3.1.14) + rack (3.1.15) rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.2) @@ -130,9 +131,9 @@ GEM simplecov (~> 0.19) simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) - snaky_hash (2.0.1) - hashie - version_gem (~> 1.1, >= 1.1.1) + snaky_hash (2.0.3) + hashie (>= 0.1.0, < 6) + version_gem (>= 1.1.8, < 3) steep (1.7.1) activesupport (>= 5.1) concurrent-ruby (>= 1.1.10) @@ -161,7 +162,7 @@ GEM concurrent-ruby (~> 1.0) unicode-display_width (2.6.0) uri (1.0.3) - version_gem (1.1.7) + version_gem (1.1.8) warning (1.5.0) zeitwerk (2.6.18) @@ -174,7 +175,7 @@ DEPENDENCIES minitest minitest-hooks minitest-reporters - oauth2 + oauth2 (>= 2.0.12) rake rbs rubocop diff --git a/lib/patch.rb b/lib/patch.rb deleted file mode 100644 index e46bffed..00000000 --- a/lib/patch.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -require 'oauth2' - -module OAuth2 - module Strategy - # rubocop:disable Style/Documentation - module AssertionPatch - private - - # noinspection RbsMissingTypeSignature - def build_assertion(claims, opts) - unless opts.is_a?(Hash) && opts.key?(:algorithm) && opts.key?(:key) - raise ArgumentError, - 'encoding_opts must include :algorithm and :key' - end - - headers = opts[:kid] ? { kid: opts[:kid] } : {} - JWT.encode(claims, opts[:key], opts[:algorithm], headers) - end - end - # rubocop:enable Style/Documentation - - class Assertion < Base - prepend AssertionPatch - end - end -end diff --git a/lib/zitadel_client.rb b/lib/zitadel_client.rb index b0603607..d3c1abda 100644 --- a/lib/zitadel_client.rb +++ b/lib/zitadel_client.rb @@ -2,7 +2,6 @@ require 'zeitwerk' require 'warning' -require_relative 'patch' Warning.ignore(:method_redefined, __dir__)