rack-cas 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +2 -0
- data/lib/rack/cas.rb +6 -1
- data/lib/rack-cas/railtie.rb +5 -1
- data/lib/rack-cas/server.rb +5 -2
- data/lib/rack-cas/session_store/active_record.rb +5 -0
- data/lib/rack-cas/session_store/mongoid.rb +5 -0
- data/lib/rack-cas/version.rb +1 -1
- data/lib/tasks/session_prune.rake +17 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17b2eb28b1316218061aa196765ebd91eed4165f
|
4
|
+
data.tar.gz: 6bcd8a9a58677c3244c560094e50ac7ae5e14813
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0167e45bc8b7d7f770ee602d06c3fac2fc3b5567a531bea595b7d08e34a7a1d254a02095bf31297cc785f034912c5093f0a1ea7ae27523679572be7ada3a51ac
|
7
|
+
data.tar.gz: 50e6a879ecbbbcce0bb5b66a2bcdafb5281643dee09238d1106db5b47cf0de6bbf2dc8fb3b7e2b85933b92e405d8577dfdeaa637bd404e65d7ef0a6dbe0d82b0
|
data/README.markdown
CHANGED
@@ -13,6 +13,8 @@ Current gem dependencies are [rack](http://rubygems.org/gems/rack), [addressable
|
|
13
13
|
Extra attributes are a mess though. So let me know if your brand of CAS server isn't supported.
|
14
14
|
* __Single sign out__
|
15
15
|
One of the included session stores must be used.
|
16
|
+
* __Rake tasks to prune stale sessions__
|
17
|
+
`rack_cas:sessions:prune:active_record` and `rack_cas:sessions:prune:mongoid`
|
16
18
|
|
17
19
|
Requirements
|
18
20
|
============
|
data/lib/rack/cas.rb
CHANGED
@@ -39,7 +39,7 @@ class Rack::CAS
|
|
39
39
|
log env, 'rack-cas: Intercepting logout request.'
|
40
40
|
|
41
41
|
request.session.clear
|
42
|
-
return redirect_to server.logout_url.to_s
|
42
|
+
return redirect_to server.logout_url(request.params).to_s
|
43
43
|
end
|
44
44
|
|
45
45
|
if cas_request.single_sign_out? && @session_store
|
@@ -71,6 +71,11 @@ class Rack::CAS
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def store_session(request, user, ticket, extra_attrs = {})
|
74
|
+
if @config[:extra_attributes_filter]
|
75
|
+
filter = Array(@config[:extra_attributes_filter]).map(&:to_s)
|
76
|
+
extra_attrs = extra_attrs.select { |key, val| filter.include? key }
|
77
|
+
end
|
78
|
+
|
74
79
|
request.session['cas'] = { 'user' => user, 'ticket' => ticket, 'extra_attributes' => extra_attrs }
|
75
80
|
end
|
76
81
|
|
data/lib/rack-cas/railtie.rb
CHANGED
data/lib/rack-cas/server.rb
CHANGED
@@ -12,8 +12,11 @@ module RackCAS
|
|
12
12
|
@url.dup.append_path('login').add_params(service: service_url)
|
13
13
|
end
|
14
14
|
|
15
|
-
def logout_url
|
16
|
-
@url.dup.
|
15
|
+
def logout_url(params = {})
|
16
|
+
@url.dup.tap do |url|
|
17
|
+
url.append_path('logout')
|
18
|
+
url.add_params(params) unless params.empty?
|
19
|
+
end
|
17
20
|
end
|
18
21
|
|
19
22
|
def validate_service(service_url, ticket)
|
data/lib/rack-cas/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
namespace :rack_cas do
|
2
|
+
namespace :sessions do
|
3
|
+
namespace :prune do
|
4
|
+
desc 'Delete old sessions from an Active Record session store'
|
5
|
+
task :active_record, [:after] => :environment do |t, args|
|
6
|
+
after = (Time.parse(args.after.to_s) unless args.after.nil?)
|
7
|
+
RackCAS::ActiveRecordStore.prune after
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'Delete old sessions from an Mongoid session store'
|
11
|
+
task :mongoid, [:after] => :environment do |t, args|
|
12
|
+
after = (Time.parse(args.after.to_s) unless args.after.nil?)
|
13
|
+
RackCAS::MongoidStore.prune after
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-cas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- lib/generators/templates/migration.rb
|
122
122
|
- lib/rack/cas.rb
|
123
123
|
- lib/rack/fake_cas.rb
|
124
|
+
- lib/tasks/session_prune.rake
|
124
125
|
homepage: https://github.com/biola/rack-cas
|
125
126
|
licenses: []
|
126
127
|
metadata: {}
|