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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dfe0f7c2161415227cf683ae6c01eaec3b4c24356a0d30a432a22496de10419
4
- data.tar.gz: dd942c7df38f70c0c92198382a96416e50b58bca364c40245cd0db9fc189b4ef
3
+ metadata.gz: a9be24f058ca3ba9ce75b21d49af505eb2bd1dbfc40b2bfc1841bcce1c02e100
4
+ data.tar.gz: 1ee920f5d61b7fee7d049e0849a3fee48b3d926a141d16c4fe7ce58171b60fe3
5
5
  SHA512:
6
- metadata.gz: 9a2a87e92a736a141ce78251ffa90f1d00ede4630541aca87188a595913f4279083a61465c9a49489c0e3aab9e53981567ba32d3d5d645dfdd6a6d93bcc5df88
7
- data.tar.gz: 0faa213105f681e07078b94e3472563b3718a144ac0ad7ba7c39673f3cca2815f9200ce13f27d87f469ab3c132eb09a025058cf589adc9d8fcad62eb943b0c3b
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['rack.session'])
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['rack.session'] ||= _load_session
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
@@ -4,7 +4,7 @@ class Roda
4
4
  RodaMajorVersion = 3
5
5
 
6
6
  # The minor version of Roda, updated for new feature releases of Roda.
7
- RodaMinorVersion = 97
7
+ RodaMinorVersion = 98
8
8
 
9
9
  # The patch version of Roda, updated only for bug fixes from the last
10
10
  # feature release.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.97.0
4
+ version: 3.98.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans