mongoid-encrypted-fields 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +4 -0
- data/README.md +8 -0
- data/lib/mongoid-encrypted-fields.rb +1 -1
- data/lib/mongoid-encrypted-fields/mongoid3/validations/uniqueness.rb +1 -1
- data/lib/mongoid-encrypted-fields/mongoid4/validatable/uniqueness.rb +1 -1
- data/lib/mongoid-encrypted-fields/version.rb +1 -1
- data/spec/config/mongoid5.yml +6 -0
- data/spec/mongoid-encrypted-fields/mongoid4/validatable/uniqueness_spec.rb +1 -1
- data/spec/spec_helper.rb +10 -4
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGNkOTUzNGU0OTdiOTgxNTY3NzBlMTYyMmNmYTRhZjE1MmFjMGQ4ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzE2ZDIzMGZiMDM2NDRlOTBjMDY0MjhkM2Q0ZGIzZmQ1OTA2MDY3OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjgzYjJlNzUwNDY2NjE4ZGQzM2VlYWQ4ZGQyOWMyOTE0NjZjN2Y3NzFjNWE5
|
10
|
+
ZWVjMWQwZDgzYmY1MWEwMjFmMmZiODQwZDNlNjA0NWNlMGIwNzczY2ZmNDZj
|
11
|
+
Y2ZhOWVjNzExZWM0MzE1NGIwMjkxYmFiOWJkMWVlZWE3YjdhYTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTgxNjY4MmJjMzZmZTM3ZDBmMmVkM2RmZjRiZThmYjBiNWNkOWNlN2U4N2Iw
|
14
|
+
Yjk4N2M4Mjk3YTdkMDUwMTAzNmE2YzYxNjFkYTUwN2MwZDYxNWQ4NGYzNTI0
|
15
|
+
MDc3Y2QxYTk3NjEwMDc0ZmQzOTQ2ZDBkNGMwMzdmZjMzZmQxNjc=
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,14 @@ mongoid-encrypted-fields
|
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/KoanHealth/mongoid-encrypted-fields/badge.png?branch=master)](https://coveralls.io/r/KoanHealth/mongoid-encrypted-fields)
|
6
6
|
[![Dependency Status](https://gemnasium.com/KoanHealth/mongoid-encrypted-fields.png)](https://gemnasium.com/KoanHealth/mongoid-encrypted-fields)
|
7
7
|
|
8
|
+
New Maintainer Needed
|
9
|
+
=====================
|
10
|
+
We are actively seeking a new maintainer for this gem! As we no longer use MongoDB as part of our platform, we aren't using the gem for ourselves. As MongoDB and Mongoid continually change, we want to make sure our gem keeps up.
|
11
|
+
|
12
|
+
If you're interested, please contact us! Thanks
|
13
|
+
|
14
|
+
Description
|
15
|
+
===========
|
8
16
|
A library for storing encrypted data in Mongo using Mongoid. We looked at a few alternatives, but wanted something that stored the values securely and unobtrusively.
|
9
17
|
|
10
18
|
Mongoid 3 supports [custom types](http://mongoid.org/en/mongoid/docs/documents.html) that need to only provide a simple interface - allowing us to extend core Ruby types to secure any type while providing a clean interface for developers.
|
@@ -26,7 +26,7 @@ end
|
|
26
26
|
case ::Mongoid::EncryptedFields.mongoid_major_version
|
27
27
|
when 3
|
28
28
|
require 'mongoid-encrypted-fields/mongoid3/validations/uniqueness'
|
29
|
-
when 4
|
29
|
+
when 4, 5
|
30
30
|
require 'mongoid-encrypted-fields/mongoid4/validatable/uniqueness'
|
31
31
|
else
|
32
32
|
raise "Unsupported version of Mongoid: #{::Mongoid::VERSION::MAJOR}"
|
@@ -13,7 +13,7 @@ module Mongoid
|
|
13
13
|
return if case_sensitive?
|
14
14
|
attributes.each do |attribute|
|
15
15
|
field_type = @klass.fields[@klass.database_field_name(attribute)].options[:type]
|
16
|
-
raise ArgumentError, "Encrypted field :#{attribute} cannot support case insensitive uniqueness" if field_type.method_defined?(:encrypted)
|
16
|
+
raise ArgumentError, "Encrypted field :#{attribute} cannot support case insensitive uniqueness" if field_type && field_type.method_defined?(:encrypted)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -21,7 +21,7 @@ module Mongoid
|
|
21
21
|
return unless klass
|
22
22
|
attributes.each do |attribute|
|
23
23
|
field_type = klass.fields[klass.database_field_name(attribute)].options[:type]
|
24
|
-
raise ArgumentError, "Encrypted field :#{attribute} cannot support case insensitive uniqueness" if field_type.method_defined?(:encrypted)
|
24
|
+
raise ArgumentError, "Encrypted field :#{attribute} cannot support case insensitive uniqueness" if field_type && field_type.method_defined?(:encrypted)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
data/spec/spec_helper.rb
CHANGED
@@ -16,17 +16,23 @@ require 'rspec'
|
|
16
16
|
|
17
17
|
require 'mongoid-encrypted-fields'
|
18
18
|
|
19
|
-
Dir["#{File.dirname(__FILE__)}/../examples/**/*.rb"].each {|f| require f}
|
20
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
19
|
+
Dir["#{File.dirname(__FILE__)}/../examples/**/*.rb"].each { |f| require f }
|
20
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
21
21
|
|
22
22
|
ENV['MONGOID_ENV'] ||= 'test'
|
23
|
-
|
23
|
+
|
24
|
+
# Config format changed in mongoid 5
|
25
|
+
if Mongoid::EncryptedFields.mongoid_major_version < 5
|
26
|
+
Mongoid.load!("#{File.dirname(__FILE__)}/config/mongoid.yml")
|
27
|
+
else
|
28
|
+
Mongoid.load!("#{File.dirname(__FILE__)}/config/mongoid5.yml")
|
29
|
+
end
|
24
30
|
|
25
31
|
Mongoid::EncryptedFields.logger.level = Logger::FATAL
|
26
32
|
|
27
33
|
RSpec.configure do |config|
|
28
34
|
Mongoid.logger = Mongoid::EncryptedFields.logger
|
29
|
-
Moped.logger = Mongoid::EncryptedFields.logger
|
35
|
+
Moped.logger = Mongoid::EncryptedFields.logger if defined? Moped
|
30
36
|
|
31
37
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
32
38
|
config.run_all_when_everything_filtered = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-encrypted-fields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koan Health
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- lib/mongoid-encrypted-fields/mongoid4/validatable/uniqueness.rb
|
132
132
|
- lib/mongoid-encrypted-fields/version.rb
|
133
133
|
- spec/config/mongoid.yml
|
134
|
+
- spec/config/mongoid5.yml
|
134
135
|
- spec/mongoid-encrypted-fields/fields/encrypted_date_spec.rb
|
135
136
|
- spec/mongoid-encrypted-fields/fields/encrypted_datetime_spec.rb
|
136
137
|
- spec/mongoid-encrypted-fields/fields/encrypted_field_spec.rb
|
@@ -162,12 +163,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
163
|
version: 1.3.6
|
163
164
|
requirements: []
|
164
165
|
rubyforge_project:
|
165
|
-
rubygems_version: 2.4.
|
166
|
+
rubygems_version: 2.4.6
|
166
167
|
signing_key:
|
167
168
|
specification_version: 4
|
168
169
|
summary: Custom types for storing encrypted data
|
169
170
|
test_files:
|
170
171
|
- spec/config/mongoid.yml
|
172
|
+
- spec/config/mongoid5.yml
|
171
173
|
- spec/mongoid-encrypted-fields/fields/encrypted_date_spec.rb
|
172
174
|
- spec/mongoid-encrypted-fields/fields/encrypted_datetime_spec.rb
|
173
175
|
- spec/mongoid-encrypted-fields/fields/encrypted_field_spec.rb
|