Skip to content

Commit a7dea4c

Browse files
authored
Merge pull request #2 from aws/1.0
2 parents 0c41c79 + 0e48832 commit a7dea4c

File tree

2 files changed

+10
-28
lines changed

2 files changed

+10
-28
lines changed

CHANGELOG.md

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

4+
* Feature - [Major Version] Bump major version to 1.0.0.
5+
6+
* Issue - Drop support for any non-aws prefixed configuration keys.
7+
8+
* Issue - Drop support for the `:dynamodb_store` configuration name.
9+
410
0.2.0 (2024-11-17)
511
------------------
612

lib/action_dispatch/session/dynamo_db_store.rb

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ module Session
1313
# unless otherwise provided.
1414
#
1515
# Configuration can also be provided in YAML files from Rails config, either
16-
# in `config/dynamo_db_session_store.yml` or `config/dynamo_db_session_store/{Rails.env}.yml`.
16+
# in `config/aws_dynamo_db_session_store.yml` or
17+
# `config/aws_dynamo_db_session_store/{Rails.env}.yml`.
1718
# Configuration files that are environment-specific will take precedence.
1819
#
1920
# @see https://docs.aws.amazon.com/sdk-for-ruby/aws-sessionstore-dynamodb/api/Aws/SessionStore/DynamoDB/Configuration.html
2021
class DynamoDbStore < ActionDispatch::Session::AbstractStore
2122
def initialize(app, options = {})
22-
Rails.logger.warn('** Dynamo DB Session Storage no longer lives in aws-sdk-rails. ' \
23-
'To avoid disruption, please add aws-actiondispatch-dynamodb ~> 0 to your Gemfile to ' \
24-
'enable this feature when upgrading to aws-sdk-rails ~> 5. **')
2523
options[:config_file] ||= config_file
2624
options[:secret_key] ||= Rails.application.secret_key_base
2725
@middleware = Aws::SessionStore::DynamoDB::RackMiddleware.new(app, options)
@@ -51,34 +49,12 @@ def delete_session(req, sid, options)
5149
@middleware.delete_session(req, sid, options)
5250
end
5351

54-
# rubocop:disable Metrics
5552
def config_file
5653
file = ENV.fetch('AWS_DYNAMO_DB_SESSION_CONFIG_FILE', nil)
57-
file ||= Rails.root.join("config/dynamo_db_session_store/#{Rails.env}.yml")
58-
file = Rails.root.join('config/dynamo_db_session_store.yml') unless File.exist?(file)
59-
if File.exist?(file)
60-
Rails.logger.warn('The dynamo_db_session_store configuration file has been renamed.' \
61-
'Please use aws_dynamo_db_session_store/<Rails.env>.yml or ' \
62-
'aws_dynamo_db_session_store.yml. This will be removed in ' \
63-
'aws-actiondispatch-dynamodb ~> 1')
64-
else
65-
file = Rails.root.join("config/aws_dynamo_db_session_store/#{Rails.env}.yml")
66-
file = Rails.root.join('config/aws_dynamo_db_session_store.yml') unless File.exist?(file)
67-
end
68-
54+
file ||= Rails.root.join("config/aws_dynamo_db_session_store/#{Rails.env}.yml")
55+
file = Rails.root.join('config/aws_dynamo_db_session_store.yml') unless File.exist?(file)
6956
file if File.exist?(file)
7057
end
7158
end
72-
# rubocop:enable Metrics
73-
74-
# @api private
75-
class DynamodbStore < DynamoDbStore
76-
def initialize(app, options = {})
77-
Rails.logger.warn('** Session Store :dynamodb_store configuration key has been renamed to :dynamo_db_store, ' \
78-
'please use the new key instead. The :dynamodb_store key name will be removed in ' \
79-
'aws-actiondispatch-dynamodb ~> 1 **')
80-
super
81-
end
82-
end
8359
end
8460
end

0 commit comments

Comments
 (0)