Commit af44044

mo khan <mo@mokhan.ca>
2025-03-26 20:07:25
chore: Upgrade min ruby to 3.1
1 parent f612141
.github/workflows/ci.yml
@@ -8,7 +8,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
+        ruby-version: ['3.1', '3.2', '3.3', '3.4']
     steps:
       - uses: actions/checkout@v2
       - uses: ruby/setup-ruby@v1
@@ -22,7 +22,7 @@ jobs:
       - uses: actions/checkout@v2
       - uses: ruby/setup-ruby@v1
         with:
-          ruby-version: '2.7'
+          ruby-version: '3.1'
           bundler-cache: true
       - run: sh bin/style
   audit:
@@ -31,6 +31,6 @@ jobs:
       - uses: actions/checkout@v2
       - uses: ruby/setup-ruby@v1
         with:
-          ruby-version: '2.7'
+          ruby-version: '3.1'
           bundler-cache: true
       - run: sh bin/audit
.rubocop.yml
@@ -1,7 +1,7 @@
 inherit_from: .rubocop_todo.yml
 
-require:
-  - rubocop/cop/internal_affairs
+plugins:
+  - rubocop-internal_affairs
   - rubocop-rspec
 
 AllCops:
@@ -12,7 +12,7 @@ AllCops:
     - 'spec/examples/**/*'
     - 'tmp/**/*'
     - 'vendor/**/*'
-  TargetRubyVersion: 2.7
+  TargetRubyVersion: 3.1
 
 Layout/ArgumentAlignment:
   EnforcedStyle: with_fixed_indentation
@@ -47,6 +47,13 @@ Layout/FirstArrayElementIndentation:
 Layout/HeredocIndentation:
   EnforcedStyle: active_support
 
+Layout/LineLength:
+  Exclude:
+    - 'lib/saml/kit/builders/templates/*.builder'
+    - 'spec/**/*.rb'
+  IgnoredPatterns:
+    - '^#*'
+
 Layout/MultilineMethodCallIndentation:
   Enabled: true
   EnforcedStyle: indented
@@ -71,13 +78,6 @@ Metrics/ModuleLength:
   Exclude:
     - 'spec/**/*.rb'
 
-Metrics/LineLength:
-  Exclude:
-    - 'lib/saml/kit/builders/templates/*.builder'
-    - 'spec/**/*.rb'
-  IgnoredPatterns:
-    - '^#*'
-
 Naming/FileName:
   Exclude:
     - 'lib/saml-kit.rb'
.rubocop_todo.yml
@@ -1,21 +1,164 @@
 # This configuration was generated by
 # `rubocop --auto-gen-config`
-# on 2018-03-16 13:38:09 -0600 using RuboCop version 0.53.0.
+# on 2025-03-26 20:04:33 UTC using RuboCop version 1.75.1.
 # The point is for the user to remove these configuration records
 # one by one as the offenses are removed from the code base.
 # Note that changes in the inspected code, or installation of new
 # versions of RuboCop, may require this file to be generated again.
 
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: EnforcedStyleAlignWith, Severity.
+# SupportedStylesAlignWith: start_of_line, begin
+Layout/BeginEndAlignment:
+  Exclude:
+    - 'exe/saml-kit-decode-http-redirect'
+
+# Offense count: 3
+# This cop supports unsafe autocorrection (--autocorrect-all).
+# Configuration parameters: Categories, ExpectedOrder.
+# ExpectedOrder: module_inclusion, constants, public_class_methods, initializer, public_methods, protected_methods, private_methods
+Layout/ClassStructure:
+  Exclude:
+    - 'lib/saml/kit/identity_provider_metadata.rb'
+    - 'lib/saml/kit/metadata.rb'
+    - 'lib/saml/kit/service_provider_metadata.rb'
+
+# Offense count: 4
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: AllowAliasSyntax, AllowedMethods.
+# AllowedMethods: alias_method, public, protected, private
+Layout/EmptyLinesAroundAttributeAccessor:
+  Exclude:
+    - 'lib/saml/kit/builders/encrypted_assertion.rb'
+    - 'lib/saml/kit/builders/identity_provider_metadata.rb'
+    - 'lib/saml/kit/builders/service_provider_metadata.rb'
+    - 'lib/saml/kit/document.rb'
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+Layout/RescueEnsureAlignment:
+  Exclude:
+    - 'exe/saml-kit-decode-http-redirect'
+
+# Offense count: 15
+# This cop supports safe autocorrection (--autocorrect).
+Lint/DeprecatedOpenSSLConstant:
+  Exclude:
+    - 'lib/saml/kit/bindings/http_redirect.rb'
+    - 'lib/saml/kit/bindings/url_builder.rb'
+    - 'spec/saml/kit/authentication_request_spec.rb'
+    - 'spec/saml/kit/bindings/url_builder_spec.rb'
+    - 'spec/saml/kit/configuration_spec.rb'
+    - 'spec/saml/kit/signature_spec.rb'
+
 # Offense count: 2
+# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
 Metrics/AbcSize:
   Max: 19
 
-# Offense count: 11
-# Configuration parameters: CountComments.
+# Offense count: 5
+# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
 Metrics/MethodLength:
   Max: 13
 
 # Offense count: 1
-Style/DateTime:
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: be, be_nil
+RSpec/BeNil:
+  Exclude:
+    - 'spec/saml/kit/kit_spec.rb'
+
+# Offense count: 2
+RSpec/IdenticalEqualityAssertion:
+  Exclude:
+    - 'spec/saml/kit/bindings/http_post_spec.rb'
+    - 'spec/saml/kit/logout_response_spec.rb'
+
+# Offense count: 39
+# This cop supports safe autocorrection (--autocorrect).
+RSpec/MatchArray:
+  Exclude:
+    - 'spec/saml/kit/assertion_spec.rb'
+    - 'spec/saml/kit/builders/identity_provider_metadata_spec.rb'
+    - 'spec/saml/kit/builders/service_provider_metadata_spec.rb'
+    - 'spec/saml/kit/composite_metadata_spec.rb'
+    - 'spec/saml/kit/configuration_spec.rb'
+    - 'spec/saml/kit/default_registry_spec.rb'
+    - 'spec/saml/kit/identity_provider_metadata_spec.rb'
+    - 'spec/saml/kit/response_spec.rb'
+    - 'spec/saml/kit/service_provider_metadata_spec.rb'
+    - 'spec/saml/kit/signature_spec.rb'
+
+# Offense count: 4
+# This cop supports unsafe autocorrection (--autocorrect-all).
+RSpec/ReceiveMessages:
+  Exclude:
+    - 'spec/saml/kit/logout_request_spec.rb'
+
+# Offense count: 1
+# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
+# Include: **/*_spec.rb
+RSpec/SpecFilePathFormat:
+  Exclude:
+    - '**/spec/routing/**/*'
+    - 'spec/saml/kit/kit_spec.rb'
+
+# Offense count: 1
+RSpec/SubjectDeclaration:
+  Exclude:
+    - 'spec/saml/kit/identity_provider_metadata_spec.rb'
+
+# Offense count: 19
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: separated, grouped
+Style/AccessorGrouping:
+  Exclude:
+    - 'lib/saml/kit/builders/assertion.rb'
+    - 'lib/saml/kit/builders/authentication_request.rb'
+    - 'lib/saml/kit/builders/identity_provider_metadata.rb'
+    - 'lib/saml/kit/builders/logout_response.rb'
+    - 'lib/saml/kit/builders/metadata.rb'
+    - 'lib/saml/kit/builders/service_provider_metadata.rb'
+
+# Offense count: 3
+# This cop supports safe autocorrection (--autocorrect).
+Style/ExplicitBlockArgument:
+  Exclude:
+    - 'lib/saml/kit/concerns/validatable.rb'
+    - 'lib/saml/kit/default_registry.rb'
+    - 'spec/support/ruby_prof.rb'
+
+# Offense count: 4
+# This cop supports unsafe autocorrection (--autocorrect-all).
+Style/GlobalStdStream:
+  Exclude:
+    - 'exe/saml-kit-create-self-signed-certificate'
+    - 'exe/saml-kit-decode-http-post'
+    - 'exe/saml-kit-decode-http-redirect'
+    - 'lib/saml/kit/configuration.rb'
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+Style/IfUnlessModifier:
+  Exclude:
+    - 'lib/saml/kit/builders/authentication_request.rb'
+
+# Offense count: 26
+# This cop supports unsafe autocorrection (--autocorrect-all).
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: literals, strict
+Style/MutableConstant:
+  Exclude:
+    - 'lib/saml/kit/bindings.rb'
+    - 'lib/saml/kit/namespaces.rb'
+
+# Offense count: 1
+# This cop supports unsafe autocorrection (--autocorrect-all).
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only
+Style/YodaCondition:
   Exclude:
-    - 'lib/saml/kit/conditions.rb'
+    - 'lib/saml/kit/concerns/respondable.rb'
CHANGELOG.md
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Added
 - Add support for converting `Assertion` xml to `Saml::Document`
 
+### Removed
+- Drop support for ruby 2.7
+- Drop support for ruby 3.0
+
 ## [1.3.0] - 2022-03-30
 ### Removed
 
Gemfile.lock
@@ -3,99 +3,126 @@ PATH
   specs:
     saml-kit (1.3.0)
       activemodel (>= 5.1, < 8.0)
-      net-hippie (>= 0.1, < 2.0)
+      base64 (~> 0.1)
+      net-hippie (~> 1.0)
       xml-kit (~> 0.4)
 
 GEM
   remote: https://rubygems.org/
   specs:
