loggable_activity 0.1.46 → 0.1.47

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: 309f169a39d30cfaaa058c625747d1d469c28680cdbde1dcba7fc51315b1a907
4
- data.tar.gz: d7dfa9e7c068cf786a1becc1cb45652c857f70e07f250b1b8c859d971d1d5a13
3
+ metadata.gz: 769f6634b248e3b70df41eb296770debee95b28e4e80f16f5c1b548f594dfde2
4
+ data.tar.gz: 9edc8cbb35e16e0738e747ddb3cd8b953929a3cb4524ea623d118fed8bf38022
5
5
  SHA512:
6
- metadata.gz: 8654992dccda157320395bce6be47af4bc04808fd65bf402f5721879c4aa3d4482e0f039442042ca1a33fed751581251e52056b0faccc7d24410033d39781166
7
- data.tar.gz: 4701568d294807adce3f455bd9856423bf137a0704eee2a6384be277e6b88d4fc24e4b86a919ba1b7b8d4277701748a3b42d3457e29ef09f4f8c0661898a4c54
6
+ metadata.gz: cd00a44dff499dd739c210a6d15ebf30b8a281f6f20006922f39cb0411f939be982abd1b4c82bc39257237ea804422b358f5ba2b63a9d7531a0a3164fdf37240
7
+ data.tar.gz: 0f2e77814f90963fb65c322cc28e3be34faf62d079e7c7bfce98d80700d5a6c31fea40761e1ee62e85e2e0ae7b16852e1ff822374d684cdc029460a62ee2c82f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
  - nothing so far
3
+
4
+ ## [0.1.47] - 2024-02-16
5
+ ### Breaking change
6
+ - Updated encryption_key to be 32 bytes
7
+ - Updated README.md
8
+ - Updated GETTING_STARTED.md
9
+ - Added PULL_REQUEST_TEMPLATE.md
10
+ ## [0.1.46] - 2024-02-16
11
+ - Fixed spelling error in EncryptionKey
3
12
  ## [0.1.43] - 2024-02-15
4
13
  - Updated README.md and GETTING-STARTED.md
5
14
  ## [0.1.39] - 2024-02-12
@@ -7,6 +16,5 @@
7
16
  ## [0.1.38] - 2024-02-12
8
17
  - Removed dependency on awesome print
9
18
  ## [0.1.35] - 2024-02-11
10
-
11
19
  - Initial release
12
20
 
data/GETTING-STARTED.md CHANGED
@@ -78,3 +78,9 @@ Then an `LoggableActivity::Activity` is created. You can inspect it from the ter
78
78
  puts activity = Loggable::Activity.last
79
79
  puts activity.attrs
80
80
  ```
81
+
82
+ ## For developers
83
+ If you want to contribute to the development and try it out in the process
84
+ - 1 Down the demo project from [demo project on github](https://github.com/maxgronlund/LoggableActivityDemoApp)
85
+ - 2 Update the Gemfile in the demo project so it points to your localhost.
86
+ - 3 you can now build and test you version of the gem `$ gem build loggable_activity.gemspec`
data/README.md CHANGED
@@ -5,6 +5,8 @@ Secure protect data and log how it is handled
5
5
  - Prepare for General Data Protection Regulation (GDPR) compliance.
6
6
  - Handles activities that involves more than one table in the DB.
7
7
 
8
+ ### Important!
9
+ This project is under development and not ready for production. There might be breaking changes, so please consult the CHANGELOG.md
8
10
  ### What it is not
9
11
  - An error logging system
10
12
  - A paper trails system with rollback.
@@ -260,11 +260,13 @@ module LoggableActivity
260
260
 
261
261
  def record_key
262
262
  return nil if record.nil?
263
+
263
264
  LoggableActivity::EncryptionKey.for_record(record)&.key
264
265
  end
265
266
 
266
267
  def actor_key
267
268
  return nil if actor.nil?
269
+
268
270
  LoggableActivity::EncryptionKey.for_record(actor)&.key
269
271
  end
270
272
 
@@ -41,7 +41,7 @@ module LoggableActivity
41
41
  # "my secret data"
42
42
  #
43
43
  def self.decrypt(data, encryption_key)
44
- return "" if data.nil?
44
+ return '' if data.nil?
45
45
  return I18n.t('loggable.activity.deleted') if encryption_key.nil?
46
46
 
47
47
  cipher = OpenSSL::Cipher.new('AES-128-CBC').decrypt
@@ -9,7 +9,7 @@ module LoggableActivity
9
9
  # Associations
10
10
  belongs_to :record, polymorphic: true, optional: true
11
11
  belongs_to :parent_key, class_name: 'LoggableActivity::EncryptionKey', optional: true,
12
- foreign_key: 'parent_key_id'
12
+ foreign_key: 'parent_key_id'
13
13
 
14
14
  # Marks the encryption key as deleted by updating the key to nil.
15
15
  def mark_as_deleted
@@ -90,7 +90,7 @@ module LoggableActivity
90
90
  #
91
91
  def self.create_encryption_key(record_type, record_id, parent_key = nil)
92
92
  if parent_key
93
- create(record_type:, record_id:, key: random_key, parent_key: )
93
+ create(record_type:, record_id:, key: random_key, parent_key:)
94
94
  else
95
95
  create(record_type:, record_id:, key: random_key)
96
96
  end
@@ -107,7 +107,7 @@ module LoggableActivity
107
107
  # "a8f4774e7f42eb253045a4db7de7b79e"
108
108
  #
109
109
  def self.random_key
110
- SecureRandom.hex(16)
110
+ SecureRandom.hex(32)
111
111
  end
112
112
  end
113
113
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LoggableActivity
4
- VERSION = '0.1.46'
4
+ VERSION = '0.1.47'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loggable_activity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.46
4
+ version: 0.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Max \nGroenlund"