@@ -13,15 +13,13 @@ module Session
13
13
# unless otherwise provided.
14
14
#
15
15
# 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`.
17
18
# Configuration files that are environment-specific will take precedence.
18
19
#
19
20
# @see https://docs.aws.amazon.com/sdk-for-ruby/aws-sessionstore-dynamodb/api/Aws/SessionStore/DynamoDB/Configuration.html
20
21
class DynamoDbStore < ActionDispatch ::Session ::AbstractStore
21
22
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. **' )
25
23
options [ :config_file ] ||= config_file
26
24
options [ :secret_key ] ||= Rails . application . secret_key_base
27
25
@middleware = Aws ::SessionStore ::DynamoDB ::RackMiddleware . new ( app , options )
@@ -51,34 +49,12 @@ def delete_session(req, sid, options)
51
49
@middleware . delete_session ( req , sid , options )
52
50
end
53
51
54
- # rubocop:disable Metrics
55
52
def config_file
56
53
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 )
69
56
file if File . exist? ( file )
70
57
end
71
58
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
83
59
end
84
60
end
0 commit comments