activerecord-session_store 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3618fed7f080158309e682f1906af4d056b65fdbf687c7f562677cecaf17d05
4
- data.tar.gz: 314cfae6877c80c6d73512f082765f083b733fcb5eb532b490b89033f37fd3aa
3
+ metadata.gz: a59c796a95093cdbf0b0239be6b391e6319aa15892c5eaa88a4f0cd21f71f730
4
+ data.tar.gz: 512857df11dfe09153779282bc6924ba09e5052cc027bfcdc49911cf448eaa57
5
5
  SHA512:
6
- metadata.gz: cd976a3e033d38632598f9ab5f47eee88c9e72fd624c470f385976361eba83b58e9b0e44241a7ce994f76b79ed3b71f142ce0d6547b10a04d5af4ed75812596d
7
- data.tar.gz: 273a6fbec6eb0a9426d66963ee8008f91281a454fa8722d52a1f1179c1f39c68bf6a37e25ecd5db2c2031a8f344c5375121d52c8fc02fb3595654b1015057178
6
+ metadata.gz: c14348425cf37d14be0562e9c0c60b77d4279a77daa5edd1482cff8cf4757757c923dd8740a8779abc0401bfd3b761a46da541a50771c558cfd8836e4b25daf5
7
+ data.tar.gz: f9357eb83b033c69010cc36fae85e5cd72db780562749aa9512aa78d7440f32666bf6c260e12177bd07c813eb8a8049478e391d0476c29c0d7956f21f99989e2
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 2.2.0
2
+
3
+ * Drop dependency on `multi_json`.
data/README.md CHANGED
@@ -38,7 +38,7 @@ been updated in the last 30 days. The 30 days cutoff can be changed using the
38
38
  Configuration
39
39
  --------------
40
40
 
41
- The default assumes a `sessions` tables with columns:
41
+ The default assumes a `sessions` table with columns:
42
42
 
43
43
  * `id` (numeric primary key),
44
44
  * `session_id` (string, usually varchar; maximum length is 255), and
@@ -79,7 +79,7 @@ for free if you add `created_at` and `updated_at` datetime columns to
79
79
  the `sessions` table, making periodic session expiration a snap.
80
80
 
81
81
  You may provide your own session class implementation, whether a
82
- feature-packed Active Record or a bare-metal high-performance SQL
82
+ feature-packed Active Record, or a bare-metal high-performance SQL
83
83
  store, by setting
84
84
 
85
85
  ```ruby
@@ -99,17 +99,23 @@ The example SqlBypass class is a generic SQL session store. You may
99
99
  use it as a basis for high-performance database-specific stores.
100
100
 
101
101
  Please note that you will need to manually include the silencer module to your
102
- custom logger if you are using a logger other than `Logger` and `Syslog::Logger`
103
- and their subclasses:
102
+ custom logger if you are using a logger other than `ActiveSupport::Logger` and
103
+ its subclasses:
104
104
 
105
105
  ```ruby