-    activemodel (7.0.4)
-      activesupport (= 7.0.4)
-    activesupport (7.0.4)
-      concurrent-ruby (~> 1.0, >= 1.0.2)
+    activemodel (7.2.2.1)
+      activesupport (= 7.2.2.1)
+    activesupport (7.2.2.1)
+      base64
+      benchmark (>= 0.3)
+      bigdecimal
+      concurrent-ruby (~> 1.0, >= 1.3.1)
+      connection_pool (>= 2.2.5)
+      drb
       i18n (>= 1.6, < 2)
+      logger (>= 1.4.2)
       minitest (>= 5.1)
-      tzinfo (~> 2.0)
-    addressable (2.8.0)
-      public_suffix (>= 2.0.2, < 5.0)
-    ast (2.4.2)
+      securerandom (>= 0.3)
+      tzinfo (~> 2.0, >= 2.0.5)
+    addressable (2.8.7)
+      public_suffix (>= 2.0.2, < 7.0)
+    ast (2.4.3)
+    base64 (0.2.0)
+    benchmark (0.4.0)
     benchmark-malloc (0.2.0)
     benchmark-perf (0.6.0)
     benchmark-trend (0.4.0)
-    builder (3.2.4)
-    bundler-audit (0.9.1)
+    bigdecimal (3.1.9)
+    builder (3.3.0)
+    bundler-audit (0.9.2)
       bundler (>= 1.2.0, < 3)
       thor (~> 1.0)
-    concurrent-ruby (1.1.10)
-    crack (0.4.5)
+    concurrent-ruby (1.3.5)
+    connection_pool (2.5.0)
+    crack (1.0.0)
+      bigdecimal
       rexml
-    diff-lcs (1.5.0)
-    docile (1.3.5)
-    ffaker (2.21.0)
-    hashdiff (1.0.1)
-    i18n (1.12.0)
+    diff-lcs (1.6.1)
+    docile (1.4.1)
+    drb (2.2.1)
+    ffaker (2.24.0)
+    hashdiff (1.1.2)
+    i18n (1.14.7)
       concurrent-ruby (~> 1.0)
-    mini_portile2 (2.8.0)
-    minitest (5.16.3)
-    net-hippie (1.1.1)
-    nokogiri (1.13.6)
-      mini_portile2 (~> 2.8.0)
+    json (2.10.2)
+    language_server-protocol (3.17.0.4)
+    lint_roller (1.1.0)
+    logger (1.6.6)
+    mini_portile2 (2.8.8)
+    minitest (5.25.5)
+    net-hippie (1.2.0)
+      logger (~> 1.0)
+    nokogiri (1.18.6)
+      mini_portile2 (~> 2.8.2)
       racc (~> 1.4)
-    parallel (1.20.1)
-    parser (3.0.0.0)
+    parallel (1.26.3)
+    parser (3.3.7.3)
       ast (~> 2.4.1)
-    public_suffix (4.0.7)
-    racc (1.6.0)
-    rainbow (3.0.0)
-    rake (13.0.6)
-    regexp_parser (2.0.3)
-    rexml (3.2.5)
-    rspec (3.11.0)
-      rspec-core (~> 3.11.0)
-      rspec-expectations (~> 3.11.0)
-      rspec-mocks (~> 3.11.0)
+      racc
+    prism (1.4.0)
+    public_suffix (6.0.1)
+    racc (1.8.1)
+    rainbow (3.1.1)
+    rake (13.2.1)
+    regexp_parser (2.10.0)
+    rexml (3.4.1)
+    rspec (3.13.0)
+      rspec-core (~> 3.13.0)
+      rspec-expectations (~> 3.13.0)
+      rspec-mocks (~> 3.13.0)
     rspec-benchmark (0.6.0)
       benchmark-malloc (~> 0.2)
       benchmark-perf (~> 0.6)
       benchmark-trend (~> 0.4)
       rspec (>= 3.0)
-    rspec-core (3.11.0)
-      rspec-support (~> 3.11.0)
-    rspec-expectations (3.11.0)
+    rspec-core (3.13.3)
+      rspec-support (~> 3.13.0)
+    rspec-expectations (3.13.3)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.11.0)
-    rspec-mocks (3.11.0)
+      rspec-support (~> 3.13.0)
+    rspec-mocks (3.13.2)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.11.0)
-    rspec-support (3.11.0)
-    rubocop (0.93.1)
+      rspec-support (~> 3.13.0)
+    rspec-support (3.13.2)
+    rubocop (1.75.1)
+      json (~> 2.3)
+      language_server-protocol (~> 3.17.0.2)
+      lint_roller (~> 1.1.0)
       parallel (~> 1.10)
