rack-cas 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5004b4a1ccc5b68c01f2bef376ffcc2014114197
4
- data.tar.gz: 6a2a2750b1366c6a57dd5da06459801af7061ecc
3
+ metadata.gz: 1cf9f06c6db0201c3d5bcadb8158c390622630cf
4
+ data.tar.gz: 1fc8eb9bbf210d5de67d3e68d4b4f99a0f2118ad
5
5
  SHA512:
6
- metadata.gz: 26c59bbb57b5f10055df087874346ab704c8884edf1a6dd2bc78a0ea32b5b5811d514be1775e0053d644222d1a3ea013e2ec2542a8c3e66b5d5c485dba3b90e6
7
- data.tar.gz: 362b96b671bd4e28695091aee90fe41cd2d0d585176c5c60def3d2979626ef433e3247cfc52a461df7a0ed6c4342cbbd898fb4ffa8bf23b738d1f3b7e0f46bab
6
+ metadata.gz: 253fa6cc882ad0f229f5ae470e422111949bd8255490c9db21f24a491df6d8f234915309b0fe59057ec727e3a15d9759d44bbcfe14455b3cbc4db026536d84f5
7
+ data.tar.gz: 1741c9fe41dc735907fc1a5483687302a9cee328c3787b483e440720d5f5c07f54c9a86589d4e9a2d10a6da6351d1faf1788d09f89da182156590f593f4a77e8
data/README.markdown CHANGED
@@ -20,6 +20,7 @@ Requirements
20
20
  ============
21
21
  * Ruby >= 1.9.2
22
22
  * A working [CAS server](http://rubycas.github.com)
23
+ * An app that [returns a `401 Unauthorized`](#integration) status when authentication is requried
23
24
 
24
25
  Installation
25
26
  ============
@@ -30,7 +30,11 @@ module RackCAS
30
30
  def set_session(env, sid, session_data, options)
31
31
  cas_ticket = (session_data['cas']['ticket'] unless session_data['cas'].nil?)
32
32
 
33
- session = Session.find_or_initialize_by_session_id(sid)
33
+ session = if ActiveRecord.version >= Gem::Version.new('4.0.0')
34
+ Session.where(session_id: sid).first_or_initialize
35
+ else
36
+ Session.find_or_initialize_by_session_id(sid)
37
+ end
34
38
  success = session.update_attributes(data: pack(session_data), cas_ticket: cas_ticket)
35
39
 
36
40
  success ? session.session_id : false
@@ -38,7 +42,7 @@ module RackCAS
38
42
 
39
43
  def destroy_session(env, sid, options)
40
44
  session = Session.where(session_id: sid).delete_all
41
-
45
+
42
46
  options[:drop] ? nil : generate_sid
43
47
  end
44
48
 
@@ -1,3 +1,3 @@
1
1
  module RackCAS
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  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.8.0
4
+ version: 0.8.1
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-07-01 00:00:00.000000000 Z
11
+ date: 2013-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack