cassiopeia 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -7,6 +7,7 @@
7
7
  - Yet another custom CAS client/server implementation. This plugin allows you to perform single-server authorization between two different rails applications.
8
8
 
9
9
  = Changelog:
10
+ - 0.1.3: Removing request after return made optional
10
11
  - 0.1.2: Added some new parameters of request saving to the default configuration.
11
12
  - 0.1.1: Lesser bug with concurrent requests restoring fixed.
12
13
  - 0.1.0: Multiple requests storing implemented. Workarounds for concurrent requests processing applied.
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ PKG_FILES = FileList[ '[a-zA-Z]*', 'lib/**/*' ]
10
10
 
11
11
  spec = Gem::Specification.new do |s|
12
12
  s.name = "cassiopeia"
13
- s.version = "0.1.2"
13
+ s.version = "0.1.3"
14
14
  s.author = "smecsia"
15
15
  s.email = "smecsia@gmail.com"
16
16
  #s.homepage = ""
@@ -11,6 +11,7 @@ module Cassiopeia
11
11
  CAS_UNIQUE_REQ_KEY = Cassiopeia::CONFIG[:rack_unique_req_key]
12
12
  CAS_REQ_EXPIRES_AT_KEY = Cassiopeia::CONFIG[:rack_session_store_expires_at_key]
13
13
  CAS_REQ_TIMEOUT = Cassiopeia::CONFIG[:rack_session_store_timeout]
14
+ CAS_REQ_REMOVE_RETURN = Cassiopeia::CONFIG[:rack_remove_req_after_return]
14
15
 
15
16
  def session(env)
16
17
  env[CAS_RACK_SESSION_KEY]
@@ -20,7 +20,8 @@ module Cassiopeia
20
20
  :rack_session_store => "cas_rack_session",
21
21
  :rack_session_key => "rack.session",
22
22
  :rack_unique_req_key => "cas_req_key",
23
- :rack_session_store_timeout => 1,
23
+ :rack_session_store_timeout => 120,
24
+ :rack_remove_req_after_return => false,
24
25
  :rack_session_store_expires_at_key => "cas_req_expires",
25
26
  :requests_save_enabled => true
26
27
  }
@@ -33,15 +33,18 @@ module Cassiopeia
33
33
  begin
34
34
  key = restore_req_key(env)
35
35
  request = CassiopeiaRequest.find_by_uid(key)
36
- stored_keys = Marshal.load(request.data)
37
- stored_keys.each do |key,value|
38
- if(key.match(CAS_QUERY_STRING_KEY))
39
- add_ticket_id_to_req(env,key,value)
40
- else
41
- env[key] = value
36
+ if request
37
+ stored_keys = Marshal.load(request.data)
38
+ stored_keys.each do |key,value|
39
+ if(key.match(CAS_QUERY_STRING_KEY))
40
+ add_ticket_id_to_req(env,key,value)
41
+ else
42
+ env[key] = value
43
+ end
42
44
  end
43
45
  end
44
- request.delete
46
+ #FIXME: should we delete this request? But what if user press F5 key?
47
+ request.delete if CAS_REQ_REMOVE_RETURN
45
48
  rescue Exception => e
46
49
  raise_missconfiguration(e)
47
50
  end
data/lib/cassiopeia.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
  module Cassiopeia
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  autoload :User, 'cassiopeia/user'
6
6
  autoload :Base, 'cassiopeia/base'
7
7
  autoload :Exception, 'cassiopeia/base'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassiopeia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - smecsia
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-14 00:00:00 +04:00
12
+ date: 2010-04-22 00:00:00 +04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency