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 +4 -4
- data/lib/warden/cookie_session/default_wrapper.rb +26 -0
- data/lib/warden/cookie_session/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5a1221c67bfb789c37892d3127bd8ff3942b605a7f037c0d9c438558aa596da
|
4
|
+
data.tar.gz: f225566200e1ab67ea3b83865641f06ca6bb28c0c5e07eb0766aefd1b090e258
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
|
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.
|
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
|