data-anonymization 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +4 -4
- data/commands.txt +4 -0
- data/data-anonymization.gemspec +4 -4
- data/lib/strategy/blacklist.rb +3 -2
- data/lib/version.rb +1 -1
- data/spec/acceptance/mongodb_whitelist_spec.rb +1 -1
- data/spec/strategy/field/default_anon_spec.rb +2 -2
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dc0216d076506f27de3825ea3afe3fe882589a34ca7ee9bf093299c3d94dbab5
|
4
|
+
data.tar.gz: 1abba846e6f447480c72ac18d49ffffc7f2ad1ee861a4e43016224ed00690f49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 522f6c119710060fa7dacb9056bb6671d890f6057b9abb63bb78d06c3c1defd8de4ec33b8cbb1ec463385260c1a7d8f6722980353c4382fcebca6720db9a7859
|
7
|
+
data.tar.gz: be0be6df490fac97beaed277eda3c89d9d5b92c72e64bd5cef5e381ea66a58cf1664fe753f9a803953f54457a2f4762b6de4e72ae0756693038e89a9ba7c2abb
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.5.3
|
data/.travis.yml
CHANGED
data/commands.txt
ADDED
data/data-anonymization.gemspec
CHANGED
@@ -19,12 +19,12 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
20
|
gem.require_paths = ['lib']
|
21
21
|
|
22
|
-
gem.add_dependency('activerecord', '~> 5.
|
23
|
-
gem.add_dependency('composite_primary_keys', '~>
|
24
|
-
gem.add_dependency('activesupport', '~> 5.
|
22
|
+
gem.add_dependency('activerecord', '~> 5.2')
|
23
|
+
gem.add_dependency('composite_primary_keys', '~> 11.0')
|
24
|
+
gem.add_dependency('activesupport', '~> 5.2')
|
25
25
|
gem.add_dependency('rgeo', '~> 1.0')
|
26
26
|
gem.add_dependency('rgeo-geojson', '~> 2.0')
|
27
27
|
gem.add_dependency('powerbar', '~> 1.0')
|
28
28
|
gem.add_dependency('parallel', '~> 1.12')
|
29
|
-
gem.add_dependency('thor', '~> 0.20')
|
29
|
+
gem.add_dependency('thor', '~> 0.20.3')
|
30
30
|
end
|
data/lib/strategy/blacklist.rb
CHANGED
@@ -3,15 +3,16 @@ module DataAnon
|
|
3
3
|
class Blacklist < DataAnon::Strategy::Base
|
4
4
|
|
5
5
|
def process_record index, record
|
6
|
+
updates = {}
|
6
7
|
@fields.each do |field, strategy|
|
7
8
|
database_field_name = record.attributes.select { |k,v| k == field }.keys[0]
|
8
9
|
field_value = record.attributes[database_field_name]
|
9
10
|
unless field_value.nil? || is_primary_key?(database_field_name)
|
10
11
|
field = DataAnon::Core::Field.new(database_field_name, field_value, index, record, @name)
|
11
|
-
|
12
|
+
updates[database_field_name] = strategy.anonymize(field)
|
12
13
|
end
|
13
14
|
end
|
14
|
-
record.
|
15
|
+
record.update_columns(updates) if updates.any?
|
15
16
|
end
|
16
17
|
|
17
18
|
end
|
data/lib/version.rb
CHANGED
@@ -95,7 +95,7 @@ describe 'End 2 End MongoDB Whitelist Acceptance Test' do
|
|
95
95
|
feature1 = plan['features'][0]
|
96
96
|
[10737418240, 21474836480, 53687091200].should include(feature1['max_storage'])
|
97
97
|
feature1['type'].should == 'AmazonS3'
|
98
|
-
feature1['users']['max'].should be_kind_of(
|
98
|
+
feature1['users']['max'].should be_kind_of(Integer)
|
99
99
|
[true,false].should include(feature1['users']['additional'])
|
100
100
|
|
101
101
|
|
@@ -29,14 +29,14 @@ describe FieldStrategy::DefaultAnon do
|
|
29
29
|
let(:field) {DataAnon::Core::Field.new('int_field',2,1,nil)}
|
30
30
|
let(:anonymized_value) {DefaultAnon.new.anonymize(field)}
|
31
31
|
|
32
|
-
it { anonymized_value.should be_kind_of
|
32
|
+
it { anonymized_value.should be_kind_of Integer }
|
33
33
|
end
|
34
34
|
|
35
35
|
describe 'anonymized bignum value' do
|
36
36
|
let(:field) {DataAnon::Core::Field.new('int_field',2348723489723847382947,1,nil)}
|
37
37
|
let(:anonymized_value) {DefaultAnon.new.anonymize(field)}
|
38
38
|
|
39
|
-
it { anonymized_value.should be_kind_of
|
39
|
+
it { anonymized_value.should be_kind_of Integer }
|
40
40
|
end
|
41
41
|
|
42
42
|
describe 'anonymized string value' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data-anonymization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sunit Parekh
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-11-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -18,42 +18,42 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '5.
|
21
|
+
version: '5.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '5.
|
28
|
+
version: '5.2'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: composite_primary_keys
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
35
|
+
version: '11.0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '11.0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: activesupport
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '5.
|
49
|
+
version: '5.2'
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '5.
|
56
|
+
version: '5.2'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rgeo
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,14 +116,14 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - "~>"
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
119
|
+
version: 0.20.3
|
120
120
|
type: :runtime
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
124
|
- - "~>"
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version:
|
126
|
+
version: 0.20.3
|
127
127
|
description: Data anonymization tool for RDBMS and MongoDB databases
|
128
128
|
email:
|
129
129
|
- parekh.sunit@gmail.com
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- README.md
|
147
147
|
- Rakefile
|
148
148
|
- bin/datanon
|
149
|
+
- commands.txt
|
149
150
|
- data-anonymization.gemspec
|
150
151
|
- examples/blacklist_dsl.rb
|
151
152
|
- examples/mongodb_blacklist_dsl.rb
|
@@ -298,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
299
|
version: '0'
|
299
300
|
requirements: []
|
300
301
|
rubyforge_project:
|
301
|
-
rubygems_version: 2.6
|
302
|
+
rubygems_version: 2.7.6
|
302
303
|
signing_key:
|
303
304
|
specification_version: 4
|
304
305
|
summary: Tool to create anonymized production data dump to use for performance and
|