redis-actionpack-5.4.0/0000755000004100000410000000000014560640262014775 5ustar www-datawww-dataredis-actionpack-5.4.0/bin/0000755000004100000410000000000014560640262015545 5ustar www-datawww-dataredis-actionpack-5.4.0/bin/bundler-version-options.rb0000644000004100000410000000012014560640262022672 0ustar www-datawww-dataputs '-v 1.13.1' if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.3.0') redis-actionpack-5.4.0/.gitignore0000644000004100000410000000007714560640262016771 0ustar www-datawww-dataGemfile.lock gemfiles/*.lock *.gem tmp/ stdout gemfiles/vendor redis-actionpack-5.4.0/.github/0000755000004100000410000000000014560640262016335 5ustar www-datawww-dataredis-actionpack-5.4.0/.github/release.yml0000644000004100000410000000044214560640262020500 0ustar www-datawww-datachangelog: exclude: labels: [dependencies] authors: [renovate-bot] categories: - title: Breaking Changes labels: [breaking] - title: New Features labels: [enhancement] - title: Bug Fixes labels: [bug] - title: Other Changes labels: ["*"] redis-actionpack-5.4.0/.github/auto-assign-issues.yml0000644000004100000410000000002514560640262022620 0ustar www-datawww-dataassignees: - tubbo redis-actionpack-5.4.0/.github/workflows/0000755000004100000410000000000014560640262020372 5ustar www-datawww-dataredis-actionpack-5.4.0/.github/workflows/publish.yml0000644000004100000410000000142614560640262022566 0ustar www-datawww-dataname: Publish on: push: tags: [v*] permissions: contents: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: "3.1" bundler-cache: true - run: | mkdir -p ~/.gem cat << EOF > ~/.gem/credentials --- :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }} EOF chmod 0600 ~/.gem/credentials - run: bundle exec rake release - uses: softprops/action-gh-release@v1 with: files: "*.gem" generate_release_notes: true prerelease: ${{ contains(github.ref, '.pre') }} redis-actionpack-5.4.0/.github/workflows/ci.yml0000644000004100000410000000264514560640262021517 0ustar www-datawww-dataname: CI on: push: branches-ignore: [master] tags-ignore: [v*] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: name: "test (ruby: ${{ matrix.ruby }}, redis.rb: ${{ matrix.redis }})" runs-on: ubuntu-latest continue-on-error: ${{ contains(matrix.ruby, 'head') }} strategy: fail-fast: false matrix: ruby: - "2.7" - "3.0" - "3.1" # - 'head' - "jruby" # - 'jruby-head' - "truffleruby" # - 'truffleruby-head' redis: - 4_0_x - 4_1_x - 4_x env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/redis_${{ matrix.redis }}.gemfile services: redis: image: redis ports: - 6379:6379 distributed1: image: redis ports: - 6380:6380 distributed2: image: redis ports: - 6381:6381 steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - run: bundle exec rake lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1 bundler-cache: true - run: bundle exec rake lint redis-actionpack-5.4.0/lib/0000755000004100000410000000000014560640262015543 5ustar www-datawww-dataredis-actionpack-5.4.0/lib/redis/0000755000004100000410000000000014560640262016651 5ustar www-datawww-dataredis-actionpack-5.4.0/lib/redis/actionpack/0000755000004100000410000000000014560640262020765 5ustar www-datawww-dataredis-actionpack-5.4.0/lib/redis/actionpack/version.rb0000644000004100000410000000010014560640262022766 0ustar www-datawww-dataclass Redis module ActionPack VERSION = '5.4.0' end end redis-actionpack-5.4.0/lib/redis-actionpack.rb0000644000004100000410000000021014560640262021301 0ustar www-datawww-datarequire 'redis-store' require 'action_pack' require 'redis/actionpack/version' require 'action_dispatch/middleware/session/redis_store' redis-actionpack-5.4.0/lib/action_dispatch/0000755000004100000410000000000014560640262020677 5ustar www-datawww-dataredis-actionpack-5.4.0/lib/action_dispatch/middleware/0000755000004100000410000000000014560640262023014 5ustar www-datawww-dataredis-actionpack-5.4.0/lib/action_dispatch/middleware/session/0000755000004100000410000000000014560640262024477 5ustar www-datawww-dataredis-actionpack-5.4.0/lib/action_dispatch/middleware/session/redis_store.rb0000644000004100000410000000237014560640262027350 0ustar www-datawww-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.4.0/redis-actionpack.gemspec0000644000004100000410000000175214560640262021567 0ustar www-datawww-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.metadata = { "source_code_uri" => "https://github.com/redis-store/redis-actionpack" } 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', '< 4' s.add_runtime_dependency 'actionpack', '>= 5', '< 8' end redis-actionpack-5.4.0/Appraisals0000644000004100000410000000062314560640262017020 0ustar www-datawww-dataappraise '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.4.0/test/0000755000004100000410000000000014560640262015754 5ustar www-datawww-dataredis-actionpack-5.4.0/test/integration/0000755000004100000410000000000014560640262020277 5ustar www-datawww-dataredis-actionpack-5.4.0/test/integration/redis_store_integration_test.rb0000644000004100000410000002124714560640262026616 0ustar www-datawww-datarequire '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? if cookies.respond_to?(:get_cookie) session_cookie = cookies.get_cookie('_session_id') else session_cookie = cookies.send(:hash_for)['_session_id'] end 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.4.0/test/test_helper.rb0000644000004100000410000000122014560640262020612 0ustar www-datawww-datarequire '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.4.0/test/fixtures/0000755000004100000410000000000014560640262017625 5ustar www-datawww-dataredis-actionpack-5.4.0/test/fixtures/session_autoload_test/0000755000004100000410000000000014560640262024237 5ustar www-datawww-dataredis-actionpack-5.4.0/test/fixtures/session_autoload_test/session_autoload_test/0000755000004100000410000000000014560640262030651 5ustar www-datawww-dataredis-actionpack-5.4.0/test/fixtures/session_autoload_test/session_autoload_test/foo.rb0000644000004100000410000000025514560640262031763 0ustar www-datawww-datamodule SessionAutoloadTest class Foo def initialize(bar='baz') @bar = bar end def inspect "#<#{self.class} bar:#{@bar.inspect}>" end end end redis-actionpack-5.4.0/test/gemfiles/0000755000004100000410000000000014560640262017547 5ustar www-datawww-dataredis-actionpack-5.4.0/test/gemfiles/Gemfile.rails-6.0.x0000644000004100000410000000026414560640262022724 0ustar www-datawww-datasource '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.4.0/test/dummy/0000755000004100000410000000000014560640262017107 5ustar www-datawww-dataredis-actionpack-5.4.0/test/dummy/.gitignore0000644000004100000410000000000614560640262021073 0ustar www-datawww-datalog/* redis-actionpack-5.4.0/test/dummy/Rakefile0000644000004100000410000000041614560640262020555 0ustar www-datawww-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.4.0/test/dummy/config.ru0000644000004100000410000000023314560640262020722 0ustar www-datawww-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.4.0/test/dummy/app/0000755000004100000410000000000014560640262017667 5ustar www-datawww-dataredis-actionpack-5.4.0/test/dummy/app/views/0000755000004100000410000000000014560640262021024 5ustar www-datawww-dataredis-actionpack-5.4.0/test/dummy/app/views/test/0000755000004100000410000000000014560640262022003 5ustar www-datawww-dataredis-actionpack-5.4.0/test/dummy/app/views/test/get_session_value.html.erb0000644000004100000410000000002514560640262027153 0ustar www-datawww-data

hello world

redis-actionpack-5.4.0/test/dummy/app/views/test/get_session_id.html.erb0000644000004100000410000000000014560640262026424 0ustar www-datawww-dataredis-actionpack-5.4.0/test/dummy/app/controllers/0000755000004100000410000000000014560640262022235 5ustar www-datawww-dataredis-actionpack-5.4.0/test/dummy/app/controllers/test_controller.rb0000644000004100000410000000151014560640262026001 0ustar www-datawww-dataclass TestController < ActionController::Base def self.actions public_instance_methods - ActionController::Base.public_instance_methods end 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.4.0/test/dummy/config/0000755000004100000410000000000014560640262020354 5ustar www-datawww-dataredis-actionpack-5.4.0/test/dummy/config/routes.rb0000644000004100000410000000020514560640262022217 0ustar www-datawww-dataDummy::Application.routes.draw do TestController.actions.each do |action| get action, to: ['test', action].join('#') end end redis-actionpack-5.4.0/test/dummy/config/application.rb0000644000004100000410000000146214560640262023207 0ustar www-datawww-datarequire 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.4.0/test/dummy/config/environment.rb0000644000004100000410000000022514560640262023244 0ustar www-datawww-data# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Dummy::Application.initialize! redis-actionpack-5.4.0/test/dummy/config/boot.rb0000644000004100000410000000035414560640262021646 0ustar www-datawww-datarequire '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.4.0/test/dummy/script/0000755000004100000410000000000014560640262020413 5ustar www-datawww-dataredis-actionpack-5.4.0/test/dummy/script/rails0000755000004100000410000000044714560640262021460 0ustar www-datawww-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.4.0/gemfiles/0000755000004100000410000000000014560640262016570 5ustar www-datawww-dataredis-actionpack-5.4.0/gemfiles/rails_5.2.x.gemfile0000644000004100000410000000057414560640262022074 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rake", ">= 12.3.3" gem "bundler", "~> 2.1" gem "mocha", "~> 0.14.0", require: "mocha/setup" gem "tzinfo", "~> 1.2" gem "appraisal", "~> 2.2" gem "redis-store-testing", github: "redis-store/testing" gem "minitest-rails" gem "redis-store" gem "redis-rack" gem "actionpack", "~> 5.1.0" gemspec path: "../" redis-actionpack-5.4.0/gemfiles/rails_5.1.x.gemfile0000644000004100000410000000057414560640262022073 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rake", ">= 12.3.3" gem "bundler", "~> 2.1" gem "mocha", "~> 0.14.0", require: "mocha/setup" gem "tzinfo", "~> 1.2" gem "appraisal", "~> 2.2" gem "redis-store-testing", github: "redis-store/testing" gem "minitest-rails" gem "redis-store" gem "redis-rack" gem "actionpack", "~> 5.1.0" gemspec path: "../" redis-actionpack-5.4.0/gemfiles/rails_5.0.x.gemfile0000644000004100000410000000057414560640262022072 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rake", ">= 12.3.3" gem "bundler", "~> 2.1" gem "mocha", "~> 0.14.0", require: "mocha/setup" gem "tzinfo", "~> 1.2" gem "appraisal", "~> 2.2" gem "redis-store-testing", github: "redis-store/testing" gem "minitest-rails" gem "redis-store" gem "redis-rack" gem "actionpack", "~> 5.0.0" gemspec path: "../" redis-actionpack-5.4.0/gemfiles/rails_6.0.x.gemfile0000644000004100000410000000057414560640262022073 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rake", ">= 12.3.3" gem "bundler", "~> 2.1" gem "mocha", "~> 0.14.0", require: "mocha/setup" gem "tzinfo", "~> 1.2" gem "appraisal", "~> 2.2" gem "redis-store-testing", github: "redis-store/testing" gem "minitest-rails" gem "redis-store" gem "redis-rack" gem "actionpack", "~> 6.0.0" gemspec path: "../" redis-actionpack-5.4.0/Rakefile0000644000004100000410000000014714560640262016444 0ustar www-datawww-datarequire 'bundler/setup' require 'rake' require 'bundler/gem_tasks' require 'redis-store/testing/tasks' redis-actionpack-5.4.0/CODEOWNERS0000644000004100000410000000001114560640262016360 0ustar www-datawww-data* @tubbo redis-actionpack-5.4.0/MIT-LICENSE0000644000004100000410000000204514560640262016432 0ustar www-datawww-dataCopyright (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. redis-actionpack-5.4.0/Gemfile0000644000004100000410000000040714560640262016271 0ustar www-datawww-datasource 'https://rubygems.org' gemspec gem 'rake', '>= 12.3.3' gem 'bundler', '~> 2.1' gem 'mocha', '~> 0.14.0', require: 'mocha/setup' gem 'tzinfo', '~> 1.2' gem 'appraisal', '~> 2.2' gem 'redis-store-testing', github: 'redis-store/testing' gem 'minitest-rails' redis-actionpack-5.4.0/README.md0000644000004100000410000000505614560640262016262 0ustar www-datawww-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, 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. - **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 [![Gem Version](https://badge.fury.io/rb/redis-actionpack.svg)](http://badge.fury.io/rb/redis-actionpack) [![Build Status](https://secure.travis-ci.org/redis-store/redis-actionpack.svg?branch=master)](http://travis-ci.org/redis-store/redis-actionpack?branch=master) [![Code Climate](https://codeclimate.com/github/redis-store/redis-actionpack.svg)](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.4.0/CHANGELOG.md0000644000004100000410000001360514560640262016613 0ustar www-datawww-datav5.3.0 (2022-01-17) -------------------------------------------------------------------------------- * Support actionpack 7 Shodai Suzuki 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