redis-actionpack-5.2.0/ 0000755 0000041 0000041 00000000000 13632731113 014766 5 ustar www-data www-data redis-actionpack-5.2.0/.travis.yml 0000644 0000041 0000041 00000001436 13632731113 017103 0 ustar www-data www-data language: ruby
before_install: gem install bundler
script: bundle exec rake
rvm:
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
- ruby-head
- jruby-head
gemfile:
- gemfiles/rails_5.0.x.gemfile
- gemfiles/rails_5.1.x.gemfile
- gemfiles/rails_5.2.x.gemfile
- gemfiles/rails_6.0.x.gemfile
matrix:
exclude:
- rvm: 2.3
gemfile: gemfiles/rails_6.0.x.gemfile
- rvm: 2.4
gemfile: gemfiles/rails_6.0.x.gemfile
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
deploy:
provider: rubygems
api_key:
secure: edRiCZPzp3pqBQn3hjeG5WqUNf0eEb8/Ea2VY0jJfQfOHxOYJSATkpdZ5xxOL1YIefk7ERUURY3dKwS/qdSIF2h954QPeOChLTlSaWtFjSNAZIAhH7Ks4vN/q1i7JAWtJRCBOtHlAe9AJj7CvHpUsry3+oHsJ+gXaaA9lntbheE=
gem: redis-actionpack
on:
tags: true
repo: redis-store/redis-actionpack
redis-actionpack-5.2.0/test/ 0000755 0000041 0000041 00000000000 13632731113 015745 5 ustar www-data www-data redis-actionpack-5.2.0/test/fixtures/ 0000755 0000041 0000041 00000000000 13632731113 017616 5 ustar www-data www-data redis-actionpack-5.2.0/test/fixtures/session_autoload_test/ 0000755 0000041 0000041 00000000000 13632731113 024230 5 ustar www-data www-data redis-actionpack-5.2.0/test/fixtures/session_autoload_test/session_autoload_test/ 0000755 0000041 0000041 00000000000 13632731113 030642 5 ustar www-data www-data redis-actionpack-5.2.0/test/fixtures/session_autoload_test/session_autoload_test/foo.rb 0000644 0000041 0000041 00000000255 13632731113 031754 0 ustar www-data www-data module SessionAutoloadTest
class Foo
def initialize(bar='baz')
@bar = bar
end
def inspect
"#<#{self.class} bar:#{@bar.inspect}>"
end
end
end
redis-actionpack-5.2.0/test/gemfiles/ 0000755 0000041 0000041 00000000000 13632731113 017540 5 ustar www-data www-data redis-actionpack-5.2.0/test/gemfiles/Gemfile.rails-6.0.x 0000644 0000041 0000041 00000000264 13632731113 022715 0 ustar www-data www-data source 'https://rubygems.org'
gemspec :path => './../..'
gem 'redis-store'
gem 'redis-rack', github: 'redis-store/redis-rack'
gem 'actionpack', '~> 6.0.0'
gem 'minitest-rails'
redis-actionpack-5.2.0/test/dummy/ 0000755 0000041 0000041 00000000000 13632731113 017100 5 ustar www-data www-data redis-actionpack-5.2.0/test/dummy/config.ru 0000644 0000041 0000041 00000000233 13632731113 020713 0 ustar www-data www-data # This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Dummy::Application
redis-actionpack-5.2.0/test/dummy/.gitignore 0000644 0000041 0000041 00000000006 13632731113 021064 0 ustar www-data www-data log/*
redis-actionpack-5.2.0/test/dummy/script/ 0000755 0000041 0000041 00000000000 13632731113 020404 5 ustar www-data www-data redis-actionpack-5.2.0/test/dummy/script/rails 0000755 0000041 0000041 00000000447 13632731113 021451 0 ustar www-data www-data #!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
redis-actionpack-5.2.0/test/dummy/app/ 0000755 0000041 0000041 00000000000 13632731113 017660 5 ustar www-data www-data redis-actionpack-5.2.0/test/dummy/app/controllers/ 0000755 0000041 0000041 00000000000 13632731113 022226 5 ustar www-data www-data redis-actionpack-5.2.0/test/dummy/app/controllers/test_controller.rb 0000644 0000041 0000041 00000001341 13632731113 025774 0 ustar www-data www-data class TestController < ActionController::Base
def no_session_access
head :ok
end
def set_session_value
session[:foo] = "bar"
head :ok
end
def set_session_value_with_expiry
request.session_options[:expire_after] = 1.second
set_session_value
end
def set_serialized_session_value
session[:foo] = SessionAutoloadTest::Foo.new
head :ok
end
def get_session_value
render plain: "foo: #{session[:foo].inspect}"
end
def get_session_id
session_id = request.session_options[:id] || cookies["_session_id"]
render plain: session_id
end
def call_reset_session
session[:bar]
reset_session
session[:bar] = "baz"
head :ok
end
def rescue_action(e) raise end
end
redis-actionpack-5.2.0/test/dummy/app/views/ 0000755 0000041 0000041 00000000000 13632731113 021015 5 ustar www-data www-data redis-actionpack-5.2.0/test/dummy/app/views/test/ 0000755 0000041 0000041 00000000000 13632731113 021774 5 ustar www-data www-data redis-actionpack-5.2.0/test/dummy/app/views/test/get_session_id.html.erb 0000644 0000041 0000041 00000000000 13632731113 026415 0 ustar www-data www-data redis-actionpack-5.2.0/test/dummy/app/views/test/get_session_value.html.erb 0000644 0000041 0000041 00000000025 13632731113 027144 0 ustar www-data www-data
hello world
redis-actionpack-5.2.0/test/dummy/Rakefile 0000644 0000041 0000041 00000000416 13632731113 020546 0 ustar www-data www-data #!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Dummy::Application.load_tasks
redis-actionpack-5.2.0/test/dummy/config/ 0000755 0000041 0000041 00000000000 13632731113 020345 5 ustar www-data www-data redis-actionpack-5.2.0/test/dummy/config/boot.rb 0000644 0000041 0000041 00000000354 13632731113 021637 0 ustar www-data www-data require 'rubygems'
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end
$:.unshift File.expand_path('../../../../lib', __FILE__)
redis-actionpack-5.2.0/test/dummy/config/routes.rb 0000644 0000041 0000041 00000000115 13632731113 022210 0 ustar www-data www-data Dummy::Application.routes.draw do
get ':action', :to => TestController
end
redis-actionpack-5.2.0/test/dummy/config/application.rb 0000644 0000041 0000041 00000001462 13632731113 023200 0 ustar www-data www-data require File.expand_path('../boot', __FILE__)
require "action_controller/railtie"
Bundler.require
module Dummy
class Application < Rails::Application
# Disable class caching for session auto-load test
config.cache_classes = false
config.eager_load = false
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
config.secret_key_base = 'secret'
end
end
redis-actionpack-5.2.0/test/dummy/config/environment.rb 0000644 0000041 0000041 00000000225 13632731113 023235 0 ustar www-data www-data # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Dummy::Application.initialize!
redis-actionpack-5.2.0/test/integration/ 0000755 0000041 0000041 00000000000 13632731113 020270 5 ustar www-data www-data redis-actionpack-5.2.0/test/integration/redis_store_integration_test.rb 0000644 0000041 0000041 00000021053 13632731113 026602 0 ustar www-data www-data require 'test_helper'
class RedisStoreIntegrationTest < ::ActionDispatch::IntegrationTest
SessionKey = '_session_id'
SessionSecret = 'b3c631c314c0bbca50c1b2843150fe33'
test "reads the data" do
with_test_route_set do
get '/set_session_value'
assert_response :success
assert cookies['_session_id'].present?
get '/get_session_value'
assert_response :success
assert_equal response.body, 'foo: "bar"'
end
end
test "should get nil session value" do
with_test_route_set do
get '/get_session_value'
assert_response :success
assert_equal 'foo: nil', response.body
end
end
test "should delete the data after session reset" do
with_test_route_set do
get '/set_session_value'
assert_response :success
assert cookies['_session_id'].present?
session_cookie = cookies.send(:hash_for)['_session_id']
get '/call_reset_session'
assert_response :success
assert !headers['Set-Cookie'].blank?
cookies << session_cookie
get '/get_session_value'
assert_response :success
assert_equal 'foo: nil', response.body
end
end
test "should set a non-secure cookie by default" do
with_test_route_set do
https!
get '/set_session_value'
assert_response :success
cookie = cookies.instance_variable_get('@cookies').first
assert !cookie.secure?
end
end
test "should set a secure cookie when the 'secure' option is set" do
with_test_route_set(secure: true) do
https!
get '/set_session_value'
assert_response :success
cookie = cookies.instance_variable_get('@cookies').first
assert cookie.secure?
end
end
test "should set a signed cookie when the 'signed' option is set" do
with_test_route_set(signed: true) do
https!
get '/set_session_value'
assert_response :success
cookie = cookies.instance_variable_get('@cookies').first
assert_includes cookie.raw, '_session_id='
end
end
test "should set a http-only cookie by default" do
with_test_route_set do
get '/set_session_value'
assert_response :success
cookie = cookies.instance_variable_get('@cookies').first
options = cookie.instance_variable_get('@options')
assert options.key?('HttpOnly')
end
end
test "should set a non-http-only cookie when the 'httponlty' option is set to false" do
with_test_route_set(httponly: false) do
get '/set_session_value'
assert_response :success
cookie = cookies.instance_variable_get('@cookies').first
options = cookie.instance_variable_get('@options')
assert !options.key?('HttpOnly')
end
end
test "should not send cookies on write, not read" do
with_test_route_set do
get '/get_session_value'
assert_response :success
assert_equal 'foo: nil', response.body
assert cookies['_session_id'].nil?
end
end
test "should set session value after session reset" do
with_test_route_set do
get '/set_session_value'
assert_response :success
assert cookies['_session_id'].present?
session_id = cookies['_session_id']
get '/call_reset_session'
assert_response :success
assert !headers['Set-Cookie'].blank?
get '/get_session_value'
assert_response :success
assert_equal 'foo: nil', response.body
get '/get_session_id'
assert_response :success
assert(response.body != session_id)
end
end
test "should be able to read session id without accessing the session hash" do
with_test_route_set do
get '/set_session_value'
assert_response :success
assert cookies['_session_id'].present?
session_id = cookies['_session_id']
get '/get_session_id'
assert_response :success
assert_equal response.body, session_id
end
end
test "should auto-load unloaded class" do
with_test_route_set do
with_autoload_path "session_autoload_test" do
get '/set_serialized_session_value'
assert_response :success
assert cookies['_session_id'].present?
end
with_autoload_path "session_autoload_test" do
get '/get_session_id'
assert_response :success
end
with_autoload_path "session_autoload_test" do
get '/get_session_value'
assert_response :success
assert_equal response.body, 'foo: #'
end
end
end
test "should not resend the cookie again if session_id cookie is already exists" do
with_test_route_set do
get '/set_session_value'
assert_response :success
assert cookies['_session_id'].present?
get '/get_session_value'
assert_response :success
assert headers['Set-Cookie'].nil?
end
end
test "should prevent session fixation" do
with_test_route_set do
get '/get_session_value'
assert_response :success
assert_equal 'foo: nil', response.body
session_id = cookies['_session_id']
reset!
get '/set_session_value', headers: { _session_id: session_id }
assert_response :success
assert(cookies['_session_id'] != session_id)
end
end
test "should write the data with expiration time" do
with_test_route_set do
get '/set_session_value_with_expiry'
assert_response :success
get '/get_session_value'
assert_response :success
assert_equal response.body, 'foo: "bar"'
sleep 1
get '/get_session_value'
assert_response :success
assert_equal 'foo: nil', response.body
end
end
test "session store with explicit domain" do
with_test_route_set(:domain => "example.es") do
get '/set_session_value'
assert_match(/domain=example\.es/, headers['Set-Cookie'])
headers['Set-Cookie']
end
end
test "session store without domain" do
with_test_route_set do
get '/set_session_value'
assert_no_match(/domain\=/, headers['Set-Cookie'])
end
end
test "session store with nil domain" do
with_test_route_set(:domain => nil) do
get '/set_session_value'
assert_no_match(/domain\=/, headers['Set-Cookie'])
end
end
test "session store with all domains" do
with_test_route_set(:domain => :all) do
get '/set_session_value'
assert_match(/domain=\.example\.com/, headers['Set-Cookie'])
end
end
private
# from actionpack/test/abstract_unit.rb
class RoutedRackApp
attr_reader :routes
def initialize(routes, &blk)
@routes = routes
@stack = ActionDispatch::MiddlewareStack.new(&blk).build(@routes)
@secret = SecureRandom.hex
@key_generator = ActiveSupport::CachingKeyGenerator.new(
ActiveSupport::KeyGenerator.new(@secret, iterations: 2)
)
end
def call(env)
env[ActionDispatch::Cookies::GENERATOR_KEY] = @key_generator
env[ActionDispatch::Cookies::SIGNED_COOKIE_SALT] = SecureRandom.hex
if defined? ActionDispatch::Cookies::COOKIES_ROTATIONS
env[ActionDispatch::Cookies::COOKIES_ROTATIONS] = ActiveSupport::Messages::RotationConfiguration.new
end
@stack.call(env)
end
end
# from actionpack/test/abstract_unit.rb
def self.build_app(routes = nil)
RoutedRackApp.new(routes || ActionDispatch::Routing::RouteSet.new) do |middleware|
middleware.use ActionDispatch::DebugExceptions
middleware.use ActionDispatch::Callbacks
# middleware.use ActionDispatch::ParamsParser
middleware.use ActionDispatch::Cookies
middleware.use ActionDispatch::Flash
middleware.use Rack::Head
yield(middleware) if block_given?
end
end
# from actionpack/test/dispatch/session/cookie_store_test.rb
def with_test_route_set(options = {})
with_routing do |set|
set.draw do
get :no_session_access, to: 'test#no_session_access'
get :set_session_value, to: 'test#set_session_value'
get :set_session_value_with_expiry, to: 'test#set_session_value_with_expiry'
get :set_serialized_session_value, to: 'test#set_serialized_session_value'
get :get_session_value, to: 'test#get_session_value'
get :get_session_id, to: 'test#get_session_id'
get :call_reset_session, to: 'test#call_reset_session'
end
options = { :key => SessionKey }.merge!(options)
@app = self.class.build_app(set) do |middleware|
middleware.use ActionDispatch::Session::RedisStore, options
end
yield
end
end
end
redis-actionpack-5.2.0/test/test_helper.rb 0000644 0000041 0000041 00000001220 13632731113 020603 0 ustar www-data www-data require 'bundler/setup'
require 'minitest/autorun'
require 'active_support/core_ext/numeric/time'
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
Rails.backtrace_cleaner.remove_silencers!
def with_autoload_path(path)
path = File.join(File.dirname(__FILE__), "fixtures", path)
if ActiveSupport::Dependencies.autoload_paths.include?(path)
yield
else
begin
ActiveSupport::Dependencies.autoload_paths << path
yield
ensure
ActiveSupport::Dependencies.autoload_paths.reject! {|p| p == path}
ActiveSupport::Dependencies.clear
end
end
end
redis-actionpack-5.2.0/CODEOWNERS 0000644 0000041 0000041 00000000011 13632731113 016351 0 ustar www-data www-data * @tubbo
redis-actionpack-5.2.0/README.md 0000644 0000041 0000041 00000005333 13632731113 016251 0 ustar www-data www-data # Redis stores for ActionPack
__`redis-actionpack`__ provides a session store for __ActionPack__, specifically for __ActionDispatch__. See the main [redis-store readme](https://github.com/redis-store/redis-store) for general guidelines.
For guidelines on using our underlying cache store, see the main [redis-store readme](https://github.com/redis-store/redis-store).
For information on how to use this library in a Rails app, see the [documentation for redis-rails](https://github.com/redis-store/redis-rails).
If, for some reason, you're using `ActionDispatch` and not in a Rails app, read on to learn how to install/use this gem by itself!
## Installation
```ruby
# Gemfile
gem 'redis-actionpack'
```
## Usage
If you are using redis-store with Rails, head on over to the
[redis-rails README](https://github.com/redis-store/redis-rails#session-storage) to
learn how to integrate this gem into your Rails application.
For standalone usage:
```ruby
ActionController::Base.session_store = :redis_store,
servers: %w(redis://localhost:6379/0/session),
expire_after: 90.minutes,
key: '_my_application_session',
threadsafe: false,
signed: true,
secure: true
```
A brief run-down of these options...
- **servers** is an Array of Redis server URLs that we will attempt to find
data from.
- **expire_after** is the default TTL of session keys. This is also set
as the expiry time of any cookies generated by the session store.
- **key** is the name of the cookie on the client side
- **threadsafe** is for applications that run on multiple instances. Set
this to `false` if you want to disable the global mutex lock on
session data. It's `true` by default, meaning the mutex will be
enabled.
- **signed** uses signed/encrypted cookies to store the local session on
a client machine, preventing a malicious user from tampering with its
contents.
- **secure** ensures HTTP cookies are transferred from server to client
on a secure (HTTPS) connection
## Running tests
```shell
gem install bundler
git clone git://github.com/redis-store/redis-actionpack.git
cd redis-actionpack
bundle install
bundle exec rake
```
If you are on **Snow Leopard** you have to run `env ARCHFLAGS="-arch x86_64" bundle exec rake`
## Status
[](http://badge.fury.io/rb/redis-actionpack)
[](http://travis-ci.org/redis-store/redis-actionpack?branch=master)
[](https://codeclimate.com/github/redis-store/redis-actionpack)
## Copyright
2009 - 2013 Luca Guidi - [http://lucaguidi.com](http://lucaguidi.com), released under the MIT license
redis-actionpack-5.2.0/bin/ 0000755 0000041 0000041 00000000000 13632731113 015536 5 ustar www-data www-data redis-actionpack-5.2.0/bin/bundler-version-options.rb 0000644 0000041 0000041 00000000120 13632731113 022663 0 ustar www-data www-data puts '-v 1.13.1' if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.3.0')
redis-actionpack-5.2.0/gemfiles/ 0000755 0000041 0000041 00000000000 13632731113 016561 5 ustar www-data www-data redis-actionpack-5.2.0/gemfiles/rails_6.0.x.gemfile 0000644 0000041 0000041 00000000234 13632731113 022055 0 ustar www-data www-data # This file was generated by Appraisal
source "https://rubygems.org"
gem "redis-store"
gem "redis-rack"
gem "actionpack", "~> 6.0.0"
gemspec path: "../"
redis-actionpack-5.2.0/gemfiles/rails_5.0.x.gemfile 0000644 0000041 0000041 00000000234 13632731113 022054 0 ustar www-data www-data # This file was generated by Appraisal
source "https://rubygems.org"
gem "redis-store"
gem "redis-rack"
gem "actionpack", "~> 5.0.0"
gemspec path: "../"
redis-actionpack-5.2.0/gemfiles/rails_5.1.x.gemfile 0000644 0000041 0000041 00000000234 13632731113 022055 0 ustar www-data www-data # This file was generated by Appraisal
source "https://rubygems.org"
gem "redis-store"
gem "redis-rack"
gem "actionpack", "~> 5.1.0"
gemspec path: "../"
redis-actionpack-5.2.0/gemfiles/rails_5.2.x.gemfile 0000644 0000041 0000041 00000000234 13632731113 022056 0 ustar www-data www-data # This file was generated by Appraisal
source "https://rubygems.org"
gem "redis-store"
gem "redis-rack"
gem "actionpack", "~> 5.1.0"
gemspec path: "../"
redis-actionpack-5.2.0/CHANGELOG.md 0000644 0000041 0000041 00000013362 13632731113 016604 0 ustar www-data www-data v5.2.0 (2020-01-13)
--------------------------------------------------------------------------------
* Require latest version of redis-rack
Tom Scott
* Update version to v5.2.0 final
Tom Scott
* Fix for rack 2.0.8 (#28)
* Fix for rack 2.0.8
* add new redis-rack for tests
* add new ruby 2.7 for tests
Alexey Vasiliev
* v5.2.0.pre: Support Signed/Encrypted Cookies
Tom Scott
* Update README with info about signed cookies
Tom Scott
* Support Signed and Encrypted Cookie Storage (#27)
With the `:signed` option passed into the Redis session store, you can
now ensure that sessions will be set up in the browser using a
signed/encrypted cookie. This prevents user tampering by changing their
session ID or the data within the cookie.
Closes #21
Tom Scott
v5.1.0
--------------------------------------------------------------------------------
* Add appraisal to test on multiple versions of Rails (#18)
Update the build configuration to exclude older versions we no longer support and use Appraisal to test against multiple gemfiles/rubies in CI.
* Remove old gemfiles
* Update appraisal gemfiles
* Exclude some builds
* Install bundler on older versions of Ruby
* Prevent updating bundler to a non-compatible version
* Remove lockfiles from the repo
* Drop support for old versions of Rails & Ruby
* Automatically assign issues to @tubbo when they are created
Tom Scott
* Reduce build scope to only support Rails 5 & 6
Tom Scott
* v5.1.0: Support Rails 6
Tom Scott
* Bump max version constraint on actionpack (#25)
This change allows this gem to work with Rails 6.
Arjun Radhakrishnan
* Fix build
Tom Scott
* README: Use SVG badges
Olle Jonsson
* Gemspec: Drop EOL'd property rubyforge_project
Olle Jonsson
* Loosen Bundler dependency
Tom Scott
* Update testing matrix
Tom Scott
* Automatically release to RubyGems when new tags are pushed to GitHub
Tom Scott
* Add code owners
Tom Scott
* Clarify usage of gem in the README
Tom Scott
* Fix rails 4 build failure
Tom Scott
* Don't always use local testing gem
Tom Scott
v5.0.2
--------------------------------------------------------------------------------
* v5.0.2: Loosen dependencies to work with new minor redis-store versions
Tom Scott
* Update class name in README
Tom Scott
* Loosen redis-store dependency
Tom Scott
* Update tests to remove deprecation warnings
Tom Scott
* Remove testing code from Gemfile
Tom Scott
v5.0.1
--------------------------------------------------------------------------------
* Release v5.0.1
Tom Scott
* Respect cookie options in setting cookie with session ID
Michael Dawson
* Update tests and gemfiles to work on all supported versions.
Do not depend on pre-release versions of gems.
Move tests to use minitest-rails to alleviate some of the dependency hell.
Remove version_test.rb because that's dumb.
Connor Shea
v5.0.0
--------------------------------------------------------------------------------
* Update README.md (#12)
Nicolas
* Bump to 5.0.0
Ryan Bigg
* Fix gem dependency versions
Tom Scott
* Pre-Release of v5.0.0
Tom Scott
* Disable rbx-19mode on Travis CI
This syntax is no longer supported by Travis, so we aren't getting
reliable builds and thus must disable its use, at least for now. We were
getting problems on the Rails 4.0 and 4.1 Gemfiles.
More information is available at
https://travis-ci.org/redis-store/redis-actionpack/builds/112702496
Tom Scott
* exclue jruby-19 from rails5
Marc Roberts
* bump ruby 2.2 version in travis, rails5 need at least 2.2.4
Marc Roberts
* env is already an ActionDispatch::Request in rails5
Marc Roberts
* specify version of minitest-spec-rails
Marc Roberts
* need all of rails in gemfile for rails5
Marc Roberts
* use redis-store from github until a new gem is cut
Marc Roberts
* prevent rails5 deprecation warnings
Marc Roberts
* don't use mini_backtrace for now, incompatible with rails5
Marc Roberts
* bump rails5 gem version up to beta3
Marc Roberts
* use redis-rack via github for rails 5.0
Marc Roberts
* use minitest-spec-rails for consistency
Marc Roberts
* Merge remote-tracking branch 'upstream/master'
Miles Matthias
* update mini_specunit to minitest-spec-rails
Marc Roberts
* ignore .lock files in gemfiles
Marc Roberts
* correct gemfiles names in travis excludes
Marc Roberts
* fix gemspec path in gemfiles
Marc Roberts
* add multiple gemfiles for rails 4.0, 4.1, 4.2 and 5
Marc Roberts
* remove 1.9, add 2.1/2.2 rubies to travis
Marc Roberts
* Loosen dependancy on actionpack to support Rails 5
Marc Roberts
* travis ci add before_install
shiro16
* fixed travis.yml
shiro16
* travis ci add Ruby 2.1 and 2.2, 2.3.0
shiro16
* ignore stdout, file resulted from running tests
Miles Matthias
* Revert "Update README.md"
This reverts commit a4c7f94ed6283b28a34079b5a4917897d6a2b77d.
Ryan Bigg
* Update README.md
Ryan Bigg
* These silly version tests
Ryan Bigg
v4.0.1
--------------------------------------------------------------------------------
G
* Bump to 4.0.1
Ryan Bigg
* support the same values for domain as rails' session stores usually do
* needed to change the tests based on test in rails, so the options for the session store could be changed per test
Fixes #2
Michael Reinsch
v4.0.0
--------------------------------------------------------------------------------
* Enable CI
Luca Guidi
* Move from jodosha/redis-store
Luca Guidi
redis-actionpack-5.2.0/Appraisals 0000644 0000041 0000041 00000000623 13632731113 017011 0 ustar www-data www-data appraise 'rails-5.0.x' do
gem 'redis-store'
gem 'redis-rack'
gem 'actionpack', '~> 5.0.0'
end
appraise 'rails-5.1.x' do
gem 'redis-store'
gem 'redis-rack'
gem 'actionpack', '~> 5.1.0'
end
appraise 'rails-5.2.x' do
gem 'redis-store'
gem 'redis-rack'
gem 'actionpack', '~> 5.1.0'
end
appraise 'rails-6.0.x' do
gem 'redis-store'
gem 'redis-rack'
gem 'actionpack', '~> 6.0.0'
end
redis-actionpack-5.2.0/.gitignore 0000644 0000041 0000041 00000000077 13632731113 016762 0 ustar www-data www-data Gemfile.lock
gemfiles/*.lock
*.gem
tmp/
stdout
gemfiles/vendor
redis-actionpack-5.2.0/Rakefile 0000644 0000041 0000041 00000000147 13632731113 016435 0 ustar www-data www-data require 'bundler/setup'
require 'rake'
require 'bundler/gem_tasks'
require 'redis-store/testing/tasks'
redis-actionpack-5.2.0/lib/ 0000755 0000041 0000041 00000000000 13632731113 015534 5 ustar www-data www-data redis-actionpack-5.2.0/lib/action_dispatch/ 0000755 0000041 0000041 00000000000 13632731113 020670 5 ustar www-data www-data redis-actionpack-5.2.0/lib/action_dispatch/middleware/ 0000755 0000041 0000041 00000000000 13632731113 023005 5 ustar www-data www-data redis-actionpack-5.2.0/lib/action_dispatch/middleware/session/ 0000755 0000041 0000041 00000000000 13632731113 024470 5 ustar www-data www-data redis-actionpack-5.2.0/lib/action_dispatch/middleware/session/redis_store.rb 0000644 0000041 0000041 00000002370 13632731113 027341 0 ustar www-data www-data # frozen_string_literal: true
require 'redis-store'
require 'redis-rack'
require 'action_dispatch/middleware/session/abstract_store'
module ActionDispatch
module Session
# Session storage in Redis, using +Redis::Rack+ as a basis.
class RedisStore < Rack::Session::Redis
include Compatibility
include StaleSessionCheck
include SessionObject
def initialize(app, options = {})
options = options.dup
options[:redis_server] ||= options[:servers]
super
end
def generate_sid
Rack::Session::SessionId.new(super)
end
private
def set_cookie(env, _session_id, cookie)
request = wrap_in_request(env)
cookie_jar(request)[key] = cookie.merge(cookie_options)
end
def get_cookie(request)
cookie_jar(request)[key]
end
def wrap_in_request(env)
return env if env.is_a?(ActionDispatch::Request)
ActionDispatch::Request.new(env)
end
def cookie_options
@default_options.slice(:httponly, :secure)
end
def cookie_jar(request)
if @default_options[:signed]
request.cookie_jar.signed_or_encrypted
else
request.cookie_jar
end
end
end
end
end
redis-actionpack-5.2.0/lib/redis-actionpack.rb 0000644 0000041 0000041 00000000210 13632731113 021272 0 ustar www-data www-data require 'redis-store'
require 'action_pack'
require 'redis/actionpack/version'
require 'action_dispatch/middleware/session/redis_store'
redis-actionpack-5.2.0/lib/redis/ 0000755 0000041 0000041 00000000000 13632731113 016642 5 ustar www-data www-data redis-actionpack-5.2.0/lib/redis/actionpack/ 0000755 0000041 0000041 00000000000 13632731113 020756 5 ustar www-data www-data redis-actionpack-5.2.0/lib/redis/actionpack/version.rb 0000644 0000041 0000041 00000000100 13632731113 022757 0 ustar www-data www-data class Redis
module ActionPack
VERSION = '5.2.0'
end
end
redis-actionpack-5.2.0/Gemfile 0000644 0000041 0000041 00000000411 13632731113 016255 0 ustar www-data www-data source 'https://rubygems.org'
gemspec
gem "rake", "~> 10.5"
gem "bundler", "~> 2.1"
gem "mocha", "~> 0.14.0"
gem "minitest-rails", "~> 6.0"
gem "tzinfo", "~> 1.2"
gem "appraisal", "~> 2.2"
gem "redis-store-testing", github: 'redis-store/testing', branch: 'v0.0.3'
redis-actionpack-5.2.0/redis-actionpack.gemspec 0000644 0000041 0000041 00000001607 13632731113 021557 0 ustar www-data www-data # -*- encoding: utf-8 -*-
$:.push File.expand_path('../lib', __FILE__)
require 'redis/actionpack/version'
Gem::Specification.new do |s|
s.name = 'redis-actionpack'
s.version = Redis::ActionPack::VERSION
s.authors = ['Luca Guidi']
s.email = ['me@lucaguidi.com']
s.homepage = 'http://redis-store.org/redis-actionpack'
s.summary = %q{Redis session store for ActionPack}
s.description = "#{s.summary}. Used for storing the Rails session in Redis."
s.license = 'MIT'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = []
s.require_paths = ['lib']
s.required_ruby_version = '>= 2.3.0'
s.add_runtime_dependency 'redis-store', '>= 1.1.0', '< 2'
s.add_runtime_dependency 'redis-rack', '>= 2.1.0', '< 3'
s.add_runtime_dependency 'actionpack', '>= 5', '< 7'
end
redis-actionpack-5.2.0/.github/ 0000755 0000041 0000041 00000000000 13632731113 016326 5 ustar www-data www-data redis-actionpack-5.2.0/.github/auto-assign-issues.yml 0000644 0000041 0000041 00000000025 13632731113 022611 0 ustar www-data www-data assignees:
- tubbo
redis-actionpack-5.2.0/MIT-LICENSE 0000644 0000041 0000041 00000002045 13632731113 016423 0 ustar www-data www-data Copyright (c) 2009 - 2011 Luca Guidi
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.