attr_encrypted 3.0.1 → 3.0.2

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
  SHA1:
3
- metadata.gz: ac79c02884af5b1ee935a1f50d238f17d72346ff
4
- data.tar.gz: cfdf773acde0d0b7c752f972064237395ba57071
3
+ metadata.gz: 4f35a7b7559ac43fbc20bf110b06c48457195c35
4
+ data.tar.gz: a99c8beb7a082c64d21f123aeb5c342dffbb80c2
5
5
  SHA512:
6
- metadata.gz: 42303b9fe3e46f0ce59c52a6cdcbaf73a3f8b6457f30ab7cbc62c765e9decb2c6b6559fc36135ff81867f5497c7952a1f84d14b1ef70020226dac12bc0f4d68e
7
- data.tar.gz: 183ebc248cb0af6a621aa7edd471532634437a6367cc503810cd9409a94a04b60d6c7a186945bb533a3bf16f1e88c39f0e01c3da5e8afd00f95e5ea961b346d1
6
+ metadata.gz: 25d196cdd13c8c8f0b677583e734cd85e5eea7cf148c33c9317d9bc966481dd549a5513d1f89ac598e53086a4913ba2873184830d57dbc5b740413464397e89e
7
+ data.tar.gz: 344729a1eb162560e4519b851e0a736f81dddaad4c652338b1af568549d7ba5036c1a7f935b01a7805a1da4972aeb054ffa7b3980e571213ca10a08b75227e8b
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -4,7 +4,7 @@ cache: bundler
4
4
  rvm:
5
5
  - 2.0
6
6
  - 2.1
7
- - 2.2
7
+ - 2.2.2
8
8
  - 2.3.0
9
9
  - rbx
10
10
  env:
@@ -14,8 +14,15 @@ env:
14
14
  - ACTIVERECORD=4.0.0
15
15
  - ACTIVERECORD=4.1.0
16
16
  - ACTIVERECORD=4.2.0
17
+ - ACTIVERECORD=5.0.0
17
18
  matrix:
18
19
  exclude:
20
+ - rvm: 2.0
21
+ env: ACTIVERECORD=5.0.0
22
+ - rvm: 2.1
23
+ env: ACTIVERECORD=5.0.0
24
+ - rvm: rbx
25
+ env: ACTIVERECORD=5.0.0
19
26
  allow_failures:
20
27
  - rvm: rbx
21
28
  fast_finish: true
@@ -1,5 +1,10 @@
1
1
  # attr_encrypted #
2
2
 
3
+ ## 3.0.2 ##
4
+ * Changed: Removed alias_method_chain for compatibility with Rails v5.x (@grosser)
5
+ * Changed: Updated Travis build matrix to include Rails 5. (@saghaulor) (@connorshea)
6
+ * Changed: Removed `.silence_stream` from tests as it has been removed from Rails 5. (@sblackstone)
7
+
3
8
  ## 3.0.1 ##
4
9
  * Fixed: attr_was method no longer calls undefined methods. (@saghaulor)
5
10
 
data/README.md CHANGED
@@ -403,7 +403,7 @@ It is recommended that you implement a strategy to insure that you do not mix th
403
403
  attr_encrypted :ssn, key: :encryption_key, v2_gcm_iv: :is_decrypting?(:ssn)
404
404
 
405
405
  def is_decrypting?(attribute)
406
- encrypted_atributes[attribute][operation] == :decrypting
406
+ encrypted_attributes[attribute][:operation] == :decrypting
407
407
  end
408
408
  end
409
409
 
@@ -0,0 +1 @@
1
+ 33140af4b223177db7a19efb2fa38472a299a745b29ca1c5ba9d3fa947390b77
@@ -0,0 +1 @@
1
+ 0c467cab98b9b2eb331f9818323a90ae01392d6cb03cf1f32faccc954d0fc54be65f0fc7bf751b0fce57925eef1c9e2af90181bc40d81ad93e21d15a001c53c6
@@ -6,19 +6,20 @@ if defined?(ActiveRecord::Base)
6
6
  base.class_eval do
7
7
 
8
8
  # https://github.com/attr-encrypted/attr_encrypted/issues/68
