encrypted_cookie_store-instructure 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{encrypted_cookie_store-instructure}
3
- s.version = "1.0.4"
3
+ s.version = "1.0.5"
4
4
 
5
- s.authors = ["Cody Cutrer", "Jacob Fugal"]
6
- s.date = %q{2013-05-02}
5
+ s.authors = ["Cody Cutrer", "Jacob Fugal", "James Williams"]
6
+ s.date = %q{2013-12-20}
7
7
  s.extra_rdoc_files = [
8
8
  "LICENSE.txt"
9
9
  ]
@@ -4,6 +4,8 @@ require 'zlib'
4
4
  class EncryptedCookieStore < ActionController::Session::CookieStore
5
5
  OpenSSLCipherError = OpenSSL::Cipher.const_defined?(:CipherError) ? OpenSSL::Cipher::CipherError : OpenSSL::CipherError
6
6
 
7
+ EXPIRE_AFTER_KEY = "encrypted_cookie_store.session_expire_after"
8
+
7
9
  class << self
8
10
  attr_accessor :data_cipher_type
9
11
  end
@@ -23,6 +25,7 @@ class EncryptedCookieStore < ActionController::Session::CookieStore
23
25
  end
24
26
 
25
27
  def call(env)
28
+ @options[:expire_after] = env[EXPIRE_AFTER_KEY] || @options[:expire_after]
26
29
  prepare!(env)
27
30
 
28
31
  old_session_data, raw_old_session_data, old_timestamp = all_unpacked_cookie_data(env)
@@ -36,7 +39,8 @@ class EncryptedCookieStore < ActionController::Session::CookieStore
36
39
  options = env[ENV_SESSION_OPTIONS_KEY]
37
40
  request = ActionController::Request.new(env)
38
41
 
39
- @options[:expire_after] = options[:expire_after] || @options[:expire_after]
42
+ @options[:expire_after] = env[EXPIRE_AFTER_KEY] || options[:expire_after] || @options[:expire_after]
43
+ options[:expire_after] = @options[:expire_after]
40
44
 
41
45
  if !(options[:secure] && !request.ssl?) && (!session_data.is_a?(ActionController::Session::AbstractStore::SessionHash) || session_data.loaded? || options[:expire_after])
42
46
  session_data.send(:load!) if session_data.is_a?(ActionController::Session::AbstractStore::SessionHash) && !session_data.loaded?
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encrypted_cookie_store-instructure
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Cody Cutrer
9
9
  - Jacob Fugal
10
+ - James Williams
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2013-05-02 00:00:00.000000000 Z
14
+ date: 2013-12-20 00:00:00.000000000 Z
14
15
  dependencies: []
15
16
  description: A secure version of Rails' built in CookieStore
16
17
  email: