bsm-sso-client 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,6 @@ class Bsm::Sso::Client::Strategies::HttpAuth < Bsm::Sso::Client::Strategies::Bas
18
18
  @token ||= ActiveSupport::Base64.decode64($1).split(/:/, 2).first
19
19
  end
20
20
 
21
- Warden::Strategies.add :sso_http_auth, self
22
-
23
21
  end
22
+
23
+ Warden::Strategies.add :sso_http_auth, Bsm::Sso::Client::Strategies::HttpAuth
@@ -10,5 +10,7 @@ class Bsm::Sso::Client::Strategies::Ticket < Bsm::Sso::Client::Strategies::Base
10
10
  u.nil? ? fail!(:invalid) : success!(u)
11
11
  end
12
12
 
13
- Warden::Strategies.add :sso_ticket, self
14
13
  end
14
+
15
+ Warden::Strategies.add :sso_ticket, Bsm::Sso::Client::Strategies::Ticket
16
+
@@ -1,11 +1,24 @@
1
1
  class Warden::SessionSerializer
2
-
2
+ # Stores user id and expiration time
3
3
  def serialize(record)
4
4
  record.id
5
5
  end
6
6
 
7
+ # Loads user and expiration time from session
7
8
  def deserialize(id)
8
9
  Bsm::Sso::Client.user_class.sso_find(id)
9
10
  end
11
+ end
10
12
 
13
+ Warden::Manager.after_set_user do |user, warden, opts|
14
+ scope = opts[:scope]
15
+
16
+ if user && opts[:event] == :authentication
17
+ warden.session(scope)['expire_at'] = Bsm::Sso::Client.expire_after.from_now.to_i
18
+ elsif opts[:event] == :fetch &&
19
+ warden.session(scope)['expire_at'].to_i < Time.now.to_i &&
20
+ warden.request.env["REQUEST_METHOD"] == "GET"
21
+ warden.logout(scope)
22
+ throw :warden, :scope => scope, :message => :timeout
23
+ end
11
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsm-sso-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,53 +9,53 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-25 00:00:00.000000000Z
12
+ date: 2011-10-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activeresource
16
- requirement: &14509780 !ruby/object:Gem::Requirement
16
+ requirement: &19682760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 3.0.0
21
+ version: 3.1.0
22
22
  - - <
23
23
  - !ruby/object:Gem::Version
24
24
  version: 3.2.0
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *14509780
27
+ version_requirements: *19682760
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: actionpack
30
- requirement: &14508960 !ruby/object:Gem::Requirement
30
+ requirement: &19658260 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
34
34
  - !ruby/object:Gem::Version
35
- version: 3.0.0
35
+ version: 3.1.0
36
36
  - - <
37
37
  - !ruby/object:Gem::Version
38
38
  version: 3.2.0
39
39
  type: :runtime
40
40
  prerelease: false
41
- version_requirements: *14508960
41
+ version_requirements: *19658260
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: railties
44
- requirement: &14495240 !ruby/object:Gem::Requirement
44
+ requirement: &19656340 !ruby/object:Gem::Requirement
45
45
  none: false
46
46
  requirements:
47
47
  - - ! '>='
48
48
  - !ruby/object:Gem::Version
49
- version: 3.0.0
49
+ version: 3.1.0
50
50
  - - <
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.2.0
53
53
  type: :runtime
54
54
  prerelease: false
55
- version_requirements: *14495240
55
+ version_requirements: *19656340
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rails_warden
58
- requirement: &14494520 !ruby/object:Gem::Requirement
58
+ requirement: &19653960 !ruby/object:Gem::Requirement
59
59
  none: false
60
60
  requirements:
61
61
  - - ~>
@@ -63,10 +63,10 @@ dependencies:
63
63
  version: 0.5.0
64
64
  type: :runtime
65
65
  prerelease: false
66
- version_requirements: *14494520
66
+ version_requirements: *19653960
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: rake
69
- requirement: &14494120 !ruby/object:Gem::Requirement
69
+ requirement: &19653060 !ruby/object:Gem::Requirement
70
70
  none: false
71
71
  requirements:
72
72
  - - ! '>='
@@ -74,10 +74,10 @@ dependencies:
74
74
  version: '0'
75
75
  type: :development
76
76
  prerelease: false
77
- version_requirements: *14494120
77
+ version_requirements: *19653060
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: rack-test
80
- requirement: &14493640 !ruby/object:Gem::Requirement
80
+ requirement: &19651900 !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
83
  - - ! '>='
@@ -85,10 +85,10 @@ dependencies:
85
85
  version: '0'
86
86
  type: :development
87
87
  prerelease: false
88
- version_requirements: *14493640
88
+ version_requirements: *19651900
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: rspec
91
- requirement: &14493220 !ruby/object:Gem::Requirement
91
+ requirement: &19641500 !ruby/object:Gem::Requirement
92
92
  none: false
93
93
  requirements:
94
94
  - - ! '>='
@@ -96,10 +96,10 @@ dependencies:
96
96
  version: '0'
97
97
  type: :development
98
98
  prerelease: false
99
- version_requirements: *14493220
99
+ version_requirements: *19641500
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: shoulda-matchers
102
- requirement: &14492780 !ruby/object:Gem::Requirement
102
+ requirement: &19640740 !ruby/object:Gem::Requirement
103
103
  none: false
104
104
  requirements:
105
105
  - - ! '>='
@@ -107,10 +107,10 @@ dependencies:
107
107
  version: '0'
108
108
  type: :development
109
109
  prerelease: false
110
- version_requirements: *14492780
110
+ version_requirements: *19640740
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
- requirement: &14492360 !ruby/object:Gem::Requirement
113
+ requirement: &19639980 !ruby/object:Gem::Requirement
114
114
  none: false
115
115
  requirements:
116
116
  - - ! '>='
@@ -118,7 +118,7 @@ dependencies:
118
118
  version: '0'
119
119
  type: :development
120
120
  prerelease: false
121
- version_requirements: *14492360
121
+ version_requirements: *19639980
122
122
  description: ''
123
123
  email: dimitrij@blacksquaremedia.com
124
124
  executables: []
@@ -149,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
- version: 1.8.7
152
+ version: 1.9.2
153
153
  required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  none: false
155
155
  requirements:
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: 1.3.6
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 1.8.11
161
+ rubygems_version: 1.8.10
162
162
  signing_key:
163
163
  specification_version: 3
164
164
  summary: BSM's internal SSO client