From cb9e9dc123257c8b4ad2b8ad68b7ea6a9147db05 Mon Sep 17 00:00:00 2001 From: Oliver Valls <199462+tramuntanal@users.noreply.github.com> Date: Wed, 21 Jan 2026 11:52:13 +0100 Subject: [PATCH 1/4] Bump omniauth and hashie versions --- CHANGELOG.md | 4 ++++ Gemfile.lock | 11 +++++++---- lib/omniauth/idcat_mobil/version.rb | 2 +- lib/omniauth/strategies/idcat_mobil.rb | 2 +- omniauth-idcat_mobil.gemspec | 3 ++- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e43e300..fb85cee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## next version: +## Version 0.6.0 (MINOR) +- Bump omniauth dependency to v2.1 series. +- Force Hashie >= 5.0.0. + ## Version 0.5.0 (MINOR) - Send the client_id and the client_secret during the AuthToken retrieval. diff --git a/Gemfile.lock b/Gemfile.lock index e84b367..d4f4d99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,9 @@ PATH remote: . specs: - omniauth-idcat_mobil (0.5.0) - omniauth (~> 2.0.4) + omniauth-idcat_mobil (0.6.0) + hashie (>= 5.0.0) + omniauth (~> 2.1.2) omniauth-oauth2 (>= 1.7.2, < 2.0) GEM @@ -17,6 +18,7 @@ GEM faraday-net_http (2.0.3) hashie (5.0.0) jwt (2.3.0) + logger (1.7.0) multi_json (1.15.0) multi_xml (0.6.0) oauth2 (1.4.9) @@ -25,9 +27,10 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - omniauth (2.0.4) + omniauth (2.1.4) hashie (>= 3.4.6) - rack (>= 1.6.2, < 3) + logger + rack (>= 2.2.3) rack-protection omniauth-oauth2 (1.7.2) oauth2 (~> 1.4) diff --git a/lib/omniauth/idcat_mobil/version.rb b/lib/omniauth/idcat_mobil/version.rb index e9e7d18..2ff34e3 100644 --- a/lib/omniauth/idcat_mobil/version.rb +++ b/lib/omniauth/idcat_mobil/version.rb @@ -2,6 +2,6 @@ module Omniauth module IdCatMobil - VERSION = "0.5.0" + VERSION = "0.6.0" end end diff --git a/lib/omniauth/strategies/idcat_mobil.rb b/lib/omniauth/strategies/idcat_mobil.rb index 8df1dcf..486e4c4 100644 --- a/lib/omniauth/strategies/idcat_mobil.rb +++ b/lib/omniauth/strategies/idcat_mobil.rb @@ -123,7 +123,7 @@ def callback_url # -------------------------------------------------- def idcat_log(msg) - idcat_logger.debug(msg) + idcat_logger.info("[idcat_mobil] #{msg}") end def idcat_logger diff --git a/omniauth-idcat_mobil.gemspec b/omniauth-idcat_mobil.gemspec index ba4fe9d..0a1b6ca 100644 --- a/omniauth-idcat_mobil.gemspec +++ b/omniauth-idcat_mobil.gemspec @@ -24,7 +24,8 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "omniauth", "~> 2.0.4" + spec.add_dependency "hashie", ">=5.0.0" + spec.add_dependency "omniauth", "~> 2.1.2" spec.add_dependency "omniauth-oauth2", ">= 1.7.2", "< 2.0" spec.add_development_dependency "bundler", "~> 2.2", ">= 2.2.10" spec.add_development_dependency "rake", "~> 12.3", ">= 12.3.3" From 62bdb283d34d5440187794f0e3d71f13d297d2e0 Mon Sep 17 00:00:00 2001 From: Oliver Valls <199462+tramuntanal@users.noreply.github.com> Date: Wed, 21 Jan 2026 12:14:40 +0100 Subject: [PATCH 2/4] Add test to check AuthHash doesn't cause conflicts in the future --- spec/omni_auth/auth_hash_spec.rb | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 spec/omni_auth/auth_hash_spec.rb diff --git a/spec/omni_auth/auth_hash_spec.rb b/spec/omni_auth/auth_hash_spec.rb new file mode 100644 index 0000000..243ff35 --- /dev/null +++ b/spec/omni_auth/auth_hash_spec.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe OmniAuth::AuthHash do + let(:auth_hash) do + OmniAuth::AuthHash.new( + provider: "idcat_mobil", + uid: "123456789", + info: { + email: "email@example.net", + name: "Oriol", + surname1: "Junquerol", + surname2: "Balaguer" + }, + credentials: { + token: "fake_token", + expires: false + }, + extra: { + identifier_type: "1", + method: "idcatmobil", + status: "ok" + } + ) + end + + describe "indifferent access" do + it "is accessible with string keys at root level" do + expect(auth_hash["provider"]).to eq("idcat_mobil") + expect(auth_hash["uid"]).to eq("123456789") + expect(auth_hash["info"]).to be_a(Hash) + expect(auth_hash["credentials"]).to be_a(Hash) + expect(auth_hash["extra"]).to be_a(Hash) + end + + it "is accessible with symbol keys at root level" do + expect(auth_hash[:provider]).to eq("idcat_mobil") + expect(auth_hash[:uid]).to eq("123456789") + expect(auth_hash[:info]).to be_a(Hash) + expect(auth_hash[:credentials]).to be_a(Hash) + expect(auth_hash[:extra]).to be_a(Hash) + end + + it "is accessible with string keys in nested hashes" do + expect(auth_hash["info"]["email"]).to eq("email@example.net") + expect(auth_hash["info"]["name"]).to eq("Oriol") + expect(auth_hash["credentials"]["token"]).to eq("fake_token") + expect(auth_hash["extra"]["method"]).to eq("idcatmobil") + end + + it "is accessible with symbol keys in nested hashes" do + expect(auth_hash[:info][:email]).to eq("email@example.net") + expect(auth_hash[:info][:name]).to eq("Oriol") + expect(auth_hash[:credentials][:token]).to eq("fake_token") + expect(auth_hash[:extra][:method]).to eq("idcatmobil") + end + + it "supports mixed string and symbol access" do + expect(auth_hash["info"][:email]).to eq("email@example.net") + expect(auth_hash[:info]["name"]).to eq("Oriol") + expect(auth_hash["credentials"][:token]).to eq("fake_token") + expect(auth_hash[:extra]["method"]).to eq("idcatmobil") + end + end +end From 6d1f92fa7fd1f8df66d7896a21b71e294c4a840d Mon Sep 17 00:00:00 2001 From: Oliver Valls <199462+tramuntanal@users.noreply.github.com> Date: Wed, 21 Jan 2026 12:22:15 +0100 Subject: [PATCH 3/4] Bump version of GitHub actions used in CI --- .github/workflows/linters.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 160d896..024ebeb 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.0.0 + - uses: actions/checkout@v4 with: fetch-depth: 1 @@ -25,7 +25,7 @@ jobs: ruby-version: ${{ env.RUBY_VERSION }} - name: Recover Ruby dependency cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ./vendor/bundle key: ${{ runner.OS }}-rubydeps-${{ hashFiles('Gemfile.lock') }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d23cbc..0cff8b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.0.0 + - uses: actions/checkout@v4 with: fetch-depth: 1 @@ -25,7 +25,7 @@ jobs: ruby-version: ${{ env.RUBY_VERSION }} - name: Recover Ruby dependency cache - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ./vendor/bundle key: ${{ runner.OS }}-rubydeps-${{ hashFiles('Gemfile.lock') }} From 9d12369a43bbaf610efe474254f3cde60df41e0b Mon Sep 17 00:00:00 2001 From: Oliver Valls <199462+tramuntanal@users.noreply.github.com> Date: Tue, 27 Jan 2026 11:39:19 +0100 Subject: [PATCH 4/4] Add explanation why upgrade Hashie --- omniauth-idcat_mobil.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/omniauth-idcat_mobil.gemspec b/omniauth-idcat_mobil.gemspec index 0a1b6ca..9100fbe 100644 --- a/omniauth-idcat_mobil.gemspec +++ b/omniauth-idcat_mobil.gemspec @@ -24,6 +24,8 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] + # Hashie >= 5.0.0 is required for compatibility with newer ActiveSupport versions. + # Older versions of Hashie have conflicts with ActiveSupport's Hash extensions. spec.add_dependency "hashie", ">=5.0.0" spec.add_dependency "omniauth", "~> 2.1.2" spec.add_dependency "omniauth-oauth2", ">= 1.7.2", "< 2.0"