Skip to content

Commit 5a88c22

Browse files
authored
Relocate ActionDispatch DynamoDB (#161)
1 parent 7fb40c4 commit 5a88c22

File tree

20 files changed

+15
-537
lines changed

20 files changed

+15
-537
lines changed

CHANGELOG.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
Unreleased Changes
22
------------------
33

4-
* Feature - Prepare modularization of `aws-record`.
4+
* Feature - DynamoDB Session Storage features now live in the `aws-actiondispatch-dynamodb` gem. This gem depends on `aws-sessionstore-dynamodb ~> 3` which depends on `rack ~> 3` and is not supported by Rails `7.0`.
55

66
* Feature - Add session store config generation with `rails generate dynamo_db:session_store_config`. Config generation is no longer tied to the DynamoDB SessionStore ActiveRecord migration generator.
77

8-
* Feature - Prepare modularization of `aws-sessionstore-dynamodb`.
9-
10-
* Feature - Depend on `aws-sessionstore-dynamodb ~> 3` which depends on `rack ~> 3` and is not supported by Rails `7.0`.
11-
128
* Issue - `ActionDispatch::Session::DynamoDbStore` now inherits `ActionDispatch::Session::AbstractStore` by wrapping `Aws::SessionStore::DynamoDB::RackMiddleware`.
139

1410
* Issue - `DynamoDbStore` is now configured with the `:dynamo_db_store` configuration instead of `:dynamodb_store`.
1511

16-
* Feature - `DYNAMO_DB_SESSION_CONFIG_FILE` is now searched and with precedence over the default Rails configuration YAML file locations.
12+
* Feature - Session Store configuration passed into `:dynamo_db_store` in an initializer will now be considered when using the ActiveRecord migrations or rake tasks that create, delete, or clean session tables.
1713

18-
* Feature - Session Store configuration passed into `:dynamo_db_store` will now be considered when using the ActiveRecord migrations or rake tasks that create, delete, or clean session tables.
14+
* Feature - `AWS_DYNAMO_DB_SESSION_CONFIG_FILE` is now searched and with precedence over the default Rails configuration YAML file locations.
15+
16+
* Feature - Prepare modularization of `aws-record`.
1917

2018
* Issue - Do not skip autoload modules for `Aws::Rails.instrument_sdk_operations`.
2119

22-
* Issue - Add deprecation warning to `Aws::Rails.add_action_mailer_delivery_method` to instead use `ActionMailer::Base.add_delivery_method`.
20+
* Feature - ActionMailer SES and SESV2 mailers now live in the `aws-actionmailer-ses` gem.
21+
22+
* Feature - New namespace and class names for SES and SESV2 mailers. `Aws::Rails::SesMailer` has been moved to `Aws::ActionMailer::SES::Mailer` and `Aws::Rails::Sesv2Mailer` has been moved to `Aws::ActionMailer::SESV2::Mailer`. The classes have been symlinked for backwards compatibility in this major version.
2323

24-
* Feature - New namespace and class names for SES and SESV2 mailers. Existing namespace has temporarily been kept for backward compatibility. These now live in the `aws-actionmailer-ses` gem.
24+
* Issue - Add deprecation warning to `Aws::Rails.add_action_mailer_delivery_method` to instead use `ActionMailer::Base.add_delivery_method`. This method will be removed in the next major version.
2525

2626
4.1.0 (2024-09-27)
2727
------------------

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source 'https://rubygems.org'
44

55
gemspec
66

7+
gem 'aws-actiondispatch-dynamodb', git: 'https://github.com/aws/aws-actiondispatch-dynamodb-ruby'
78
gem 'aws-actionmailer-ses', git: 'https://github.com/aws/aws-actionmailer-ses-ruby'
89

910
group :development, :test do

aws-sdk-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Gem::Specification.new do |spec|
1515
spec.executables = ['aws_sqs_active_job']
1616

1717
# These will be removed in aws-sdk-rails ~> 5
18+
spec.add_dependency('aws-actiondispatch-dynamodb', '~> 0')
1819
spec.add_dependency('aws-actionmailer-ses', '~> 0')
1920
spec.add_dependency('aws-record', '~> 2') # for Aws::Record integration
20-
spec.add_dependency('aws-sessionstore-dynamodb', '~> 3') # includes DynamoDB
2121

2222
# Require these versions for user_agent_framework configs
2323
spec.add_dependency('aws-sdk-s3', '~> 1', '>= 1.123.0')

lib/action_dispatch/session/dynamo_db_store.rb

Lines changed: 0 additions & 72 deletions
This file was deleted.

lib/aws-sdk-rails.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
require_relative 'aws/rails/middleware/ebs_sqs_active_job_middleware'
88

99
# remove this in aws-sdk-rails 5
10-
require 'aws-sessionstore-dynamodb'
10+
require 'aws-actiondispatch-dynamodb'
1111
require 'aws-actionmailer-ses'
1212

13-
require_relative 'action_dispatch/session/dynamo_db_store' if defined?(Aws::SessionStore::DynamoDB::RackMiddleware)
14-
1513
module Aws
1614
module Rails
1715
VERSION = File.read(File.expand_path('../VERSION', __dir__)).strip

lib/aws/rails/middleware/ebs_sqs_active_job_middleware.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(app)
1515
end
1616

1717
def call(env)
18-
request = ActionDispatch::Request.new(env)
18+
request = ::ActionDispatch::Request.new(env)
1919

2020
# Pass through unless user agent is the SQS Daemon
2121
return @app.call(env) unless from_sqs_daemon?(request)

lib/aws/rails/railtie.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Railtie < ::Rails::Railtie
5050
end
5151

5252
rake_tasks do
53-
load 'tasks/dynamo_db/session_store.rake' if defined?(Aws::SessionStore::DynamoDB)
53+
load 'tasks/dynamo_db/session_store.rake' if defined?(Aws::ActionDispatch::DynamoDb)
5454
load 'tasks/aws_record/migrate.rake' if defined?(Aws::Record)
5555
end
5656
end

lib/generators/dynamo_db/session_store_config/USAGE

Lines changed: 0 additions & 16 deletions
This file was deleted.

lib/generators/dynamo_db/session_store_config/session_store_config_generator.rb

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/generators/dynamo_db/session_store_config/templates/dynamo_db_session_store.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

lib/generators/dynamo_db/session_store_migration/USAGE

Lines changed: 0 additions & 17 deletions
This file was deleted.

lib/generators/dynamo_db/session_store_migration/session_store_migration_generator.rb

Lines changed: 0 additions & 39 deletions
This file was deleted.

lib/generators/dynamo_db/session_store_migration/templates/session_store_migration.erb

Lines changed: 0 additions & 13 deletions
This file was deleted.

lib/tasks/dynamo_db/session_store.rake

Lines changed: 0 additions & 23 deletions
This file was deleted.

sample-app/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Got notification: update_item.DynamoDB.aws ...
7373

7474
### Setup
7575

76-
This is configured in `config/initializers/session_store.rb`. See [this guide](https://guides.rubyonrails.org/v3.1/configuring.html#rails-general-configuration) and the `aws-sdk-rails` README.
76+
This is configured in `config/initializers/session_store.rb`. See [this guide](https://guides.rubyonrails.org/configuring.html#config-session-store) and the `aws-sdk-rails` README.
7777

7878
The default configuration file was generated with `bundle exec rails generate dynamo_db:session_store_config`.
7979

0 commit comments

Comments
 (0)