From 5e593d842725e1552b12391cbb13e2f32b591989 Mon Sep 17 00:00:00 2001
From: Matt Muller <mamuller@amazon.com>
Date: Tue, 23 Jan 2024 15:13:29 -0500
Subject: [PATCH 1/4] Loosen rack requirement to allow for rack 3

---
 .github/workflows/ci.yml          | 25 +++++++++++++++++++------
 .travis.yml                       | 24 ------------------------
 CHANGELOG.md                      |  2 ++
 Gemfile                           |  6 +++++-
 aws-sessionstore-dynamodb.gemspec |  3 ++-
 spec/spec_helper.rb               |  9 ++-------
 6 files changed, 30 insertions(+), 39 deletions(-)
 delete mode 100644 .travis.yml

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 657c1ad..5299ec8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,18 +15,31 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, jruby-9.1, jruby-9.2, jruby-9.3, jruby-9.4]
+        ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, jruby-9.1, jruby-9.2, jruby-9.3, jruby-9.4]
+        env: [RACK2, RACK3]
+        exclude:
+          # Rack 3 requires Ruby >= 2.4
+          - ruby: 2.3
+            env: RACK3
+          - ruby: jruby-9.1
+            env: RACK3
 
     steps:
-      - name: Setup
+      - name: Setup Ruby
         uses: ruby/setup-ruby@v1
         with:
           ruby-version: ${{ matrix.ruby }}
 
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
 
-      - name: Install
-        run: bundle install --without docs
+      - name: Setup environment
+        run: |
+          echo "${{ matrix.env }}=1" >> $GITHUB_ENV
 
-      - name: Test
+      - name: Install gems
+        run: |
+          bundle config set --local without 'docs'
+          bundle install
+
+      - name: Tests
         run: bundle exec rake spec
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 620a94b..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-branches:
-  only:
-    - master
-
-language: ruby
-
-rvm:
-  - 2.2
-  - 2.3
-  - 2.4
-  - 2.5
-  - 2.6
-  - 2.7
-  - jruby-9.1
-  - jruby-9.2
-
-sudo: false
-
-env:
-  - AWS_REGION=us-west-2
-
-script: bundle exec rake spec
-
-bundler_args: --without docs release repl
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e13ea1a..fc6228b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,8 @@
 Unreleased Changes
 ------------------
 
+* Issue - Relax `rack` dependency to allow version 3. Adds `rack-session` to the gemspec.
+
 2.1.0 (2023-06-02)
 ------------------
 
diff --git a/Gemfile b/Gemfile
index 5df1b50..f84937e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,9 @@
 source 'https://rubygems.org'
 
+if ENV['RACK2']
+  gem 'rack', '~> 2'
+end
+
 gemspec
 
 gem 'rake', require: false
@@ -11,8 +15,8 @@ end
 
 group :test do
   gem 'rspec'
-  gem 'simplecov', require: false
   gem 'rack-test'
+  gem 'simplecov'
 
   if RUBY_VERSION >= '3.0'
     gem 'rexml'
diff --git a/aws-sessionstore-dynamodb.gemspec b/aws-sessionstore-dynamodb.gemspec
index fd19517..d15999b 100644
--- a/aws-sessionstore-dynamodb.gemspec
+++ b/aws-sessionstore-dynamodb.gemspec
@@ -17,5 +17,6 @@ Gem::Specification.new do |spec|
 
   # Require 1.85.0 for user_agent_frameworks config
   spec.add_dependency 'aws-sdk-dynamodb', '~> 1', '>= 1.85.0'
-  spec.add_dependency 'rack', '~> 2'
+  spec.add_dependency 'rack', '>= 2', '< 4'
+  spec.add_dependency 'rack-session', '>= 1', '< 3'
 end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 44da4da..18e3e6e 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -13,13 +13,8 @@
 # ANY KIND, either express or implied. See the License for the specific
 # language governing permissions and limitations under the License.
 
-begin
-  if ENV['COVERAGE']
-    require 'simplecov'
-    SimpleCov.start { add_filter 'spec' }
-  end
-rescue LoadError
-end
+require 'simplecov'
+SimpleCov.start { add_filter 'spec' }
 
 $LOAD_PATH << File.join(File.dirname(File.dirname(__FILE__)), 'lib')
 

From 602cddf58e0167260ee1e5cb0cbc35ab130f1dd1 Mon Sep 17 00:00:00 2001
From: Matt Muller <mamuller@amazon.com>
Date: Tue, 23 Jan 2024 15:22:23 -0500
Subject: [PATCH 2/4] Drop Ruby 2.3 and 2.4 for rack-session

---
 .github/workflows/ci.yml          | 8 +-------
 aws-sessionstore-dynamodb.gemspec | 2 ++
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5299ec8..ce82b1f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,14 +15,8 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, jruby-9.1, jruby-9.2, jruby-9.3, jruby-9.4]
+        ruby: [2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, jruby-9.2, jruby-9.3, jruby-9.4]
         env: [RACK2, RACK3]
-        exclude:
-          # Rack 3 requires Ruby >= 2.4
-          - ruby: 2.3
-            env: RACK3
-          - ruby: jruby-9.1
-            env: RACK3
 
     steps:
       - name: Setup Ruby
diff --git a/aws-sessionstore-dynamodb.gemspec b/aws-sessionstore-dynamodb.gemspec
index d15999b..fcd023a 100644
--- a/aws-sessionstore-dynamodb.gemspec
+++ b/aws-sessionstore-dynamodb.gemspec
@@ -19,4 +19,6 @@ Gem::Specification.new do |spec|
   spec.add_dependency 'aws-sdk-dynamodb', '~> 1', '>= 1.85.0'
   spec.add_dependency 'rack', '>= 2', '< 4'
   spec.add_dependency 'rack-session', '>= 1', '< 3'
+
+  spec.required_ruby_version = '>= 2.5'
 end

From 26c7fa42ec518e916c1f1a7668c4a72f049ca72c Mon Sep 17 00:00:00 2001
From: Matt Muller <mamuller@amazon.com>
Date: Wed, 24 Jan 2024 12:58:27 -0500
Subject: [PATCH 3/4] Add extra changelog line about ruby 2.3 and 2.4 dropping

---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index fc6228b..950fc6f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,8 @@
 Unreleased Changes
 ------------------
 
+* Feature - Drop support for Ruby 2.3 and 2.4.
+
 * Issue - Relax `rack` dependency to allow version 3. Adds `rack-session` to the gemspec.
 
 2.1.0 (2023-06-02)

From 7d88cc2879dd0b126a7f019763e46f5036ca99cd Mon Sep 17 00:00:00 2001
From: Matt Muller <53055821+mullermp@users.noreply.github.com>
Date: Wed, 24 Jan 2024 23:59:35 -0500
Subject: [PATCH 4/4] Update aws-sessionstore-dynamodb.gemspec

---
 aws-sessionstore-dynamodb.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aws-sessionstore-dynamodb.gemspec b/aws-sessionstore-dynamodb.gemspec
index fcd023a..77a2971 100644
--- a/aws-sessionstore-dynamodb.gemspec
+++ b/aws-sessionstore-dynamodb.gemspec
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
   spec.name          = "aws-sessionstore-dynamodb"
   spec.version       = version
   spec.authors       = ["Amazon Web Services"]
-  spec.email         = ["mamuller@amazon.com", "alexwoo@amazon.com"]
+  spec.email         = ["aws-dr-rubygems@amazon.com"]
 
   spec.summary       = "The Amazon DynamoDB Session Store handles sessions " +
                        "for Ruby web applications using a DynamoDB backend."