devise_cas_authenticatable 1.9.2 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.devise42 +13 -0
- data/README.md +1 -1
- data/app/controllers/devise/cas_sessions_controller.rb +5 -4
- data/devise_cas_authenticatable.gemspec +1 -1
- data/lib/devise_cas_authenticatable/single_sign_out.rb +1 -0
- data/lib/devise_cas_authenticatable/single_sign_out/strategies/redis_cache.rb +33 -0
- data/spec/scenario/config/environments/test.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6824ecb21e1985d511f8d169771d1cc60adc1a1
|
4
|
+
data.tar.gz: a850dcf9fa887f50dec5c69a02cccce187d8efa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf184645543aebfed2825941fd16fc1846a2f4296e62cb382f38c3d68d746953de2543dd2953cb9e9c0707652be9214879187a8a69781ff492e887fbbf350d78
|
7
|
+
data.tar.gz: 5a0b573b501e5bdfcb72eca161ed4ef9caa4928e1d91486d9c234ebbf65e5719679d87cee7e07f114e28813fd95e27da1e7d3babb68a6d6452e41fea36fc05a3
|
data/.travis.yml
CHANGED
@@ -12,6 +12,7 @@ gemfile:
|
|
12
12
|
- Gemfile.devise20
|
13
13
|
- Gemfile.devise21
|
14
14
|
- Gemfile.devise30
|
15
|
+
- Gemfile.devise42
|
15
16
|
|
16
17
|
# Exclude unsupported Ruby/Rails combinations
|
17
18
|
matrix:
|
@@ -22,6 +23,12 @@ matrix:
|
|
22
23
|
gemfile: Gemfile.devise30
|
23
24
|
- rvm: 2.1.2
|
24
25
|
gemfile: Gemfile.devise30
|
26
|
+
- rvm: 1.9.3
|
27
|
+
gemfile: Gemfile.devise42
|
28
|
+
- rvm: 2.0.0
|
29
|
+
gemfile: Gemfile.devise42
|
30
|
+
- rvm: 2.1.2
|
31
|
+
gemfile: Gemfile.devise42
|
25
32
|
- rvm: 2.2.4
|
26
33
|
gemfile: Gemfile.devise12
|
27
34
|
- rvm: 2.2.4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog for devise\_cas\_authenticatable
|
2
2
|
|
3
|
+
## Version 1.10.0 - February 6, 2017
|
4
|
+
|
5
|
+
* Support Redis as a single sign-out store (thanks @tubsandcans!)
|
6
|
+
* More Rails 5 compatibility fixes (thanks @debborafernandess and @drobny!)
|
7
|
+
|
3
8
|
## Version 1.9.2 - July 6, 2016
|
4
9
|
|
5
10
|
* Fix middleware syntax for Rails 5 compatibility (thanks @drobny!)
|
data/Gemfile.devise42
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in devise_cas_authenticatable.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem 'rails', '~> 5.0.0'
|
7
|
+
gem 'devise', '~> 4.2.0'
|
8
|
+
gem 'activerecord-session_store'
|
9
|
+
gem 'sinatra', '~> 2.0.0.beta2'
|
10
|
+
|
11
|
+
group :test do
|
12
|
+
gem 'castronaut', :git => 'https://github.com/nbudin/castronaut.git', :branch => 'dam5s-merge'
|
13
|
+
end
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Taking a lot of inspiration from [devise_ldap_authenticatable](http://github.com
|
|
6
6
|
|
7
7
|
devise_cas_authenticatable is [CAS](http://www.jasig.org/cas) single sign-on support for
|
8
8
|
[Devise](http://github.com/plataformatec/devise) applications. It acts as a replacement for
|
9
|
-
database_authenticatable. It builds on [rubycas-client](
|
9
|
+
database_authenticatable. It builds on [rubycas-client](https://github.com/rubycas/rubycas-client)
|
10
10
|
and should support just about any conformant CAS server (although I have personally tested it
|
11
11
|
using [rubycas-server](http://github.com/gunark/rubycas-server)).
|
12
12
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
class Devise::CasSessionsController < Devise::SessionsController
|
2
2
|
include DeviseCasAuthenticatable::SingleSignOut::DestroySession
|
3
3
|
|
4
|
-
|
5
|
-
unloadable
|
4
|
+
if Rails::VERSION::MAJOR < 4
|
5
|
+
unloadable # Rails 5 no longer requires this
|
6
|
+
skip_before_filter :verify_authenticity_token, :only => [:single_sign_out], :raise => false
|
7
|
+
else
|
8
|
+
skip_before_action :verify_authenticity_token, :only => [:single_sign_out], :raise => false
|
6
9
|
end
|
7
10
|
|
8
|
-
skip_before_filter :verify_authenticity_token, :only => [:single_sign_out]
|
9
|
-
|
10
11
|
def new
|
11
12
|
if memcache_checker.session_store_memcache? && !memcache_checker.alive?
|
12
13
|
raise "memcache is down, can't get session data from it"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{devise_cas_authenticatable}
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.10.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Nat Budin", "Jeremy Haile"]
|
@@ -56,4 +56,5 @@ end
|
|
56
56
|
require 'devise_cas_authenticatable/single_sign_out/strategies'
|
57
57
|
require 'devise_cas_authenticatable/single_sign_out/strategies/base'
|
58
58
|
require 'devise_cas_authenticatable/single_sign_out/strategies/rails_cache'
|
59
|
+
require 'devise_cas_authenticatable/single_sign_out/strategies/redis_cache'
|
59
60
|
require 'devise_cas_authenticatable/single_sign_out/rack'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module DeviseCasAuthenticatable
|
2
|
+
module SingleSignOut
|
3
|
+
module Strategies
|
4
|
+
class RedisCache < Base
|
5
|
+
include ::DeviseCasAuthenticatable::SingleSignOut::DestroySession
|
6
|
+
|
7
|
+
def store_session_id_for_index(session_index, session_id)
|
8
|
+
logger.debug("Storing #{session_id} for index #{session_index}")
|
9
|
+
current_session_store.instance_variable_get(:@pool).set(
|
10
|
+
cache_key(session_index),
|
11
|
+
session_id
|
12
|
+
)
|
13
|
+
end
|
14
|
+
def find_session_id_by_index(session_index)
|
15
|
+
sid = current_session_store.instance_variable_get(:@pool).get(cache_key(session_index))
|
16
|
+
logger.debug("Found session id #{sid} for index #{session_index}")
|
17
|
+
sid
|
18
|
+
end
|
19
|
+
def delete_session_index(session_index)
|
20
|
+
logger.debug("Deleting index #{session_index}")
|
21
|
+
destroy_session_by_id(session_index)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
def cache_key(session_index)
|
26
|
+
"devise_cas_authenticatable:#{session_index}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
::DeviseCasAuthenticatable::SingleSignOut::Strategies.add(:redis_cache, DeviseCasAuthenticatable::SingleSignOut::Strategies::RedisCache )
|
@@ -1,5 +1,6 @@
|
|
1
1
|
Scenario::Application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
+
config.eager_load = false
|
3
4
|
|
4
5
|
# The test environment is used exclusively to run your application's
|
5
6
|
# test suite. You never need to work with it otherwise. Remember that
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_cas_authenticatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Budin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
@@ -226,6 +226,7 @@ files:
|
|
226
226
|
- Gemfile.devise20
|
227
227
|
- Gemfile.devise21
|
228
228
|
- Gemfile.devise30
|
229
|
+
- Gemfile.devise42
|
229
230
|
- LICENSE
|
230
231
|
- README.md
|
231
232
|
- Rakefile
|
@@ -247,6 +248,7 @@ files:
|
|
247
248
|
- lib/devise_cas_authenticatable/single_sign_out/strategies.rb
|
248
249
|
- lib/devise_cas_authenticatable/single_sign_out/strategies/base.rb
|
249
250
|
- lib/devise_cas_authenticatable/single_sign_out/strategies/rails_cache.rb
|
251
|
+
- lib/devise_cas_authenticatable/single_sign_out/strategies/redis_cache.rb
|
250
252
|
- lib/devise_cas_authenticatable/single_sign_out/warden_failure_app.rb
|
251
253
|
- lib/devise_cas_authenticatable/strategy.rb
|
252
254
|
- rails/init.rb
|