kms_encrypted 1.0.1 → 1.1.0

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: edd8de63fd58086fa749186d51d6a99cd4343600c8f50827fbb019f1ec2d9788
4
- data.tar.gz: 7f91126392f0ad2e0a4c8d48d1a2f3c3fe7fc257a4eaef2bf526acf1badb491d
3
+ metadata.gz: 7137f301bae6ecaa8ae8b7dd9947a2bd3aee5e3c92c918b397b5d28dfdbc0cbb
4
+ data.tar.gz: c0a094bc32726cdb89978a94390e2e2f4be47e320cea622865fae07f8ac658ff
5
5
  SHA512:
6
- metadata.gz: 7e83a606cd2b3cacf47854a7425245b163bcdd267a07a501d0344cad3fe98513fbafed99ed6096f53dade5aa8c36be267766293d7639525159c0be3b635e90c3
7
- data.tar.gz: 9649c83297b1562e973f83cfcc1b67541f0e08ae2ef05cc6decaef661bd7b9f65b32ea3f35ac2faf8d6c7c10c1110e92e3760cdc8792c98734135abd4f3a882c
6
+ metadata.gz: b4b6835f1401450167af387e5d89fee3079f699442d5960a4d78fdd8686b801d39f50ca00c11cb553050c69f441ea26915a1d98ecb28345950e0be091ce90386
7
+ data.tar.gz: 7423c9b750c0821408993e3bd9f69c188350f99eecbf3d9a1d87c038d5591e8755791f397609c7898cd2d2fce022a38b486aac78b5fc062ae76096f217678fd9
@@ -1,3 +1,8 @@
1
+ ## 1.1.0
2
+
3
+ - Added support for Lockbox
4
+ - Dropped support for Rails 4.2
5
+
1
6
  ## 1.0.1
2
7
 
3
8
  - Added support for encryption and decryption outside models
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # KMS Encrypted
2
2
 
3
- Simple, secure key management for [attr_encrypted](https://github.com/attr-encrypted/attr_encrypted)
3
+ Simple, secure key management for [Lockbox](https://github.com/ankane/lockbox) and [attr_encrypted](https://github.com/attr-encrypted/attr_encrypted)
4
4
 
5
5
  With KMS Encrypted:
6
6
 
@@ -109,10 +109,25 @@ module KmsEncrypted
109
109
  define_method("rotate_#{key_method}!") do
110
110
  # decrypt
111
111
  plaintext_attributes = {}
112
- self.class.encrypted_attributes.select { |_, v| v[:key] == key_method.to_sym }.keys.each do |key|
113
- plaintext_attributes[key] = send(key)
112
+
113
+ # attr_encrypted
114
+ if self.class.respond_to?(:encrypted_attributes)
115
+ self.class.encrypted_attributes.select { |_, v| v[:key] == key_method.to_sym }.keys.each do |key|
116
+ plaintext_attributes[key] = send(key)
117
+ end
118
+ end
119
+
120
+ # lockbox attributes
121
+ if self.class.respond_to?(:lockbox_attributes)
122
+ self.class.lockbox_attributes.select { |_, v| v[:key] == key_method.to_sym }.keys.each do |key|
123
+ plaintext_attributes[key] = send(key)
124
+ end
114
125
  end
115
126
 
127
+ # TODO lockbox attachments
128
+ # if self.class.respond_to?(:lockbox_attachments)
129
+ # end
130
+
116
131
  # reset key
117
132
  instance_variable_set("@#{key_method}", nil)
118
133
  send("encrypted_#{key_method}=", nil)
@@ -1,3 +1,3 @@
1
1
  module KmsEncrypted
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kms_encrypted
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-21 00:00:00.000000000 Z
11
+ date: 2019-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.2'
26
+ version: '5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: lockbox
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0.2'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0.2'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: aws-sdk-kms
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -183,16 +197,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
197
  requirements:
184
198
  - - ">="
185
199
  - !ruby/object:Gem::Version
186
- version: '2.2'
200
+ version: '2.4'
187
201
  required_rubygems_version: !ruby/object:Gem::Requirement
188
202
  requirements:
189
203
  - - ">="
190
204
  - !ruby/object:Gem::Version
191
205
  version: '0'
192
206
  requirements: []
193
- rubyforge_project:
194
- rubygems_version: 2.7.6
207
+ rubygems_version: 3.0.4
195
208
  signing_key:
196
209
  specification_version: 4
197
- summary: Simple, secure key management for attr_encrypted
210
+ summary: Simple, secure key management for Lockbox and attr_encrypted
198
211
  test_files: []