-      parser (>= 2.7.1.5)
+      parser (>= 3.3.0.2)
       rainbow (>= 2.2.2, < 4.0)
-      regexp_parser (>= 1.8)
-      rexml
-      rubocop-ast (>= 0.6.0)
+      regexp_parser (>= 2.9.3, < 3.0)
+      rubocop-ast (>= 1.43.0, < 2.0)
       ruby-progressbar (~> 1.7)
-      unicode-display_width (>= 1.4.0, < 2.0)
-    rubocop-ast (1.4.1)
-      parser (>= 2.7.1.5)
-    rubocop-rspec (1.44.1)
-      rubocop (~> 0.87)
-      rubocop-ast (>= 0.7.1)
-    ruby-prof (1.4.3)
-    ruby-progressbar (1.11.0)
-    simplecov (0.21.2)
+      unicode-display_width (>= 2.4.0, < 4.0)
+    rubocop-ast (1.43.0)
+      parser (>= 3.3.7.2)
+      prism (~> 1.4)
+    rubocop-rspec (3.5.0)
+      lint_roller (~> 1.1)
+      rubocop (~> 1.72, >= 1.72.1)
+    ruby-prof (1.7.1)
+    ruby-progressbar (1.13.0)
+    securerandom (0.4.1)
+    simplecov (0.22.0)
       docile (~> 1.1)
       simplecov-html (~> 0.11)
       simplecov_json_formatter (~> 0.1)
-    simplecov-html (0.12.3)
-    simplecov_json_formatter (0.1.2)
-    thor (1.2.1)
-    tilt (2.0.10)
-    tzinfo (2.0.5)
+    simplecov-html (0.13.1)
+    simplecov_json_formatter (0.1.4)
+    thor (1.3.2)
+    tilt (2.6.0)
+    tzinfo (2.0.6)
       concurrent-ruby (~> 1.0)
-    unicode-display_width (1.7.0)
-    webmock (3.18.1)
+    unicode-display_width (3.1.4)
+      unicode-emoji (~> 4.0, >= 4.0.4)
+    unicode-emoji (4.0.4)
+    webmock (3.25.1)
       addressable (>= 2.8.0)
       crack (>= 0.3.2)
       hashdiff (>= 0.4.0, < 2.0.0)
@@ -105,7 +132,7 @@ GEM
       nokogiri (~> 1.10)
       tilt (>= 1.4.1)
       xmldsig (~> 0.6)
-    xmldsig (0.6.6)
+    xmldsig (0.7.0)
       nokogiri (>= 1.6.8, < 2.0.0)
 
 PLATFORMS
@@ -118,12 +145,12 @@ DEPENDENCIES
   rake (~> 13.0)
   rspec (~> 3.0)
   rspec-benchmark (~> 0.3)
-  rubocop (~> 0.52)
-  rubocop-rspec (~> 1.22)
+  rubocop (~> 1.0)
+  rubocop-rspec (~> 3.0)
   ruby-prof
   saml-kit!
   simplecov (~> 0.15)
   webmock (~> 3.1)
 
 BUNDLED WITH
-   2.1.4
+   2.6.6
saml-kit.gemspec
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
   spec.description   = 'A simple toolkit for working with SAML.'
   spec.homepage      = 'https://github.com/xlgmokha/saml-kit'
   spec.license       = 'MIT'
-  spec.required_ruby_version = '>= 2.7.0'
+  spec.required_ruby_version = '>= 3.1.0'
 
   spec.files = `git ls-files -z`.split("\x0").reject do |f|
     (
@@ -29,7 +29,8 @@ Gem::Specification.new do |spec|
   spec.require_paths = ['lib']
 
   spec.add_dependency 'activemodel', '>= 5.1', '< 8.0'
-  spec.add_dependency 'net-hippie', '>= 0.1', '< 2.0'
+  spec.add_dependency 'base64', '~> 0.1'
+  spec.add_dependency 'net-hippie', '~> 1.0'
   spec.add_dependency 'xml-kit', '~> 0.4'
   spec.add_development_dependency 'bundler', '~> 2.0'
   spec.add_development_dependency 'bundler-audit', '~> 0.6'
@@ -37,8 +38,8 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency 'rake', '~> 13.0'
   spec.add_development_dependency 'rspec', '~> 3.0'
   spec.add_development_dependency 'rspec-benchmark', '~> 0.3'
-  spec.add_development_dependency 'rubocop', '~> 0.52'
-  spec.add_development_dependency 'rubocop-rspec', '~> 1.22'
+  spec.add_development_dependency 'rubocop', '~> 1.0'
+  spec.add_development_dependency 'rubocop-rspec', '~> 3.0'
   spec.add_development_dependency 'ruby-prof'
   spec.add_development_dependency 'simplecov', '~> 0.15'
   spec.add_development_dependency 'webmock', '~> 3.1'