gdpr_admin 1.5.0 → 1.7.0

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
  SHA256:
3
- metadata.gz: 3ededdaffe816cd8865d4b958ded108be6e869b8166ca655646dc437d93526c5
4
- data.tar.gz: 17de7a32993d5f12ba4b872fc2a7aee9d64c225ec727295f2de62c9078b0fe85
3
+ metadata.gz: 21ae4f0cc358a36bf2fb706fea22477ca990d633448425a080b8565872d748b9
4
+ data.tar.gz: 9dbe6843c8f5f99316c08e2f504a7210a4dcb347355d7233cfc8cd9f2937dafe
5
5
  SHA512:
6
- metadata.gz: 8560a167bcb6757c42c2b29c265faed9ea615f99dda3fbadaa25d5cd411a78400888a0ba057e2af4e7846b811780c41ca025606e5a4c78aed6c319fae3412733
7
- data.tar.gz: e1ad8a3871d80f2e052c39db3e14acaf0315a40619d742c242e0fed870d336e70f2d3573f6ebccacec19632d25046b322d270af3fa612ce1630a86083e2baeab
6
+ metadata.gz: c2b146740a0b6ba12e216ea77a1fdb3a23545c9c121206f56cb8ca548cadf627fc2a4a2822543b020f2bf2d1a7c5ff2365aa40086c966cfed339faa9d2e4dfa7
7
+ data.tar.gz: 106627fe529e2344ec2e7ba01a0120c6ccaf61ca16241df0ead44f8b06d573168a1c2cc141db4f7f5656d6c783364d28cdf4ae66fa6d4f0e54748779d9e693c4
@@ -3,7 +3,7 @@
3
3
  module GdprAdmin
4
4
  class Request < ApplicationRecord
5
5
  belongs_to :tenant, class_name: GdprAdmin.config.tenant_class
6
- belongs_to :requester, class_name: GdprAdmin.config.requester_class, optional: true
6
+ belongs_to :requester, polymorphic: true, optional: true
7
7
 
8
8
  VALID_STATUS_TRANSITIONS = {
9
9
  pending: %i[processing],
@@ -4,7 +4,7 @@ class CreateGdprAdminRequests < ActiveRecord::Migration[7.0]
4
4
  def change
5
5
  create_table :gdpr_admin_requests do |t|
6
6
  t.references :tenant, null: false, foreign_key: { to_table: :organizations }
7
- t.references :requester, null: true, foreign_key: { to_table: :admin_users }
7
+ t.references :requester, null: true, polymorphic: true
8
8
  t.string :request_type, null: false
9
9
  t.string :status, default: 'pending', null: false
10
10
  t.datetime :data_older_than, null: false
@@ -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,13 +2,12 @@
2
2
 
3
3
  module GdprAdmin
4
4
  class Configuration
5
- attr_accessor :tenant_class, :requester_class, :data_policies_path, :default_job_queue,
5
+ attr_accessor :tenant_class, :data_policies_path, :default_job_queue,
6
6
  :erasure_grace_period, :export_grace_period
7
7
  attr_writer :tenant_adapter
8
8
 
9
9
  def initialize
10
10
  @tenant_class = 'Organization'
11
- @requester_class = 'AdminUser'
12
11
  @tenant_adapter = TenantAdapters::ActsAsTenantAdapter.new
13
12
  @data_policies_path = Rails.root.join('app', 'gdpr')
14
13
  @default_job_queue = :default
@@ -2,6 +2,6 @@
2
2
 
3
3
  # :nocov:
4
4
  module GdprAdmin
5
- VERSION = '1.5.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.5.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-04-17 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