kms_rails 0.0.6 → 0.0.7
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 +4 -4
- data/lib/kms_rails/active_record.rb +4 -5
- data/lib/kms_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50c4a8fae51504007b10aea9578510462d5f7f76
|
4
|
+
data.tar.gz: 5971526c22870da12221eb826288e25faf5bbe9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 238577ab4e0907ab2058cca53c889035712ebeb7f66db77f93d589704a3c5d5a26362532a94303e396da49bbf8fce099c51c356216b4ee1c10f955a25ad934f0
|
7
|
+
data.tar.gz: a5f006982114e6c15240f6a623403a5e2fe926c011f50c9820839b87c3fe70522a394bd5769132b972ce2ebe37b51032131f00c06e25ec34e016952fad9afcd7
|
@@ -26,10 +26,10 @@ module KmsRails
|
|
26
26
|
return
|
27
27
|
end
|
28
28
|
|
29
|
+
set_retained(field, data) if retain
|
29
30
|
data = data.to_msgpack if msgpack
|
30
|
-
encrypted_data = enc.encrypt(data)
|
31
31
|
|
32
|
-
|
32
|
+
encrypted_data = enc.encrypt(data)
|
33
33
|
data = nil
|
34
34
|
|
35
35
|
store_hash(field, encrypted_data)
|
@@ -44,7 +44,6 @@ module KmsRails
|
|
44
44
|
return nil unless hash
|
45
45
|
|
46
46
|
if retain && (plaintext = get_retained(field))
|
47
|
-
plaintext = MessagePack.unpack(plaintext) if msgpack
|
48
47
|
plaintext
|
49
48
|
else
|
50
49
|
plaintext = enc.decrypt(hash)
|
@@ -80,7 +79,7 @@ module KmsRails
|
|
80
79
|
@_retained ||= {}
|
81
80
|
|
82
81
|
if @_retained[field]
|
83
|
-
Core.shred_string(@_retained[field])
|
82
|
+
Core.shred_string(@_retained[field]) if @_retained[field].class == String
|
84
83
|
@_retained[field] = nil
|
85
84
|
end
|
86
85
|
|
@@ -90,7 +89,7 @@ module KmsRails
|
|
90
89
|
def clear_retained(field)
|
91
90
|
@_retained ||= {}
|
92
91
|
return if !@_retained.include?(field) || @_retained[field].nil?
|
93
|
-
Core.shred_string(@_retained[field])
|
92
|
+
Core.shred_string(@_retained[field]) if @_retained[field].class == String
|
94
93
|
@_retained[field] = nil
|
95
94
|
end
|
96
95
|
end
|
data/lib/kms_rails/version.rb
CHANGED