From a96cbe9dd324ad967dc58c5ee7566899efd6ac8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Andreassa?= Date: Tue, 10 Mar 2026 11:05:47 -0700 Subject: [PATCH 1/3] chore: Ruby 3.2 minimum, 4.0 default --- .github/workflows/ci.yml | 12 ++++++------ Gemfile | 4 ++++ README.md | 2 +- googleauth.gemspec | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 898ff513..f0b63de7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,6 @@ jobs: strategy: matrix: include: - - os: ubuntu-22.04 - ruby: "3.1" - task: test , spec - os: ubuntu-22.04 ruby: "3.2" task: test , spec @@ -25,14 +22,17 @@ jobs: - os: ubuntu-latest ruby: "3.4" task: test , spec + - os: ubuntu-latest + ruby: "4.0" + task: test , spec - os: macos-latest - ruby: "3.4" + ruby: "4.0" task: test , spec - os: windows-latest - ruby: "3.4" + ruby: "4.0" task: test , spec - os: ubuntu-latest - ruby: "3.4" + ruby: "4.0" task: rubocop , integration , build , yardoc , linkinator fail-fast: false runs-on: ${{ matrix.os }} diff --git a/Gemfile b/Gemfile index 9bc3ae2d..1a26f5e5 100755 --- a/Gemfile +++ b/Gemfile @@ -5,14 +5,18 @@ gemspec gem "fakefs", ">= 1.0", "< 4" gem "fakeredis", "~> 0.5" +gem "fiddle", "~> 1.1" gem "gems", "~> 1.2" gem "google-style", "~> 1.30.1" +gem "irb", "~> 1.17" gem "logging", "~> 2.0" gem "minitest", "~> 5.14" gem "minitest-focus", "~> 1.1" +gem "pstore", "~> 0.2.1" gem "rack-test", "~> 2.0" gem "redcarpet", "~> 3.0" gem "redis", ">= 4.0", "< 6" gem "rspec", "~> 3.0" +gem "syslog", "~> 0.4.0" gem "webmock", "~> 3.8" gem "yard", "~> 0.9" diff --git a/README.md b/README.md index 2df56387..25ff0123 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ Custom storage implementations can also be used. See ## Supported Ruby Versions -This library is supported on Ruby 3.0+. +This library is supported on Ruby 3.2+. Google provides official support for Ruby versions that are actively supported by Ruby Core—that is, Ruby versions that are either in normal maintenance or diff --git a/googleauth.gemspec b/googleauth.gemspec index c08636fd..09b5b1a1 100755 --- a/googleauth.gemspec +++ b/googleauth.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |gem| gem.require_paths = ["lib"] gem.platform = Gem::Platform::RUBY - gem.required_ruby_version = ">= 3.0" + gem.required_ruby_version = ">= 3.2" gem.add_dependency "faraday", ">= 1.0", "< 3.a" gem.add_dependency "google-cloud-env", "~> 2.2" From dd6d6cf39b2e338e1f6b8d13da78d26b52f613fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Andreassa?= Date: Thu, 12 Mar 2026 13:39:59 -0700 Subject: [PATCH 2/3] chore: Update google-style gem --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 1a26f5e5..55c2f03f 100755 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gem "fakefs", ">= 1.0", "< 4" gem "fakeredis", "~> 0.5" gem "fiddle", "~> 1.1" gem "gems", "~> 1.2" -gem "google-style", "~> 1.30.1" +gem "google-style", "~> 1.32.0" gem "irb", "~> 1.17" gem "logging", "~> 2.0" gem "minitest", "~> 5.14" From 48564f916fbdd3fd311fc84ba250ff27ceb3ab1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Andreassa?= Date: Thu, 12 Mar 2026 13:52:36 -0700 Subject: [PATCH 3/3] fix: Rubocop errors --- lib/googleauth/id_tokens/key_sources.rb | 2 +- lib/googleauth/id_tokens/verifier.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/googleauth/id_tokens/key_sources.rb b/lib/googleauth/id_tokens/key_sources.rb index f93ea318..4813b6bf 100644 --- a/lib/googleauth/id_tokens/key_sources.rb +++ b/lib/googleauth/id_tokens/key_sources.rb @@ -135,13 +135,13 @@ def extract_rsa_key jwk rsa_key.public_key end - # @private CURVE_NAME_MAP = { "P-256" => "prime256v1", "P-384" => "secp384r1", "P-521" => "secp521r1", "secp256k1" => "secp256k1" }.freeze + private_constant :CURVE_NAME_MAP def extract_ec_key jwk begin diff --git a/lib/googleauth/id_tokens/verifier.rb b/lib/googleauth/id_tokens/verifier.rb index f8b06e1d..5f01f50e 100644 --- a/lib/googleauth/id_tokens/verifier.rb +++ b/lib/googleauth/id_tokens/verifier.rb @@ -109,13 +109,13 @@ def normalize_and_verify_payload payload, aud, azp, iss payload["azp"] ||= payload["cid"] if payload.key? "cid" # Payload content validation - if aud && (Array(aud) & Array(payload["aud"])).empty? + if aud && !Array(aud).intersect?(Array(payload["aud"])) raise AudienceMismatchError, "Token aud mismatch: #{payload['aud']}" end - if azp && (Array(azp) & Array(payload["azp"])).empty? + if azp && !Array(azp).intersect?(Array(payload["azp"])) raise AuthorizedPartyMismatchError, "Token azp mismatch: #{payload['azp']}" end - if iss && (Array(iss) & Array(payload["iss"])).empty? + if iss && !Array(iss).intersect?(Array(payload["iss"])) raise IssuerMismatchError, "Token iss mismatch: #{payload['iss']}" end