9
- def reload_with_attr_encrypted(*args, &block)
9
+ alias_method :reload_without_attr_encrypted, :reload
10
+ def reload(*args, &block)
10
11
  result = reload_without_attr_encrypted(*args, &block)
11
12
  self.class.encrypted_attributes.keys.each do |attribute_name|
12
13
  instance_variable_set("@#{attribute_name}", nil)
13
14
  end
14
15
  result
15
16
  end
16
- alias_method_chain :reload, :attr_encrypted
17
17
 
18
18
  attr_encrypted_options[:encode] = true
19
19
 
20
20
  class << self
21
- alias_method_chain :method_missing, :attr_encrypted
21
+ alias_method :method_missing_without_attr_encrypted, :method_missing
22
+ alias_method :method_missing, :method_missing_with_attr_encrypted
22
23
  end
23
24
 
24
25
  def perform_attribute_assignment(method, new_attributes, *args)
@@ -30,16 +31,16 @@ if defined?(ActiveRecord::Base)
30
31
  private :perform_attribute_assignment
31
32
 
32
33
  if ::ActiveRecord::VERSION::STRING > "3.1"
33
- def assign_attributes_with_attr_encrypted(*args)
34
+ alias_method :assign_attributes_without_attr_encrypted, :assign_attributes
35
+ def assign_attributes(*args)
34
36
  perform_attribute_assignment :assign_attributes_without_attr_encrypted, *args
35
37
  end
36
- alias_method_chain :assign_attributes, :attr_encrypted
37
38
  end
38
39
 
39
- def attributes_with_attr_encrypted=(*args)
40
+ alias_method :attributes_without_attr_encrypted=, :attributes=
41
+ def attributes=(*args)
40
42
  perform_attribute_assignment :attributes_without_attr_encrypted=, *args
41
43
  end
42
- alias_method_chain :attributes=, :attr_encrypted
43
44
  end
44
45
  end
45
46
 
@@ -3,7 +3,7 @@ module AttrEncrypted
3
3
  module Version
4
4
  MAJOR = 3
5
5
  MINOR = 0
6
- PATCH = 1
6
+ PATCH = 2
7
7
 
8
8
  # Returns a version string by joining <tt>MAJOR</tt>, <tt>MINOR</tt>, and <tt>PATCH</tt> with <tt>'.'</tt>
9
9
  #
@@ -3,40 +3,38 @@ require_relative 'test_helper'
3
3
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
4
4
 
5
5
  def create_tables
6
- silence_stream(STDOUT) do
7
- ActiveRecord::Schema.define(version: 1) do
8
- create_table :people do |t|
9
- t.string :encrypted_email
10
- t.string :password
11
- t.string :encrypted_credentials
12
- t.binary :salt
13
- t.binary :key_iv
14
- t.string :encrypted_email_salt
15
- t.string :encrypted_credentials_salt
16
- t.string :encrypted_email_iv
17
- t.string :encrypted_credentials_iv
18
- end
19
- create_table :accounts do |t|
20
- t.string :encrypted_password
21
- t.string :encrypted_password_iv
22
- t.string :encrypted_password_salt
23
- end
24
- create_table :users do |t|
25
- t.string :login
26
- t.string :encrypted_password
27
- t.string :encrypted_password_iv
28
- t.boolean :is_admin
29
- end
30
- create_table :prime_ministers do |t|
31
- t.string :encrypted_name
32
- t.string :encrypted_name_iv
33
- end
34
- create_table :addresses do |t|
35
- t.binary :encrypted_street
36
- t.binary :encrypted_street_iv
37
- t.binary :encrypted_zipcode
38
- t.string :mode
39
- end
6
+ ActiveRecord::Schema.define(version: 1) do
7
+ create_table :people do |t|
8
+ t.string :encrypted_email
9
+ t.string :password
10
+ t.string :encrypted_credentials
11
+ t.binary :salt
12
+ t.binary :key_iv
13
+ t.string :encrypted_email_salt
14
+ t.string :encrypted_credentials_salt
15
+ t.string :encrypted_email_iv
16
+ t.string :encrypted_credentials_iv
17
+ end
18
+ create_table :accounts do |t|
19
+ t.string :encrypted_password
20
+ t.string :encrypted_password_iv
21
+ t.string :encrypted_password_salt
22
+ end
23
+ create_table :users do |t|
24
+ t.string :login
25
+ t.string :encrypted_password
26
+ t.string :encrypted_password_iv
27
+ t.boolean :is_admin
28
+ end
29
+ create_table :prime_ministers do |t|
30
+ t.string :encrypted_name
31
+ t.string :encrypted_name_iv
32
+ end
33
+ create_table :addresses do |t|
34
+ t.binary :encrypted_street
35
+ t.binary :encrypted_street_iv
36
+ t.binary :encrypted_zipcode
37
+ t.string :mode
40
38
  end
