Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relocate ActionDispatch DynamoDB #161

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Unreleased Changes
------------------

* Feature - Prepare modularization of `aws-record`.
* 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`.

* 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.

* Feature - Prepare modularization of `aws-sessionstore-dynamodb`.

* Feature - Depend on `aws-sessionstore-dynamodb ~> 3` which depends on `rack ~> 3` and is not supported by Rails `7.0`.

* Issue - `ActionDispatch::Session::DynamoDbStore` now inherits `ActionDispatch::Session::AbstractStore` by wrapping `Aws::SessionStore::DynamoDB::RackMiddleware`.

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

* Feature - `DYNAMO_DB_SESSION_CONFIG_FILE` is now searched and with precedence over the default Rails configuration YAML file locations.
* 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.

* 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.
* Feature - `AWS_DYNAMO_DB_SESSION_CONFIG_FILE` is now searched and with precedence over the default Rails configuration YAML file locations.

* Feature - Prepare modularization of `aws-record`.

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

* Issue - Add deprecation warning to `Aws::Rails.add_action_mailer_delivery_method` to instead use `ActionMailer::Base.add_delivery_method`.
* Feature - ActionMailer SES and SESV2 mailers now live in the `aws-actionmailer-ses` gem.

* 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.

* 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.
* 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.

4.1.0 (2024-09-27)
------------------
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source 'https://rubygems.org'

gemspec

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

group :development, :test do
Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Gem::Specification.new do |spec|
spec.executables = ['aws_sqs_active_job']

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

# Require these versions for user_agent_framework configs
spec.add_dependency('aws-sdk-s3', '~> 1', '>= 1.123.0')
Expand Down
72 changes: 0 additions & 72 deletions lib/action_dispatch/session/dynamo_db_store.rb

This file was deleted.

4 changes: 1 addition & 3 deletions lib/aws-sdk-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
require_relative 'aws/rails/middleware/ebs_sqs_active_job_middleware'

# remove this in aws-sdk-rails 5
require 'aws-sessionstore-dynamodb'
require 'aws-actiondispatch-dynamodb'
require 'aws-actionmailer-ses'

require_relative 'action_dispatch/session/dynamo_db_store' if defined?(Aws::SessionStore::DynamoDB::RackMiddleware)

module Aws
module Rails
VERSION = File.read(File.expand_path('../VERSION', __dir__)).strip
Expand Down
2 changes: 1 addition & 1 deletion lib/aws/rails/middleware/ebs_sqs_active_job_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(app)
end

def call(env)
request = ActionDispatch::Request.new(env)
request = ::ActionDispatch::Request.new(env)

# Pass through unless user agent is the SQS Daemon
return @app.call(env) unless from_sqs_daemon?(request)
Expand Down
2 changes: 1 addition & 1 deletion lib/aws/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Railtie < ::Rails::Railtie
end

rake_tasks do
load 'tasks/dynamo_db/session_store.rake' if defined?(Aws::SessionStore::DynamoDB)
load 'tasks/dynamo_db/session_store.rake' if defined?(Aws::ActionDispatch::DynamoDb)
load 'tasks/aws_record/migrate.rake' if defined?(Aws::Record)
end
end
Expand Down
16 changes: 0 additions & 16 deletions lib/generators/dynamo_db/session_store_config/USAGE

This file was deleted.

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions lib/generators/dynamo_db/session_store_migration/USAGE

This file was deleted.

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions lib/tasks/dynamo_db/session_store.rake

This file was deleted.

2 changes: 1 addition & 1 deletion sample-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Got notification: update_item.DynamoDB.aws ...

### Setup

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.
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.

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

Expand Down
Loading