devise_cas_authenticatable 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +4 -0
- data/README.md +4 -0
- data/app/controllers/devise/cas_sessions_controller.rb +3 -4
- data/devise_cas_authenticatable.gemspec +1 -1
- data/lib/devise_cas_authenticatable/single_sign_out.rb +4 -4
- data/lib/devise_cas_authenticatable/single_sign_out/rack.rb +16 -7
- metadata +79 -110
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5448fb286452b15ccbd920790c2e460da848493d
|
4
|
+
data.tar.gz: c3d8cd05c1ea43e6339dad9f7533b4122bdf4381
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ef08c90a7c12c002bbab20ce4513a89f6350ed21b9564164ded03c73444250e11830d8678b6e589dd0f00d196181f0d985e1592a90af7f65d955f8266f7205b8
|
7
|
+
data.tar.gz: c059b6cc5aa59cd8cea3f3eb3a0930c28877355ad154b9efe44f341346d712fb1e4d1987bbf803eb240ea91aeac04daa79c5a0664a5b5519085c786d5e89ff25
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -77,6 +77,10 @@ to tell your app how to talk to your CAS server:
|
|
77
77
|
# config.cas_destination_url = 'https://cas.myorganization.com'
|
78
78
|
# config.cas_follow_url = 'https://cas.myorganization.com'
|
79
79
|
# config.cas_logout_url_param = nil
|
80
|
+
|
81
|
+
# You can specify the name of the destination argument with the following option.
|
82
|
+
# e.g. the following option will change it from 'destination' to 'url'
|
83
|
+
# config.cas_destination_logout_param_name = 'url'
|
80
84
|
|
81
85
|
# By default, devise_cas_authenticatable will create users. If you would rather
|
82
86
|
# require user records to already exist locally before they can authenticate via
|
@@ -39,7 +39,8 @@ class Devise::CasSessionsController < Devise::SessionsController
|
|
39
39
|
logger.debug "Intercepted single-sign-out request for CAS session #{session_index}."
|
40
40
|
session_id = ::DeviseCasAuthenticatable::SingleSignOut::Strategies.current_strategy.find_session_id_by_index(session_index)
|
41
41
|
if session_id
|
42
|
-
|
42
|
+
logger.debug "Found Session ID #{session_id} with index key #{session_index}"
|
43
|
+
destroy_cas_session(session_index, session_id)
|
43
44
|
end
|
44
45
|
else
|
45
46
|
logger.warn "Ignoring CAS single-sign-out request as no session index could be parsed from the parameters."
|
@@ -64,12 +65,10 @@ class Devise::CasSessionsController < Devise::SessionsController
|
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
67
|
-
def destroy_cas_session(
|
68
|
-
logger.debug "Destroying cas session #{session_id} for ticket #{session_index}"
|
68
|
+
def destroy_cas_session(session_index, session_id)
|
69
69
|
if destroy_session_by_id(session_id)
|
70
70
|
logger.debug "Destroyed session #{session_id} corresponding to service ticket #{session_index}."
|
71
71
|
end
|
72
|
-
|
73
72
|
::DeviseCasAuthenticatable::SingleSignOut::Strategies.current_strategy.delete_session_index(session_index)
|
74
73
|
end
|
75
74
|
|
@@ -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.3.
|
5
|
+
s.version = "1.3.3"
|
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,8 +1,8 @@
|
|
1
1
|
module DeviseCasAuthenticatable
|
2
2
|
module SingleSignOut
|
3
3
|
|
4
|
-
def self.
|
5
|
-
defined?(::Rails) && ::Rails::VERSION::MAJOR
|
4
|
+
def self.rails3_or_greater?
|
5
|
+
defined?(::Rails) && ::Rails::VERSION::MAJOR >= 3
|
6
6
|
end
|
7
7
|
|
8
8
|
# Supports destroying sessions by ID for ActiveRecord and Redis session stores
|
@@ -10,8 +10,8 @@ module DeviseCasAuthenticatable
|
|
10
10
|
def session_store_class
|
11
11
|
@session_store_class ||=
|
12
12
|
begin
|
13
|
-
|
14
|
-
|
13
|
+
# Rails 3 & 4 session store
|
14
|
+
if ::DeviseCasAuthenticatable::SingleSignOut.rails3_or_greater?
|
15
15
|
Rails.configuration.session_store
|
16
16
|
::Rails.application.config.session_store
|
17
17
|
else
|
@@ -2,6 +2,9 @@ module DeviseCasAuthenticatable
|
|
2
2
|
module SingleSignOut
|
3
3
|
|
4
4
|
class StoreSessionId
|
5
|
+
CAS_TICKET_STORE = 'cas_last_valid_ticket_store'
|
6
|
+
CAS_LAST_TICKET = 'cas_last_valid_ticket'
|
7
|
+
|
5
8
|
def initialize(app)
|
6
9
|
@app = app
|
7
10
|
end
|
@@ -12,19 +15,25 @@ module DeviseCasAuthenticatable
|
|
12
15
|
end
|
13
16
|
|
14
17
|
private
|
15
|
-
|
16
18
|
def store_session_id_for_cas_ticket(env)
|
17
19
|
request = Rack::Request.new(env)
|
18
20
|
session = request.session
|
19
21
|
|
20
|
-
if session
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
if session.respond_to?(:id)
|
23
|
+
# Rack > 1.5
|
24
|
+
session_id = session.id
|
25
|
+
else
|
26
|
+
# Compatible with old Rack requests
|
27
|
+
session_id = env['rack.session.options'][:id]
|
25
28
|
end
|
26
|
-
|
29
|
+
cas_ticket_store = session[CAS_TICKET_STORE]
|
27
30
|
|
31
|
+
if cas_ticket_store
|
32
|
+
Rails.logger.info "Storing Session ID #{session_id} for ticket #{session[CAS_LAST_TICKET]}"
|
33
|
+
::DeviseCasAuthenticatable::SingleSignOut::Strategies.current_strategy.store_session_id_for_index(session[CAS_LAST_TICKET], session_id)
|
34
|
+
session[CAS_TICKET_STORE] = false
|
35
|
+
end
|
36
|
+
end
|
28
37
|
end
|
29
38
|
end
|
30
39
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_cas_authenticatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 1.3.2
|
4
|
+
version: 1.3.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nat Budin
|
@@ -10,216 +9,190 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2013-
|
12
|
+
date: 2013-12-13 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
|
-
prerelease: false
|
17
15
|
name: devise
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
20
17
|
requirements:
|
21
|
-
- -
|
18
|
+
- - '>='
|
22
19
|
- !ruby/object:Gem::Version
|
23
20
|
version: 1.2.0
|
24
|
-
|
25
|
-
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
24
|
requirements:
|
27
|
-
- -
|
25
|
+
- - '>='
|
28
26
|
- !ruby/object:Gem::Version
|
29
27
|
version: 1.2.0
|
30
|
-
none: false
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
|
-
prerelease: false
|
33
29
|
name: rubycas-client
|
34
|
-
|
35
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
36
31
|
requirements:
|
37
|
-
- -
|
32
|
+
- - '>='
|
38
33
|
- !ruby/object:Gem::Version
|
39
34
|
version: 2.2.1
|
40
|
-
|
41
|
-
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
38
|
requirements:
|
43
|
-
- -
|
39
|
+
- - '>='
|
44
40
|
- !ruby/object:Gem::Version
|
45
41
|
version: 2.2.1
|
46
|
-
none: false
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
|
-
prerelease: false
|
49
43
|
name: rails
|
50
|
-
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
52
45
|
requirements:
|
53
|
-
- -
|
46
|
+
- - '>='
|
54
47
|
- !ruby/object:Gem::Version
|
55
48
|
version: 3.0.7
|
56
|
-
|
57
|
-
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
52
|
requirements:
|
59
|
-
- -
|
53
|
+
- - '>='
|
60
54
|
- !ruby/object:Gem::Version
|
61
55
|
version: 3.0.7
|
62
|
-
none: false
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
|
-
prerelease: false
|
65
57
|
name: rspec-rails
|
66
|
-
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
68
59
|
requirements:
|
69
|
-
- -
|
60
|
+
- - '>='
|
70
61
|
- !ruby/object:Gem::Version
|
71
62
|
version: '0'
|
72
|
-
|
73
|
-
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
66
|
requirements:
|
75
|
-
- -
|
67
|
+
- - '>='
|
76
68
|
- !ruby/object:Gem::Version
|
77
69
|
version: '0'
|
78
|
-
none: false
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
|
-
prerelease: false
|
81
71
|
name: mocha
|
82
|
-
|
83
|
-
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
84
73
|
requirements:
|
85
|
-
- -
|
74
|
+
- - '>='
|
86
75
|
- !ruby/object:Gem::Version
|
87
76
|
version: '0'
|
88
|
-
|
89
|
-
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
80
|
requirements:
|
91
|
-
- -
|
81
|
+
- - '>='
|
92
82
|
- !ruby/object:Gem::Version
|
93
83
|
version: '0'
|
94
|
-
none: false
|
95
84
|
- !ruby/object:Gem::Dependency
|
96
|
-
prerelease: false
|
97
85
|
name: shoulda
|
98
|
-
|
99
|
-
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
100
87
|
requirements:
|
101
88
|
- - ~>
|
102
89
|
- !ruby/object:Gem::Version
|
103
90
|
version: 3.4.0
|
104
|
-
|
105
|
-
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
94
|
requirements:
|
107
95
|
- - ~>
|
108
96
|
- !ruby/object:Gem::Version
|
109
97
|
version: 3.4.0
|
110
|
-
none: false
|
111
98
|
- !ruby/object:Gem::Dependency
|
112
|
-
prerelease: false
|
113
99
|
name: sqlite3-ruby
|
114
|
-
|
115
|
-
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
116
101
|
requirements:
|
117
|
-
- -
|
102
|
+
- - '>='
|
118
103
|
- !ruby/object:Gem::Version
|
119
104
|
version: '0'
|
120
|
-
|
121
|
-
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
108
|
requirements:
|
123
|
-
- -
|
109
|
+
- - '>='
|
124
110
|
- !ruby/object:Gem::Version
|
125
111
|
version: '0'
|
126
|
-
none: false
|
127
112
|
- !ruby/object:Gem::Dependency
|
128
|
-
prerelease: false
|
129
113
|
name: sham_rack
|
130
|
-
|
131
|
-
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
132
115
|
requirements:
|
133
|
-
- -
|
116
|
+
- - '>='
|
134
117
|
- !ruby/object:Gem::Version
|
135
118
|
version: '0'
|
136
|
-
|
137
|
-
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
122
|
requirements:
|
139
|
-
- -
|
123
|
+
- - '>='
|
140
124
|
- !ruby/object:Gem::Version
|
141
125
|
version: '0'
|
142
|
-
none: false
|
143
126
|
- !ruby/object:Gem::Dependency
|
144
|
-
prerelease: false
|
145
127
|
name: capybara
|
146
|
-
|
147
|
-
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
148
129
|
requirements:
|
149
130
|
- - ~>
|
150
131
|
- !ruby/object:Gem::Version
|
151
132
|
version: 1.1.4
|
152
|
-
|
153
|
-
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
136
|
requirements:
|
155
137
|
- - ~>
|
156
138
|
- !ruby/object:Gem::Version
|
157
139
|
version: 1.1.4
|
158
|
-
none: false
|
159
140
|
- !ruby/object:Gem::Dependency
|
160
|
-
prerelease: false
|
161
141
|
name: crypt-isaac
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - '>='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
162
147
|
type: :development
|
148
|
+
prerelease: false
|
163
149
|
version_requirements: !ruby/object:Gem::Requirement
|
164
150
|
requirements:
|
165
|
-
- -
|
151
|
+
- - '>='
|
166
152
|
- !ruby/object:Gem::Version
|
167
153
|
version: '0'
|
168
|
-
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: launchy
|
169
156
|
requirement: !ruby/object:Gem::Requirement
|
170
157
|
requirements:
|
171
|
-
- -
|
158
|
+
- - '>='
|
172
159
|
- !ruby/object:Gem::Version
|
173
160
|
version: '0'
|
174
|
-
none: false
|
175
|
-
- !ruby/object:Gem::Dependency
|
176
|
-
prerelease: false
|
177
|
-
name: launchy
|
178
161
|
type: :development
|
162
|
+
prerelease: false
|
179
163
|
version_requirements: !ruby/object:Gem::Requirement
|
180
164
|
requirements:
|
181
|
-
- -
|
165
|
+
- - '>='
|
182
166
|
- !ruby/object:Gem::Version
|
183
167
|
version: '0'
|
184
|
-
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: timecop
|
185
170
|
requirement: !ruby/object:Gem::Requirement
|
186
171
|
requirements:
|
187
|
-
- -
|
172
|
+
- - '>='
|
188
173
|
- !ruby/object:Gem::Version
|
189
174
|
version: '0'
|
190
|
-
none: false
|
191
|
-
- !ruby/object:Gem::Dependency
|
192
|
-
prerelease: false
|
193
|
-
name: timecop
|
194
175
|
type: :development
|
176
|
+
prerelease: false
|
195
177
|
version_requirements: !ruby/object:Gem::Requirement
|
196
178
|
requirements:
|
197
|
-
- -
|
179
|
+
- - '>='
|
198
180
|
- !ruby/object:Gem::Version
|
199
181
|
version: '0'
|
200
|
-
|
182
|
+
- !ruby/object:Gem::Dependency
|
183
|
+
name: pry
|
201
184
|
requirement: !ruby/object:Gem::Requirement
|
202
185
|
requirements:
|
203
|
-
- -
|
186
|
+
- - '>='
|
204
187
|
- !ruby/object:Gem::Version
|
205
188
|
version: '0'
|
206
|
-
none: false
|
207
|
-
- !ruby/object:Gem::Dependency
|
208
|
-
prerelease: false
|
209
|
-
name: pry
|
210
189
|
type: :development
|
190
|
+
prerelease: false
|
211
191
|
version_requirements: !ruby/object:Gem::Requirement
|
212
192
|
requirements:
|
213
|
-
- -
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '0'
|
216
|
-
none: false
|
217
|
-
requirement: !ruby/object:Gem::Requirement
|
218
|
-
requirements:
|
219
|
-
- - ! '>='
|
193
|
+
- - '>='
|
220
194
|
- !ruby/object:Gem::Version
|
221
195
|
version: '0'
|
222
|
-
none: false
|
223
196
|
description: CAS authentication module for Devise
|
224
197
|
email: natbudin@gmail.com
|
225
198
|
executables: []
|
@@ -300,30 +273,26 @@ files:
|
|
300
273
|
homepage: http://github.com/nbudin/devise_cas_authenticatable
|
301
274
|
licenses:
|
302
275
|
- MIT
|
276
|
+
metadata: {}
|
303
277
|
post_install_message:
|
304
278
|
rdoc_options: []
|
305
279
|
require_paths:
|
306
280
|
- lib
|
307
281
|
required_ruby_version: !ruby/object:Gem::Requirement
|
308
282
|
requirements:
|
309
|
-
- -
|
283
|
+
- - '>='
|
310
284
|
- !ruby/object:Gem::Version
|
311
|
-
segments:
|
312
|
-
- 0
|
313
|
-
hash: -1549464804654339845
|
314
285
|
version: '0'
|
315
|
-
none: false
|
316
286
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
317
287
|
requirements:
|
318
|
-
- -
|
288
|
+
- - '>'
|
319
289
|
- !ruby/object:Gem::Version
|
320
290
|
version: 1.3.1
|
321
|
-
none: false
|
322
291
|
requirements: []
|
323
292
|
rubyforge_project:
|
324
|
-
rubygems_version: 1.
|
293
|
+
rubygems_version: 2.1.11
|
325
294
|
signing_key:
|
326
|
-
specification_version:
|
295
|
+
specification_version: 4
|
327
296
|
summary: CAS authentication module for Devise
|
328
297
|
test_files:
|
329
298
|
- spec/config_spec.rb
|