go_secure 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/go_secure.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1a6dc8c4d4b26c2ac18476a04b34cf0b3ce2ceb
|
4
|
+
data.tar.gz: 28d7f549d81126dee775fa8cca46354ac8dd43fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a50eb37028ef72bc809e34b3d6f98ec52cc3500fe1da0ff1dcf77a1d523cc6f31a4866bb6395664d15d97bc65d410ef5730237f6fa91c8fbd89e6dbe682a4f
|
7
|
+
data.tar.gz: 21d9d814e6c30f52a0646f79aa7742a789fcada13c87ef8395acc0043bc07e7693a995de3a78a225606fcd5ae7d140b4b23710b3832c56aa25f06595d02fc968
|
data/lib/go_secure.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'openssl'
|
2
2
|
require 'base64'
|
3
|
+
require 'oj'
|
3
4
|
|
4
5
|
module GoSecure
|
5
6
|
def self.sha512(str, salt, encryption_key=nil)
|
@@ -134,15 +135,15 @@ module GoSecure
|
|
134
135
|
def self.load(str)
|
135
136
|
return nil unless str
|
136
137
|
if str.match(/^\*\*/)
|
137
|
-
|
138
|
+
Oj.load(str[2..-1])
|
138
139
|
else
|
139
140
|
salt, secret = str.split(/--/, 2)
|
140
|
-
|
141
|
+
Oj.load(GoSecure.decrypt(secret, salt, "secure_json"))
|
141
142
|
end
|
142
143
|
end
|
143
144
|
|
144
145
|
def self.dump(obj)
|
145
|
-
json =
|
146
|
+
json = Oj.dump(obj, mode: :compat)
|
146
147
|
res = encrypted_dump(json)
|
147
148
|
res
|
148
149
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_secure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Whitmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|