106
- MyLogger.send :include, ActiveRecord::SessionStore::Extension::LoggerSilencer
106
+ MyLogger.include ActiveSupport::LoggerSilence
107
+ ```
108
+
109
+ Or if you are using Rails 5.2 or older:
110
+
111
+ ```ruby
112
+ MyLogger.include ::LoggerSilence
107
113
  ```
108
114
 
109
115
  This silencer is being used to silence the logger and not leaking private
110
116
  information into the log, and it is required for security reason.
111
117
 
112
- CVE-2015-9284 mitigation
118
+ CVE-2019-25025 mitigation
113
119
  --------------
114
120
 
115
121
  Sessions that were created by Active Record Session Store version 1.x are
@@ -55,7 +55,7 @@ module ActionDispatch
55
55
  class ActiveRecordStore < ActionDispatch::Session::AbstractSecureStore
56
56
  # The class used for session storage. Defaults to
57
57
  # ActiveRecord::SessionStore::Session
58
- cattr_accessor :session_class
58
+ class_attribute :session_class
59
59
 
60
60
  SESSION_RECORD_KEY = 'rack.session.record'
61
61
  ENV_SESSION_OPTIONS_KEY = Rack::RACK_SESSION_OPTIONS
@@ -67,7 +67,7 @@ module ActionDispatch
67
67
  # If the sid was nil or if there is no pre-existing session under the sid,
68
68
  # force the generation of a new sid and associate a new session associated with the new sid
69
69
  sid = generate_sid
70
- session = @@session_class.new(:session_id => sid.private_id, :data => {})
70
+ session = session_class.new(:session_id => sid.private_id, :data => {})
71
71
  end
72
72
  request.env[SESSION_RECORD_KEY] = session
73
73
  [sid, session.data]
@@ -106,7 +106,7 @@ module ActionDispatch
106
106
  new_sid = generate_sid
107
107
 
108
108
  if options[:renew]
109
- new_model = @@session_class.new(:session_id => new_sid.private_id, :data => data)
109
+ new_model = session_class.new(:session_id => new_sid.private_id, :data => data)
110
110
  new_model.save
111
111
  request.env[SESSION_RECORD_KEY] = new_model
112
112
  end
@@ -120,7 +120,7 @@ module ActionDispatch
120
120
  model = get_session_with_fallback(id)
121
121
  unless model
122
122
  id = generate_sid
123
- model = @@session_class.new(:session_id => id.private_id, :data => {})
123
+ model = session_class.new(:session_id => id.private_id, :data => {})
124
124
  model.save
125
125
  end
126
126
  if request.env[ENV_SESSION_OPTIONS_KEY][:id].nil?
@@ -134,9 +134,9 @@ module ActionDispatch
134
134
 
135
135
  def get_session_with_fallback(sid)
136
136
  if sid && !self.class.private_session_id?(sid.public_id)
137
- if (secure_session = @@session_class.find_by_session_id(sid.private_id))
137
+ if (secure_session = session_class.find_by_session_id(sid.private_id))
138
138
  secure_session
139
- elsif (insecure_session = @@session_class.find_by_session_id(sid.public_id))
139
+ elsif (insecure_session = session_class.find_by_session_id(sid.public_id))
140
140
  insecure_session.session_id = sid.private_id # this causes the session to be secured
141
141
  insecure_session
142
142
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module SessionStore
3
- VERSION = "2.0.0".freeze
3
+ VERSION = "2.2.0".freeze
4
4
  end
5
5
  end
@@ -2,7 +2,7 @@ require 'active_record'
2
2
  require 'active_record/session_store/version'
3
3
  require 'action_dispatch/session/active_record_store'
4
4
  require 'active_support/core_ext/hash/keys'
5
- require 'multi_json'
5
+ require 'json'
6
6
 
7
7
  module ActiveRecord
8
8
  module SessionStore
@@ -62,12 +62,12 @@ module ActiveRecord
62
62
  # Uses built-in JSON library to encode/decode session
63
63
  class JsonSerializer
64
64
  def self.load(value)
65
- hash = MultiJson.load(value)
65
+ hash = JSON.parse(value)
66
66
  hash.is_a?(Hash) ? hash.with_indifferent_access[:value] : hash
67
67
  end
68
68
 
69
69
  def self.dump(value)
70
- MultiJson.dump(value: value)
70
+ JSON.dump(value: value)
71
71
  end
72
72
  end
73
73
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-session_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
10
+ date: 2025-03-26 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -16,42 +15,42 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 5.2.4.1
18
+ version: '7.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 5.2.4.1
25
+ version: '7.0'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: actionpack
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: 5.2.4.1
32
+ version: '7.0'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: 5.2.4.1
39
+ version: '7.0'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: railties
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
46
45
  - !ruby/object:Gem::Version
47
- version: 5.2.4.1
46
+ version: '7.0'
48
47
  type: :runtime
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - ">="
53
52
  - !ruby/object:Gem::Version
54
- version: 5.2.4.1
53
+ version: '7.0'
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: rack
57
56
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +60,7 @@ dependencies:
61
60
  version: 2.0.8
62
61
  - - "<"
63
62
  - !ruby/object:Gem::Version
64
- version: '3'
63
+ version: '4'
65
64
  type: :runtime
66
65
  prerelease: false
67
66
  version_requirements: !ruby/object:Gem::Requirement
@@ -71,48 +70,28 @@ dependencies:
71
70
  version: 2.0.8
72
71
  - - "<"
73
72
  - !ruby/object:Gem::Version
74
- version: '3'
73
+ version: '4'
75
74
  - !ruby/object:Gem::Dependency
76
- name: multi_json
75
+ name: cgi
77
76
  requirement: !ruby/object:Gem::Requirement
78
77
  requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.11'
82
78
  - - ">="
83
79
  - !ruby/object:Gem::Version
84
- version: 1.11.2
80
+ version: 0.3.6
85
81
  type: :runtime
86
82
  prerelease: false
87
- version_requirements: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: '1.11'
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: 1.11.2
95
- - !ruby/object:Gem::Dependency
96
- name: sqlite3
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :development
103
- prerelease: false
104
83
  version_requirements: !ruby/object:Gem::Requirement
105
84
  requirements:
106
85
  - - ">="
107
86
  - !ruby/object:Gem::Version
108
- version: '0'
109
- description:
87
+ version: 0.3.6
110
88
  email: david@loudthinking.com
111
89
  executables: []
112
90
  extensions: []
113
91
  extra_rdoc_files:
114
92
  - README.md
115
93
  files:
94
+ - CHANGELOG.md
116
95
  - MIT-LICENSE
117
96
  - README.md
118
97
  - lib/action_dispatch/session/active_record_store.rb
@@ -128,8 +107,10 @@ files:
128
107
  homepage: https://github.com/rails/activerecord-session_store
129
108
  licenses:
130
109
  - MIT
131
- metadata: {}
132
- post_install_message:
110
+ metadata:
111
+ homepage_uri: https://github.com/rails/activerecord-session_store
112
+ source_code_uri: https://github.com/rails/activerecord-session_store
113
+ changelog_uri: https://github.com/rails/activerecord-session_store/blob/master/CHANGELOG.md
133
114
  rdoc_options:
134
115
  - "--main"
135
116
  - README.md
@@ -139,15 +120,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
120
  requirements:
140
121
  - - ">="
141
122
  - !ruby/object:Gem::Version
142
- version: 2.2.2
123
+ version: 2.5.0
143
124
  required_rubygems_version: !ruby/object:Gem::Requirement
144
125
  requirements:
145
126
  - - ">="
146
127
  - !ruby/object:Gem::Version
147
128
  version: '0'
148
129
  requirements: []
149
- rubygems_version: 3.1.4
150
- signing_key:
130
+ rubygems_version: 3.6.2
151
131
  specification_version: 4
152
132
  summary: An Action Dispatch session store backed by an Active Record class.
153
133
  test_files: []