devise_cas_authenticatable 1.10.3 → 1.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/devise_cas_authenticatable.gemspec +1 -1
- data/lib/devise_cas_authenticatable/single_sign_out.rb +5 -1
- data/lib/devise_cas_authenticatable/single_sign_out/strategies/redis_cache.rb +10 -5
- data/lib/devise_cas_authenticatable/single_sign_out/with_conn.rb +14 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0e52720581da9cbfecdabb24df82f099b140b5c282885dd0aa3a1fbef559fcb1
|
4
|
+
data.tar.gz: bb55162fe23ae48432b59140811fadd15e24918f0aa2647bcbd51d2094a210e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d3c2e442a37315c935dd021b5f05a6e38a8e3112b2b8f7e8d0e11c31db3622ae10785d377ec9942e43c4d12b8a94b7faea9e863759a53dc5543fb4d4e7e6584
|
7
|
+
data.tar.gz: 84dd388a716bc5f31f3f0fd263b550a85a39ba183e46b67492923871981b30c1ab77a96e326f9592383d416e6b4195a44e9cdd65819797ca6c37407cd487ded1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog for devise\_cas\_authenticatable
|
2
2
|
|
3
|
+
## Version 1.10.4 - April 26, 2019
|
4
|
+
|
5
|
+
* Fixes for single sign out on Redis session store using newer Redis gems (thanks @ledestin!)
|
6
|
+
|
3
7
|
## Version 1.10.3 - July 28, 2017
|
4
8
|
|
5
9
|
* Rails 5.1 deprecation fix (thanks @jamgregory!)
|
@@ -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.10.
|
5
|
+
s.version = "1.10.4"
|
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"]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'devise_cas_authenticatable/single_sign_out/with_conn'
|
2
|
+
|
1
3
|
module DeviseCasAuthenticatable
|
2
4
|
module SingleSignOut
|
3
5
|
|
@@ -7,6 +9,8 @@ module DeviseCasAuthenticatable
|
|
7
9
|
|
8
10
|
# Supports destroying sessions by ID for ActiveRecord and Redis session stores
|
9
11
|
module DestroySession
|
12
|
+
include ::DeviseCasAuthenticatable::SingleSignOut::WithConn
|
13
|
+
|
10
14
|
def destroy_session_by_id(sid)
|
11
15
|
logger.debug "Single Sign Out from session store: #{current_session_store.class}"
|
12
16
|
|
@@ -25,7 +29,7 @@ module DeviseCasAuthenticatable
|
|
25
29
|
current_session_store.send(:destroy_session, env, sid, drop: true)
|
26
30
|
true
|
27
31
|
elsif session_store_class.name =~ /Redis/
|
28
|
-
|
32
|
+
with_conn { |conn| conn.del(sid) }
|
29
33
|
true
|
30
34
|
elsif session_store_class.name =~ /CacheStore/
|
31
35
|
if current_session_store.respond_to?(:delete_session) # Rails 5 and up
|
@@ -1,18 +1,23 @@
|
|
1
|
+
require 'devise_cas_authenticatable/single_sign_out/with_conn'
|
2
|
+
|
1
3
|
module DeviseCasAuthenticatable
|
2
4
|
module SingleSignOut
|
3
5
|
module Strategies
|
4
6
|
class RedisCache < Base
|
5
7
|
include ::DeviseCasAuthenticatable::SingleSignOut::DestroySession
|
8
|
+
include ::DeviseCasAuthenticatable::SingleSignOut::WithConn
|
6
9
|
|
7
10
|
def store_session_id_for_index(session_index, session_id)
|
8
11
|
logger.debug("Storing #{session_id} for index #{session_index}")
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
with_conn do |conn|
|
13
|
+
conn.set(
|
14
|
+
cache_key(session_index),
|
15
|
+
session_id
|
16
|
+
)
|
17
|
+
end
|
13
18
|
end
|
14
19
|
def find_session_id_by_index(session_index)
|
15
|
-
sid =
|
20
|
+
sid = with_conn { |conn| conn.get(cache_key(session_index)) }
|
16
21
|
logger.debug("Found session id #{sid} for index #{session_index}") if sid
|
17
22
|
sid
|
18
23
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module DeviseCasAuthenticatable
|
2
|
+
module SingleSignOut
|
3
|
+
module WithConn
|
4
|
+
def with_conn(&block)
|
5
|
+
if old_style_conn = current_session_store.instance_variable_get(:@pool)
|
6
|
+
yield old_style_conn
|
7
|
+
else
|
8
|
+
current_session_store.instance_variable_get(:@conn)
|
9
|
+
.instance_variable_get(:@pool).with &block
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
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.10.
|
4
|
+
version: 1.10.4
|
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: 2019-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
@@ -250,6 +250,7 @@ files:
|
|
250
250
|
- lib/devise_cas_authenticatable/single_sign_out/strategies/rails_cache.rb
|
251
251
|
- lib/devise_cas_authenticatable/single_sign_out/strategies/redis_cache.rb
|
252
252
|
- lib/devise_cas_authenticatable/single_sign_out/warden_failure_app.rb
|
253
|
+
- lib/devise_cas_authenticatable/single_sign_out/with_conn.rb
|
253
254
|
- lib/devise_cas_authenticatable/strategy.rb
|
254
255
|
- rails/init.rb
|
255
256
|
- spec/config_spec.rb
|
@@ -311,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
312
|
version: 1.3.1
|
312
313
|
requirements: []
|
313
314
|
rubyforge_project:
|
314
|
-
rubygems_version: 2.6
|
315
|
+
rubygems_version: 2.7.6
|
315
316
|
signing_key:
|
316
317
|
specification_version: 4
|
317
318
|
summary: CAS authentication module for Devise
|