Class: ActionDispatch::Session::DynamoDbStore
- Inherits:
-
AbstractStore
- Object
- AbstractStore
- ActionDispatch::Session::DynamoDbStore
- Defined in:
- lib/action_dispatch/session/dynamo_db_store.rb
Overview
Uses the DynamoDB Session Store implementation to create a class that extends ActionDispatch::Session
. Rails will create a :dynamo_db_store
configuration for :session_store
from this class name.
This class will use Rails.application.secret_key_base
as the secret key unless otherwise provided.
Configuration can also be provided in YAML files from Rails config, either in config/aws_dynamo_db_session_store.yml
or config/aws_dynamo_db_session_store/{Rails.env}.yml
. Configuration files that are environment-specific will take precedence.
Instance Method Summary collapse
- #config ⇒ Aws::SessionStore::DynamoDB::Configuration
-
#initialize(app, options = {}) ⇒ DynamoDbStore
constructor
A new instance of DynamoDbStore.
Constructor Details
#initialize(app, options = {}) ⇒ DynamoDbStore
Returns a new instance of DynamoDbStore.
22 23 24 25 26 27 28 |
# File 'lib/action_dispatch/session/dynamo_db_store.rb', line 22 def initialize(app, = {}) [:config_file] ||= config_file [:secret_key] ||= Rails.application.secret_key_base @middleware = Aws::SessionStore::DynamoDB::RackMiddleware.new(app, ) config.dynamo_db_client.config.user_agent_frameworks << 'aws-actiondispatch-dynamodb' super end |
Instance Method Details
#config ⇒ Aws::SessionStore::DynamoDB::Configuration
31 32 33 |
# File 'lib/action_dispatch/session/dynamo_db_store.rb', line 31 def config @middleware.config end |