41
39
  end
42
40
  end
@@ -81,26 +81,24 @@ class CompatibilityTest < Minitest::Test
81
81
  private
82
82
 
83
83
  def create_tables
84
- silence_stream(STDOUT) do
85
- ActiveRecord::Schema.define(:version => 1) do
86
- create_table :nonmarshalling_pets do |t|
87
- t.string :name
88
- t.string :encrypted_nickname
89
- t.string :encrypted_nickname_iv
90
- t.string :encrypted_nickname_salt
91
- t.string :encrypted_birthdate
92
- t.string :encrypted_birthdate_iv
93
- t.string :encrypted_birthdate_salt
94
- end
95
- create_table :marshalling_pets do |t|
96
- t.string :name
97
- t.string :encrypted_nickname
98
- t.string :encrypted_nickname_iv
99
- t.string :encrypted_nickname_salt
100
- t.string :encrypted_birthdate
101
- t.string :encrypted_birthdate_iv
102
- t.string :encrypted_birthdate_salt
103
- end
84
+ ActiveRecord::Schema.define(:version => 1) do
85
+ create_table :nonmarshalling_pets do |t|
86
+ t.string :name
87
+ t.string :encrypted_nickname
88
+ t.string :encrypted_nickname_iv
89
+ t.string :encrypted_nickname_salt
90
+ t.string :encrypted_birthdate
91
+ t.string :encrypted_birthdate_iv
92
+ t.string :encrypted_birthdate_salt
93
+ end
94
+ create_table :marshalling_pets do |t|
95
+ t.string :name
96
+ t.string :encrypted_nickname
97
+ t.string :encrypted_nickname_iv
98
+ t.string :encrypted_nickname_salt
99
+ t.string :encrypted_birthdate
100
+ t.string :encrypted_birthdate_iv
101
+ t.string :encrypted_birthdate_salt
104
102
  end
105
103
  end
106
104
  end
@@ -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
- silence_stream(STDOUT) do
8
- ActiveRecord::Schema.define(:version => 1) do
9
- create_table :legacy_people do |t|
10
- t.string :encrypted_email
11
- t.string :password
12
- t.string :encrypted_credentials
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
@@ -73,20 +73,18 @@ class LegacyCompatibilityTest < Minitest::Test
73
73
  private
74
74
 
75
75
  def create_tables
76
- silence_stream(STDOUT) do
77
- ActiveRecord::Schema.define(:version => 1) do
78
- create_table :legacy_nonmarshalling_pets do |t|
79
- t.string :name
80
- t.string :encrypted_nickname
81
- t.string :encrypted_birthdate
82
- t.string :salt
83
- end
84
- create_table :legacy_marshalling_pets do |t|
85
- t.string :name
86
- t.string :encrypted_nickname
87
- t.string :encrypted_birthdate
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
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.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber
@@ -33,7 +33,7 @@ cert_chain:
33
33
  ZjeLmnSDiwL6doiP5IiwALH/dcHU67ck3NGf6XyqNwQrrmtPY0mv1WVVL4Uh+vYE
34
34
  kHoFzE2no0BfBg78Re8fY69P5yES5ncC
35
35
  -----END CERTIFICATE-----
36
- date: 2016-04-02 00:00:00.000000000 Z
36
+ date: 2016-07-15 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: encryptor
@@ -224,6 +224,8 @@ files:
224
224
  - certs/saghaulor.pem
225
225
  - checksum/attr_encrypted-3.0.0.gem.sha256
226
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
227
229
  - lib/attr_encrypted.rb
228
230
  - lib/attr_encrypted/adapters/active_record.rb
229
231
  - lib/attr_encrypted/adapters/data_mapper.rb
metadata.gz.sig CHANGED
Binary file