josso-client 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/config/{josso_config.yml → josso_client.yml} +3 -1
- data/lib/josso-client.rb +11 -3
- metadata +4 -6
@@ -1,10 +1,12 @@
|
|
1
|
-
## YAML Template.
|
2
1
|
development:
|
3
2
|
josso_root: http://www.yourjossoserver.com/josso/
|
4
3
|
partner_application_entry_url: http://localhost:3000
|
4
|
+
session_timer: 1800
|
5
5
|
test:
|
6
6
|
josso_root: http://www.yourjossoserver.com/josso/
|
7
7
|
partner_application_entry_url: http://localhost:3000
|
8
|
+
session_timer: 1800
|
8
9
|
production:
|
9
10
|
josso_root: http://www.yourjossoserver.com/josso/
|
10
11
|
partner_application_entry_url: http://localhost:3000
|
12
|
+
session_timer: 1800
|
data/lib/josso-client.rb
CHANGED
@@ -8,8 +8,8 @@ module Main
|
|
8
8
|
#
|
9
9
|
# test for override config file
|
10
10
|
#
|
11
|
-
if File.exist?(RAILS_ROOT + '/config/
|
12
|
-
self.APP_CONFIG = YAML.load_file(RAILS_ROOT + '/config/
|
11
|
+
if File.exist?(RAILS_ROOT + '/config/josso_client.yml')
|
12
|
+
self.APP_CONFIG = YAML.load_file(RAILS_ROOT + '/config/josso_client.yml')[RAILS_ENV]
|
13
13
|
else
|
14
14
|
self.APP_CONFIG = YAML.load_file(File.join(File.dirname(__FILE__), '../config/josso_config.yml'))[RAILS_ENV]
|
15
15
|
end
|
@@ -85,7 +85,15 @@ module Main
|
|
85
85
|
# Judge the expiry of the session
|
86
86
|
def is_josso_session_expire(partner_application_entry_url)
|
87
87
|
begin
|
88
|
-
|
88
|
+
#
|
89
|
+
# no expiration if set to zero
|
90
|
+
#
|
91
|
+
if self.APP_CONFIG['session_timer'] == 0
|
92
|
+
session[:session_timer_at] = Time.now.to_i
|
93
|
+
return
|
94
|
+
end
|
95
|
+
|
96
|
+
if(((Time.now.to_i - session[:session_timer_at].to_i) > self.APP_CONFIG['session_timer']))
|
89
97
|
logout()
|
90
98
|
else
|
91
99
|
session[:session_timer_at] = Time.now.to_i
|
metadata
CHANGED
@@ -5,17 +5,16 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Peter Peterson
|
13
|
-
- Handy Wang
|
14
13
|
autorequire:
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-10-
|
17
|
+
date: 2010-10-20 00:00:00 -06:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -36,7 +35,6 @@ dependencies:
|
|
36
35
|
description: JOSSO client for Rails.
|
37
36
|
email:
|
38
37
|
- peter@saborgato.com
|
39
|
-
- nnnwjs@gmail.com
|
40
38
|
executables: []
|
41
39
|
|
42
40
|
extensions: []
|
@@ -58,7 +56,7 @@ files:
|
|
58
56
|
- lib/bak_sso_identity_provider.rb
|
59
57
|
- test/josso_cllient_test.rb
|
60
58
|
- rails/init.rb
|
61
|
-
- config/
|
59
|
+
- config/josso_client.yml
|
62
60
|
has_rdoc: true
|
63
61
|
homepage: http://engineersatlarge.com
|
64
62
|
licenses: []
|