data-anonymization 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +3 -3
- data/data-anonymization.gemspec +3 -3
- data/lib/strategy/field/datetime/anonymize_time.rb +3 -3
- data/lib/strategy/field/number/random_big_decimal_delta.rb +1 -1
- data/lib/utils/random_int.rb +2 -2
- data/lib/version.rb +1 -1
- data/spec/strategy/field/number/random_big_decimal_delta_spec.rb +1 -1
- data/spec/utils/database_spec.rb +0 -6
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c24dc45a72724bdc3a3d96977afbf04382ab3d40e04981b5b9a6676ffaf83f0
|
4
|
+
data.tar.gz: 1b9bfd7209781e2afc867248ad374e5cac923c975b1933691e0216f0684721c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58d1c365443b98223f2a59f31eab5700ad8023df5924c61157104fb503946a84145d6d8b5d413f0549935644a83de9386dcd5e663dc7caa451ad13d20881d57e
|
7
|
+
data.tar.gz: 382c0e5c77ae689d09351969898baba8b5cc8dea3775293ce402fa4f953307141295ad76e8fbe589ebac7be3125a989083eb6e489087c050abb5c9d768518dc9
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.7.1
|
data/.travis.yml
CHANGED
data/data-anonymization.gemspec
CHANGED
@@ -19,9 +19,9 @@ 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', '~>
|
23
|
-
gem.add_dependency('composite_primary_keys', '~>
|
24
|
-
gem.add_dependency('activesupport', '~>
|
22
|
+
gem.add_dependency('activerecord', '~> 6.0')
|
23
|
+
gem.add_dependency('composite_primary_keys', '~> 12.0')
|
24
|
+
gem.add_dependency('activesupport', '~> 6.0')
|
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')
|
@@ -58,8 +58,8 @@ module DataAnon
|
|
58
58
|
month = @anonymize_month? DataAnon::Utils::RandomInt.generate(1,12) : original_time.month
|
59
59
|
days_in_month = Time.new(year,month,1,1,1,1).end_of_month.day
|
60
60
|
day = @anonymize_day? DataAnon::Utils::RandomInt.generate(1,days_in_month) : original_time.day
|
61
|
-
hour = @anonymize_hour? DataAnon::Utils::RandomInt.generate(
|
62
|
-
min = @anonymize_min? DataAnon::Utils::RandomInt.generate(
|
61
|
+
hour = @anonymize_hour? DataAnon::Utils::RandomInt.generate(0,23) : original_time.hour
|
62
|
+
min = @anonymize_min? DataAnon::Utils::RandomInt.generate(0,59) : original_time.min
|
63
63
|
sec = original_time.sec
|
64
64
|
|
65
65
|
create_object(year, month, day, hour, min, sec)
|
@@ -74,4 +74,4 @@ module DataAnon
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
77
|
-
end
|
77
|
+
end
|
@@ -16,7 +16,7 @@ module DataAnon
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def anonymize field
|
19
|
-
return BigDecimal
|
19
|
+
return BigDecimal("#{field.value + DataAnon::Utils::RandomFloat.generate(-@delta, +@delta)}")
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
data/lib/utils/random_int.rb
CHANGED
data/lib/version.rb
CHANGED
@@ -4,7 +4,7 @@ require 'bigdecimal'
|
|
4
4
|
describe FieldStrategy::RandomBigDecimalDelta do
|
5
5
|
|
6
6
|
RandomBigDecimalDelta = FieldStrategy::RandomBigDecimalDelta
|
7
|
-
let(:field) {DataAnon::Core::Field.new('decimal_field',BigDecimal
|
7
|
+
let(:field) {DataAnon::Core::Field.new('decimal_field',BigDecimal("53422342378687687342893.23324"),1,nil)}
|
8
8
|
|
9
9
|
describe 'anonymized big decimal should not be the same as original value' do
|
10
10
|
let(:anonymized_value) {RandomBigDecimalDelta.new.anonymize(field)}
|
data/spec/utils/database_spec.rb
CHANGED
@@ -22,10 +22,4 @@ describe 'Utils' do
|
|
22
22
|
conditionals.all.length == 0
|
23
23
|
end
|
24
24
|
|
25
|
-
it 'should test the connection to destination database' do
|
26
|
-
album = DataAnon::Utils::DestinationTable.create 'Album', ['AlbumId']
|
27
|
-
album.count.should == 0
|
28
|
-
album.all.length == 0
|
29
|
-
end
|
30
|
-
|
31
25
|
end
|
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.5
|
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:
|
13
|
+
date: 2020-05-28 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: '
|
21
|
+
version: '6.0'
|
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: '
|
28
|
+
version: '6.0'
|
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: '12.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: '12.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: '
|
49
|
+
version: '6.0'
|
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: '
|
56
|
+
version: '6.0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rgeo
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -298,8 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
- !ruby/object:Gem::Version
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
|
-
|
302
|
-
rubygems_version: 2.7.6
|
301
|
+
rubygems_version: 3.1.2
|
303
302
|
signing_key:
|
304
303
|
specification_version: 4
|
305
304
|
summary: Tool to create anonymized production data dump to use for performance and
|