roda 3.97.0 → 3.98.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 +4 -4
- data/lib/roda/plugins/sessions.rb +5 -3
- data/lib/roda/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9be24f058ca3ba9ce75b21d49af505eb2bd1dbfc40b2bfc1841bcce1c02e100
|
|
4
|
+
data.tar.gz: 1ee920f5d61b7fee7d049e0849a3fee48b3d926a141d16c4fe7ce58171b60fe3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a1d64641747146ee096ecc99cb2407b75d0f1182cb732a174721354248a762a4bb362a4fb19337725430941da079c87944b16d7cc1f72f8a5aa072eae3abdad
|
|
7
|
+
data.tar.gz: d5e8e3f3b720c33c41cd17d953b96851abe6032974e665856aa5896e2b1c6d436eb67372464ce4f44e30eb471e512bfa7c692d7cfaac31944d8bfed60eb72bbd
|
|
@@ -65,6 +65,8 @@ class Roda
|
|
|
65
65
|
# that. If the +:secure+ option is not present in the hash, then
|
|
66
66
|
# <tt>secure: true</tt> is also set if the request is made over HTTPS. If this option is
|
|
67
67
|
# given, it will be merged into the default cookie options.
|
|
68
|
+
# :env_key :: The key in `env` where the session should be located. Defaults to <tt>"rack.session"</tt>, the
|
|
69
|
+
# default key for sessions in Rack.
|
|
68
70
|
# :gzip_over :: For session data over this many bytes, compress it with the deflate algorithm (default: nil,
|
|
69
71
|
# so never compress). Note that compression should not be enabled if you are storing data in
|
|
70
72
|
# the session derived from user input and also storing sensitive data in the session.
|
|
@@ -148,7 +150,7 @@ class Roda
|
|
|
148
150
|
# deflate compression, this contains the deflate compressed data.
|
|
149
151
|
module Sessions
|
|
150
152
|
DEFAULT_COOKIE_OPTIONS = {:httponly=>true, :path=>'/'.freeze, :same_site=>:lax}.freeze
|
|
151
|
-
DEFAULT_OPTIONS = {:key => 'roda.session'.freeze, :max_seconds=>86400*30, :max_idle_seconds=>86400*7, :pad_size=>32, :gzip_over=>nil, :skip_within=>3600}.freeze
|
|
153
|
+
DEFAULT_OPTIONS = {:key => 'roda.session'.freeze, :max_seconds=>86400*30, :max_idle_seconds=>86400*7, :pad_size=>32, :gzip_over=>nil, :skip_within=>3600, :env_key=>'rack.session'}.freeze
|
|
152
154
|
DEFLATE_BIT = 0x1000
|
|
153
155
|
PADDING_MASK = 0x0fff
|
|
154
156
|
SESSION_CREATED_AT = 'roda.session.created_at'.freeze
|
|
@@ -226,7 +228,7 @@ class Roda
|
|
|
226
228
|
# update the rack response headers to set the session cookie in
|
|
227
229
|
# the response.
|
|
228
230
|
def _roda_after_50__sessions(res)
|
|
229
|
-
if res && (session = env[
|
|
231
|
+
if res && (session = env[self.class.opts[:sessions][:env_key]])
|
|
230
232
|
@_request.persist_session(res[1], session)
|
|
231
233
|
end
|
|
232
234
|
end
|
|
@@ -240,7 +242,7 @@ class Roda
|
|
|
240
242
|
# this method stores the session in 'rack.session' in the request environment,
|
|
241
243
|
# but that does not happen until this method is called.
|
|
242
244
|
def session
|
|
243
|
-
@env[
|
|
245
|
+
@env[roda_class.opts[:sessions][:env_key]] ||= _load_session
|
|
244
246
|
end
|
|
245
247
|
|
|
246
248
|
# The time the session was originally created. nil if there is no active session.
|
data/lib/roda/version.rb
CHANGED