gdpr_admin 1.6.0 → 1.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8f6f1437e957b783de64f6a16847142b7eff9ebf14428b8c1d6d8db4011dcde
4
- data.tar.gz: 4ea36ea2245d25a95883501dbe7727149bb1f971c4e5f1de27c00621f7526f69
3
+ metadata.gz: 21ae4f0cc358a36bf2fb706fea22477ca990d633448425a080b8565872d748b9
4
+ data.tar.gz: 9dbe6843c8f5f99316c08e2f504a7210a4dcb347355d7233cfc8cd9f2937dafe
5
5
  SHA512:
6
- metadata.gz: 931d742f6e132f9aac3ebf5babf2cf3596b49827830cb90dc5c169f4b8fd570c45ce43a0be4b76c62bea487b2b0bbe1dc643d8486f7e9e58ff35610c4313b77b
7
- data.tar.gz: 9f19d2ad664ea3dd95b73524ca914e4f1cd2bdcacfd83a305a2128443bee3036da70002f21bb9487614b4593c2350d0a815f36d70239a2005b34f6a1e27d83a1
6
+ metadata.gz: c2b146740a0b6ba12e216ea77a1fdb3a23545c9c121206f56cb8ca548cadf627fc2a4a2822543b020f2bf2d1a7c5ff2365aa40086c966cfed339faa9d2e4dfa7
7
+ data.tar.gz: 106627fe529e2344ec2e7ba01a0120c6ccaf61ca16241df0ead44f8b06d573168a1c2cc141db4f7f5656d6c783364d28cdf4ae66fa6d4f0e54748779d9e693c4
@@ -14,6 +14,13 @@ module GdprAdmin
14
14
  def anonymize_ip
15
15
  Faker::Internet.ip_v4_address
16
16
  end
17
+
18
+ def mask_ip(_record, _field, value)
19
+ addr = IPAddr.new(value.to_s)
20
+ return addr.mask(24).to_s if addr.ipv4?
21
+
22
+ addr.mask(48).to_s
23
+ end
17
24
  end
18
25
  end
19
26
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  # :nocov:
4
4
  module GdprAdmin
5
- VERSION = '1.6.0'
5
+ VERSION = '1.7.0'
6
6
  end
7
7
  # :nocov:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gdpr_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colex
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-22 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails