warden_cookie_session 0.1.0.18828 → 0.1.1.18842

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
  SHA256:
3
- metadata.gz: af6297217cd33e99f23c2466f48783b7e25b979f997837d2126a3fe7152bfe47
4
- data.tar.gz: 8a94b23b1b302d3ea6446138abbaa95e2420c98bdcd09b63d20389fab553b1e3
3
+ metadata.gz: e5a1221c67bfb789c37892d3127bd8ff3942b605a7f037c0d9c438558aa596da
4
+ data.tar.gz: f225566200e1ab67ea3b83865641f06ca6bb28c0c5e07eb0766aefd1b090e258
5
5
  SHA512:
6
- metadata.gz: 7c9f0cd9d73fd2550ca9c663e32a54fd72dd46b86974e0d61dd100fa6cc8d89964e153d83b400a22ef022c07d8cf5f4ff207df88dc167610d55e4f89518833cc
7
- data.tar.gz: dd7c96a623b4be536092b086594eec6b3011f414aff99010c537c031fceff015c3fb141c51a32931181393f7d3706765529c65dd5619ad71df7d046a0da0af2d
6
+ metadata.gz: cf5d97661eaf836a98aafd00f236e5458eef111b96670228b8b024bbaac7c22753c746875437f07d65235cd3d6476bdc35b441a9c76238b15a30fc25cd19863a
7
+ data.tar.gz: b3682c5c960d3d9a35191d45777b55763e5fd331a6a7c3b0aa45791537d5f813c54d348da41658f084b34f94b8a9580647c8571cc750c3da561d3c50155c0464
@@ -0,0 +1,26 @@
1
+ module Warden
2
+ module CookieSession
3
+ class DefaultWrapper
4
+
5
+ def initialize(klass = nil)
6
+ @klass = klass
7
+ end
8
+
9
+ def serialize_record(record)
10
+ # like in https://github.com/plataformatec/devise/blob/master/lib/devise/models/authenticatable.rb
11
+ [record.to_key, record.authenticatable_salt]
12
+ end
13
+
14
+ def fetch_record(key)
15
+ @klass.find(key.first)
16
+ end
17
+
18
+ def validate_record(record, salt)
19
+ # like in https://github.com/plataformatec/devise/blob/master/lib/devise/models/authenticatable.rb
20
+ record if record && record.authenticatable_salt == salt
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+
@@ -1,7 +1,7 @@
1
1
  module Warden
2
2
  module CookieSession
3
3
 
4
- VERSION = '0.1.0'.freeze
4
+ VERSION = '0.1.1'.freeze
5
5
 
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden_cookie_session
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.18828
4
+ version: 0.1.1.18842
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoilenko Yuri
@@ -125,6 +125,7 @@ files:
125
125
  - README.md
126
126
  - lib/warden/cookie_session.rb
127
127
  - lib/warden/cookie_session/configuration.rb
128
+ - lib/warden/cookie_session/default_wrapper.rb
128
129
  - lib/warden/cookie_session/encrypted_cookie.rb
129
130
  - lib/warden/cookie_session/strategy.rb
130
131
  - lib/warden/cookie_session/version.rb