waylon-core 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/waylon/cache.rb +4 -0
- data/lib/waylon/storage.rb +8 -0
- data/lib/waylon/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: 932e166cc8b43333b52643aa789415cc88d59441464e7eb0108ca1443f6ef48a
|
4
|
+
data.tar.gz: 517dc8256389a54b3f745a6db0da5f9a957f993dc96cbca8fe93bde0ed2e22a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a8132248f4128a44e0a1133846fe2afa134665f8e7df48feb5b1dba550cbffb68abf4778930d0e7d0dc657cd386a82fc32d0e9f4201fd1e28063efbd90d4719
|
7
|
+
data.tar.gz: 2ff90e41205b721a08d862100e7beefd1375450a61fc35af28c221d04580b6534a8104e0923ddf21a362332477834cece2d3a3a793d631c374860b6718184df5
|
data/Gemfile.lock
CHANGED
data/lib/waylon/cache.rb
CHANGED
data/lib/waylon/storage.rb
CHANGED
@@ -8,6 +8,10 @@ module Waylon
|
|
8
8
|
url: "redis://#{ENV.fetch("REDIS", "localhost:6379")}/2"
|
9
9
|
)
|
10
10
|
|
11
|
+
def self.adapter
|
12
|
+
storage.adapter
|
13
|
+
end
|
14
|
+
|
11
15
|
def self.cipher
|
12
16
|
key_bytes = RbNaCl::Hash.sha256(encryption_key)[0..31]
|
13
17
|
RbNaCl::SimpleBox.from_secret_key(key_bytes)
|
@@ -21,6 +25,10 @@ module Waylon
|
|
21
25
|
storage.delete(key)
|
22
26
|
end
|
23
27
|
|
28
|
+
def self.each_key(&block)
|
29
|
+
storage.each_key(&block)
|
30
|
+
end
|
31
|
+
|
24
32
|
def self.encryption_key
|
25
33
|
ENV.fetch("ENCRYPTION_KEY", "thisisVeryUnsafe4U")
|
26
34
|
end
|
data/lib/waylon/version.rb
CHANGED