attr_encrypted 3.0.0 → 3.1.0
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
- checksums.yaml.gz.sig +0 -0
- data/.travis.yml +37 -1
- data/CHANGELOG.md +22 -0
- data/README.md +16 -5
- data/Rakefile +1 -0
- data/attr_encrypted.gemspec +6 -1
- data/certs/saghaulor.pem +15 -15
- data/checksum/attr_encrypted-3.0.0.gem.sha256 +1 -0
- data/checksum/attr_encrypted-3.0.0.gem.sha512 +1 -0
- data/checksum/attr_encrypted-3.0.1.gem.sha256 +1 -0
- data/checksum/attr_encrypted-3.0.1.gem.sha512 +1 -0
- data/checksum/attr_encrypted-3.0.2.gem.sha256 +1 -0
- data/checksum/attr_encrypted-3.0.2.gem.sha512 +1 -0
- data/checksum/attr_encrypted-3.0.3.gem.sha256 +1 -0
- data/checksum/attr_encrypted-3.0.3.gem.sha512 +1 -0
- data/lib/attr_encrypted/adapters/active_record.rb +35 -20
- data/lib/attr_encrypted/version.rb +1 -1
- data/lib/attr_encrypted.rb +121 -102
- data/test/active_record_test.rb +76 -49
- data/test/attr_encrypted_test.rb +83 -7
- data/test/compatibility_test.rb +19 -21
- data/test/legacy_active_record_test.rb +7 -9
- data/test/legacy_compatibility_test.rb +13 -15
- data/test/test_helper.rb +7 -0
- data.tar.gz.sig +0 -0
- metadata +40 -32
- metadata.gz.sig +0 -0
|
@@ -4,14 +4,12 @@ require_relative 'test_helper'
|
|
|
4
4
|
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'
|
|
5
5
|
|
|
6
6
|
def create_people_table
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
t.string :salt
|
|
14
|
-
end
|
|
7
|
+
ActiveRecord::Schema.define(:version => 1) do
|
|
8
|
+
create_table :legacy_people do |t|
|
|
9
|
+
t.string :encrypted_email
|
|
10
|
+
t.string :password
|
|
11
|
+
t.string :encrypted_credentials
|
|
12
|
+
t.string :salt
|
|
15
13
|
end
|
|
16
14
|
end
|
|
17
15
|
end
|
|
@@ -52,7 +50,7 @@ end
|
|
|
52
50
|
class LegacyActiveRecordTest < Minitest::Test
|
|
53
51
|
|
|
54
52
|
def setup
|
|
55
|
-
|
|
53
|
+
drop_all_tables
|
|
56
54
|
create_people_table
|
|
57
55
|
end
|
|
58
56
|
|
|
@@ -41,7 +41,7 @@ class LegacyCompatibilityTest < Minitest::Test
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def setup
|
|
44
|
-
|
|
44
|
+
drop_all_tables
|
|
45
45
|
create_tables
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -73,20 +73,18 @@ class LegacyCompatibilityTest < Minitest::Test
|
|
|
73
73
|
private
|
|
74
74
|
|
|
75
75
|
def create_tables
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
t.string :salt
|
|
89
|
-
end
|
|
76
|
+
ActiveRecord::Schema.define(:version => 1) do
|
|
77
|
+
create_table :legacy_nonmarshalling_pets do |t|
|
|
78
|
+
t.string :name
|
|
79
|
+
t.string :encrypted_nickname
|
|
80
|
+
t.string :encrypted_birthdate
|
|
81
|
+
t.string :salt
|
|
82
|
+
end
|
|
83
|
+
create_table :legacy_marshalling_pets do |t|
|
|
84
|
+
t.string :name
|
|
85
|
+
t.string :encrypted_nickname
|
|
86
|
+
t.string :encrypted_birthdate
|
|
87
|
+
t.string :salt
|
|
90
88
|
end
|
|
91
89
|
end
|
|
92
90
|
end
|
data/test/test_helper.rb
CHANGED
|
@@ -27,6 +27,7 @@ require 'active_record'
|
|
|
27
27
|
require 'data_mapper'
|
|
28
28
|
require 'digest/sha2'
|
|
29
29
|
require 'sequel'
|
|
30
|
+
ActiveSupport::Deprecation.behavior = :raise
|
|
30
31
|
|
|
31
32
|
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
32
33
|
$:.unshift(File.dirname(__FILE__))
|
|
@@ -49,3 +50,9 @@ SECRET_KEY = SecureRandom.random_bytes(32)
|
|
|
49
50
|
def base64_encoding_regex
|
|
50
51
|
/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$/
|
|
51
52
|
end
|
|
53
|
+
|
|
54
|
+
def drop_all_tables
|
|
55
|
+
connection = ActiveRecord::Base.connection
|
|
56
|
+
tables = (ActiveRecord::VERSION::MAJOR >= 5 ? connection.data_sources : connection.tables)
|
|
57
|
+
tables.each { |table| ActiveRecord::Base.connection.drop_table(table) }
|
|
58
|
+
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: attr_encrypted
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sean Huber
|
|
@@ -15,25 +15,25 @@ cert_chain:
|
|
|
15
15
|
-----BEGIN CERTIFICATE-----
|
|
16
16
|
MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAlzYWdo
|
|
17
17
|
YXVsb3IxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
|
18
|
-
|
|
18
|
+
bTAeFw0xODAyMTIwMzMzMThaFw0xOTAyMTIwMzMzMThaMEAxEjAQBgNVBAMMCXNh
|
|
19
19
|
Z2hhdWxvcjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
|
|
20
|
-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C+xN0eXqakCu6YUJoQzCn/7znv8WxpHEbeZjNIHq0qb
|
|
33
|
+
nbqZ/ZW1bwzj1T/NIbnMr37wqV29XwkI4+LbewMkb6/bDPYl0qZpAkCxKtGYCCJp
|
|
34
|
+
l6KPs9K/72yH00dxuAhiTXikTkcLXeQJ
|
|
35
35
|
-----END CERTIFICATE-----
|
|
36
|
-
date:
|
|
36
|
+
date: 2018-02-11 00:00:00.000000000 Z
|
|
37
37
|
dependencies:
|
|
38
38
|
- !ruby/object:Gem::Dependency
|
|
39
39
|
name: encryptor
|
|
@@ -53,30 +53,30 @@ dependencies:
|
|
|
53
53
|
name: activerecord
|
|
54
54
|
requirement: !ruby/object:Gem::Requirement
|
|
55
55
|
requirements:
|
|
56
|
-
- - "
|
|
56
|
+
- - "~>"
|
|
57
57
|
- !ruby/object:Gem::Version
|
|
58
|
-
version:
|
|
58
|
+
version: 4.1.16
|
|
59
59
|
type: :development
|
|
60
60
|
prerelease: false
|
|
61
61
|
version_requirements: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
|
63
|
-
- - "
|
|
63
|
+
- - "~>"
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
|
-
version:
|
|
65
|
+
version: 4.1.16
|
|
66
66
|
- !ruby/object:Gem::Dependency
|
|
67
67
|
name: actionpack
|
|
68
68
|
requirement: !ruby/object:Gem::Requirement
|
|
69
69
|
requirements:
|
|
70
|
-
- - "
|
|
70
|
+
- - "~>"
|
|
71
71
|
- !ruby/object:Gem::Version
|
|
72
|
-
version:
|
|
72
|
+
version: 4.1.16
|
|
73
73
|
type: :development
|
|
74
74
|
prerelease: false
|
|
75
75
|
version_requirements: !ruby/object:Gem::Requirement
|
|
76
76
|
requirements:
|
|
77
|
-
- - "
|
|
77
|
+
- - "~>"
|
|
78
78
|
- !ruby/object:Gem::Version
|
|
79
|
-
version:
|
|
79
|
+
version: 4.1.16
|
|
80
80
|
- !ruby/object:Gem::Dependency
|
|
81
81
|
name: datamapper
|
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -193,16 +193,16 @@ dependencies:
|
|
|
193
193
|
name: codeclimate-test-reporter
|
|
194
194
|
requirement: !ruby/object:Gem::Requirement
|
|
195
195
|
requirements:
|
|
196
|
-
- - "
|
|
196
|
+
- - "<="
|
|
197
197
|
- !ruby/object:Gem::Version
|
|
198
|
-
version:
|
|
198
|
+
version: 0.6.0
|
|
199
199
|
type: :development
|
|
200
200
|
prerelease: false
|
|
201
201
|
version_requirements: !ruby/object:Gem::Requirement
|
|
202
202
|
requirements:
|
|
203
|
-
- - "
|
|
203
|
+
- - "<="
|
|
204
204
|
- !ruby/object:Gem::Version
|
|
205
|
-
version:
|
|
205
|
+
version: 0.6.0
|
|
206
206
|
description: Generates attr_accessors that encrypt and decrypt attributes transparently
|
|
207
207
|
email:
|
|
208
208
|
- seah@shuber.io
|
|
@@ -222,6 +222,14 @@ files:
|
|
|
222
222
|
- Rakefile
|
|
223
223
|
- attr_encrypted.gemspec
|
|
224
224
|
- certs/saghaulor.pem
|
|
225
|
+
- checksum/attr_encrypted-3.0.0.gem.sha256
|
|
226
|
+
- checksum/attr_encrypted-3.0.0.gem.sha512
|
|
227
|
+
- checksum/attr_encrypted-3.0.1.gem.sha256
|
|
228
|
+
- checksum/attr_encrypted-3.0.1.gem.sha512
|
|
229
|
+
- checksum/attr_encrypted-3.0.2.gem.sha256
|
|
230
|
+
- checksum/attr_encrypted-3.0.2.gem.sha512
|
|
231
|
+
- checksum/attr_encrypted-3.0.3.gem.sha256
|
|
232
|
+
- checksum/attr_encrypted-3.0.3.gem.sha512
|
|
225
233
|
- lib/attr_encrypted.rb
|
|
226
234
|
- lib/attr_encrypted/adapters/active_record.rb
|
|
227
235
|
- lib/attr_encrypted/adapters/data_mapper.rb
|
|
@@ -240,7 +248,8 @@ files:
|
|
|
240
248
|
- test/sequel_test.rb
|
|
241
249
|
- test/test_helper.rb
|
|
242
250
|
homepage: http://github.com/attr-encrypted/attr_encrypted
|
|
243
|
-
licenses:
|
|
251
|
+
licenses:
|
|
252
|
+
- MIT
|
|
244
253
|
metadata: {}
|
|
245
254
|
post_install_message: |2+
|
|
246
255
|
|
|
@@ -274,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
274
283
|
version: '0'
|
|
275
284
|
requirements: []
|
|
276
285
|
rubyforge_project:
|
|
277
|
-
rubygems_version: 2.
|
|
286
|
+
rubygems_version: 2.6.13
|
|
278
287
|
signing_key:
|
|
279
288
|
specification_version: 4
|
|
280
289
|
summary: Encrypt and decrypt attributes
|
|
@@ -291,4 +300,3 @@ test_files:
|
|
|
291
300
|
- test/run.sh
|
|
292
301
|
- test/sequel_test.rb
|
|
293
302
|
- test/test_helper.rb
|
|
294
|
-
has_rdoc: false
|
metadata.gz.sig
CHANGED
|
Binary file
|