loggable_activity 0.2.1c → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +29 -42
- data/.vscode/commands.json +2 -2
- data/.vscode/terminals.json +8 -8
- data/CHANGELOG.md +0 -3
- data/CHEAT_SHEET.md +31 -0
- data/MIT-LICENSE +21 -0
- data/README.md +31 -45
- data/Rakefile +6 -4
- data/app/assets/config/loggable_activity_manifest.js +4 -0
- data/app/assets/javascripts/loggable_activity/application.js +2 -0
- data/app/assets/stylesheets/loggable_activity/application.scss +20 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/controllers/loggable_activity/activities_controller.rb +12 -0
- data/app/controllers/loggable_activity/application_controller.rb +6 -0
- data/app/helpers/loggable_activity/activities_helper.rb +17 -0
- data/app/helpers/loggable_activity/application_helper.rb +6 -0
- data/app/jobs/loggable_activity/application_job.rb +6 -0
- data/app/mailers/loggable_activity/application_mailer.rb +8 -0
- data/app/models/loggable_activity/application_record.rb +7 -0
- data/app/views/kaminari/kaminari-turbo-bootstrap/_first_page.html.erb +14 -0
- data/app/views/kaminari/kaminari-turbo-bootstrap/_gap.html.erb +8 -0
- data/app/views/kaminari/kaminari-turbo-bootstrap/_last_page.html.erb +13 -0
- data/app/views/kaminari/kaminari-turbo-bootstrap/_next_page.html.erb +13 -0
- data/app/views/kaminari/kaminari-turbo-bootstrap/_page.html.erb +14 -0
- data/app/views/kaminari/kaminari-turbo-bootstrap/_paginator.html.erb +27 -0
- data/app/views/kaminari/kaminari-turbo-bootstrap/_prev_page.html.erb +14 -0
- data/app/views/layouts/loggable_activity/application.html.erb +19 -0
- data/app/views/loggable_activity/activities/_activities.html.erb +56 -0
- data/app/views/loggable_activity/activities/index.html.erb +7 -0
- data/app/views/loggable_activity/activities/show.html.erb +2 -0
- data/config/initializers/kaminari_config.rb +14 -0
- data/config/routes.rb +7 -0
- data/{lib/generators/loggable_activity/templates/create_loggable_activities.rb → db/migrate/20240702092648_create_loggable_activity_tables.rb} +18 -10
- data/git-org/HEAD +1 -0
- data/git-org/config +7 -0
- data/git-org/description +1 -0
- data/git-org/hooks/applypatch-msg.sample +15 -0
- data/git-org/hooks/commit-msg.sample +24 -0
- data/git-org/hooks/fsmonitor-watchman.sample +174 -0
- data/git-org/hooks/post-update.sample +8 -0
- data/git-org/hooks/pre-applypatch.sample +14 -0
- data/git-org/hooks/pre-commit.sample +49 -0
- data/git-org/hooks/pre-merge-commit.sample +13 -0
- data/git-org/hooks/pre-push.sample +53 -0
- data/git-org/hooks/pre-rebase.sample +169 -0
- data/git-org/hooks/pre-receive.sample +24 -0
- data/git-org/hooks/prepare-commit-msg.sample +42 -0
- data/git-org/hooks/push-to-checkout.sample +78 -0
- data/git-org/hooks/update.sample +128 -0
- data/git-org/info/exclude +6 -0
- data/lib/loggable_activity/activity.rb +3 -3
- data/lib/{schemas → loggable_activity}/config_schema.json +3 -3
- data/lib/loggable_activity/configuration.rb +51 -74
- data/lib/loggable_activity/data_owner.rb +0 -1
- data/lib/loggable_activity/encryption.rb +16 -7
- data/lib/loggable_activity/encryption_key.rb +4 -7
- data/lib/loggable_activity/engine.rb +27 -0
- data/lib/loggable_activity/error.rb +0 -10
- data/lib/loggable_activity/hooks.rb +10 -5
- data/lib/loggable_activity/payload.rb +8 -11
- data/lib/loggable_activity/sanitizer.rb +6 -2
- data/lib/loggable_activity/services/base_payloads_builder.rb +14 -5
- data/lib/loggable_activity/services/destroy_payloads_builder.rb +2 -1
- data/lib/loggable_activity/services/payloads_builder.rb +9 -2
- data/lib/loggable_activity/services/update_payloads_builder.rb +30 -2
- data/lib/loggable_activity/version.rb +1 -1
- data/lib/loggable_activity.rb +51 -14
- data/lib/tasks/loggable_activity_tasks.rake +6 -0
- metadata +126 -114
- data/.document +0 -1
- data/.nojekyll +0 -1
- data/.rspec +0 -3
- data/CONSIDERTIONS.md +0 -129
- data/GETTING-STARTED.md +0 -119
- data/LICENSE.txt +0 -21
- data/PAYLOAD_EXAMPLE.md +0 -63
- data/ROADMAP.md +0 -23
- data/docs/LoggableActivity/Activity.html +0 -555
- data/docs/LoggableActivity/Configuration.html +0 -330
- data/docs/LoggableActivity/ConfigurationError.html +0 -148
- data/docs/LoggableActivity/DataOwner.html +0 -138
- data/docs/LoggableActivity/Encryption.html +0 -234
- data/docs/LoggableActivity/EncryptionError.html +0 -145
- data/docs/LoggableActivity/EncryptionKey.html +0 -351
- data/docs/LoggableActivity/Error.html +0 -145
- data/docs/LoggableActivity/Hooks.html +0 -759
- data/docs/LoggableActivity/Payload.html +0 -432
- data/docs/LoggableActivity/Services/BasePayloadsBuilder.html +0 -442
- data/docs/LoggableActivity/Services/DestroyPayloadsBuilder.html +0 -395
- data/docs/LoggableActivity/Services/PayloadsBuilder.html +0 -342
- data/docs/LoggableActivity/Services/UpdatePayloadsBuilder.html +0 -490
- data/docs/LoggableActivity/Services.html +0 -93
- data/docs/LoggableActivity.html +0 -102
- data/docs/created.rid +0 -14
- data/docs/css/fonts.css +0 -167
- data/docs/css/rdoc.css +0 -687
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +0 -99
- data/docs/js/darkfish.js +0 -97
- data/docs/js/navigation.js +0 -105
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +0 -110
- data/docs/js/search_index.js +0 -1
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +0 -229
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +0 -617
- data/help/loggable_activity_help.txt +0 -19
- data/lib/generators/.DS_Store +0 -0
- data/lib/generators/loggable_activity/.DS_Store +0 -0
- data/lib/generators/loggable_activity/install_generator.rb +0 -109
- data/lib/generators/loggable_activity/templates/.DS_Store +0 -0
- data/lib/generators/loggable_activity/templates/binary_ids/create_loggable_activities.rb +0 -30
- data/lib/generators/loggable_activity/templates/config/locales/loggable_activity.en.yml +0 -36
- data/lib/generators/loggable_activity/templates/config/loggable_activity.yaml +0 -29
- data/lib/generators/loggable_activity/templates/loggable_activity.en.yaml +0 -36
- data/pkg/loggable_activity-0.1.35.gem +0 -0
- data/sig/loggable_activity.rbs +0 -4
- /data/{.rspec_status → app/assets/images/loggable_activity/.keep} +0 -0
- /data/lib/{generators/loggable_activity/templates → loggable_activity/concerns}/current_user.rb +0 -0
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loggable_activity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Max \nGroenlund"
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -25,87 +25,99 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 7.1.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bootstrap
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '5.3'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
36
|
+
version: 5.3.3
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '
|
43
|
+
version: '5.3'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 5.3.3
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: json-schema
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: '4.1'
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 4.1.1
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
61
|
- - "~>"
|
59
62
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
63
|
+
version: '4.1'
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 4.1.1
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
68
|
+
name: kaminari
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
64
70
|
requirements:
|
65
71
|
- - "~>"
|
66
72
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
68
|
-
|
73
|
+
version: '1.2'
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 1.2.2
|
77
|
+
type: :runtime
|
69
78
|
prerelease: false
|
70
79
|
version_requirements: !ruby/object:Gem::Requirement
|
71
80
|
requirements:
|
72
81
|
- - "~>"
|
73
82
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
83
|
+
version: '1.2'
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 1.2.2
|
75
87
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
88
|
+
name: rails
|
77
89
|
requirement: !ruby/object:Gem::Requirement
|
78
90
|
requirements:
|
79
91
|
- - "~>"
|
80
92
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
82
|
-
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: 6.1.1
|
85
|
-
type: :development
|
93
|
+
version: 7.1.2
|
94
|
+
type: :runtime
|
86
95
|
prerelease: false
|
87
96
|
version_requirements: !ruby/object:Gem::Requirement
|
88
97
|
requirements:
|
89
98
|
- - "~>"
|
90
99
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
92
|
-
- - ">="
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: 6.1.1
|
100
|
+
version: 7.1.2
|
95
101
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
102
|
+
name: sassc-rails
|
97
103
|
requirement: !ruby/object:Gem::Requirement
|
98
104
|
requirements:
|
99
105
|
- - "~>"
|
100
106
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
102
|
-
|
107
|
+
version: '2.1'
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.1.2
|
111
|
+
type: :runtime
|
103
112
|
prerelease: false
|
104
113
|
version_requirements: !ruby/object:Gem::Requirement
|
105
114
|
requirements:
|
106
115
|
- - "~>"
|
107
116
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
117
|
+
version: '2.1'
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 2.1.2
|
109
121
|
- !ruby/object:Gem::Dependency
|
110
122
|
name: sqlite3
|
111
123
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,7 +153,7 @@ dependencies:
|
|
141
153
|
- !ruby/object:Gem::Version
|
142
154
|
version: 1.9.2
|
143
155
|
- !ruby/object:Gem::Dependency
|
144
|
-
name:
|
156
|
+
name: factory_bot_rails
|
145
157
|
requirement: !ruby/object:Gem::Requirement
|
146
158
|
requirements:
|
147
159
|
- - "~>"
|
@@ -149,7 +161,7 @@ dependencies:
|
|
149
161
|
version: '6.4'
|
150
162
|
- - ">="
|
151
163
|
- !ruby/object:Gem::Version
|
152
|
-
version: 6.4.
|
164
|
+
version: 6.4.3
|
153
165
|
type: :development
|
154
166
|
prerelease: false
|
155
167
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -159,7 +171,41 @@ dependencies:
|
|
159
171
|
version: '6.4'
|
160
172
|
- - ">="
|
161
173
|
- !ruby/object:Gem::Version
|
162
|
-
version: 6.4.
|
174
|
+
version: 6.4.3
|
175
|
+
- !ruby/object:Gem::Dependency
|
176
|
+
name: faker
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - "~>"
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '3.4'
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: 3.4.1
|
185
|
+
type: :development
|
186
|
+
prerelease: false
|
187
|
+
version_requirements: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - "~>"
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: '3.4'
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 3.4.1
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: mocha
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '2.4'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '2.4'
|
163
209
|
- !ruby/object:Gem::Dependency
|
164
210
|
name: rubocop
|
165
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,100 +239,68 @@ executables: []
|
|
193
239
|
extensions: []
|
194
240
|
extra_rdoc_files: []
|
195
241
|
files:
|
196
|
-
- ".document"
|
197
|
-
- ".nojekyll"
|
198
|
-
- ".rspec"
|
199
|
-
- ".rspec_status"
|
200
242
|
- ".rubocop.yml"
|
201
243
|
- ".vscode/commands.json"
|
202
244
|
- ".vscode/terminals.json"
|
203
245
|
- CHANGELOG.md
|
246
|
+
- CHEAT_SHEET.md
|
204
247
|
- CODE_OF_CONDUCT.md
|
205
|
-
-
|
206
|
-
- GETTING-STARTED.md
|
207
|
-
- LICENSE.txt
|
208
|
-
- PAYLOAD_EXAMPLE.md
|
248
|
+
- MIT-LICENSE
|
209
249
|
- README.md
|
210
|
-
- ROADMAP.md
|
211
250
|
- Rakefile
|
212
|
-
-
|
213
|
-
-
|
214
|
-
-
|
215
|
-
-
|
216
|
-
-
|
217
|
-
-
|
218
|
-
-
|
219
|
-
-
|
220
|
-
-
|
221
|
-
-
|
222
|
-
-
|
223
|
-
-
|
224
|
-
-
|
225
|
-
-
|
226
|
-
-
|
227
|
-
-
|
228
|
-
-
|
229
|
-
-
|
230
|
-
-
|
231
|
-
-
|
232
|
-
-
|
233
|
-
-
|
234
|
-
-
|
235
|
-
-
|
236
|
-
-
|
237
|
-
-
|
238
|
-
-
|
239
|
-
-
|
240
|
-
-
|
241
|
-
-
|
242
|
-
-
|
243
|
-
-
|
244
|
-
-
|
245
|
-
-
|
246
|
-
-
|
247
|
-
-
|
248
|
-
-
|
249
|
-
-
|
250
|
-
-
|
251
|
-
-
|
252
|
-
-
|
253
|
-
-
|
254
|
-
-
|
255
|
-
- docs/images/ruby.png
|
256
|
-
- docs/images/tag_blue.png
|
257
|
-
- docs/images/tag_green.png
|
258
|
-
- docs/images/transparent.png
|
259
|
-
- docs/images/wrench.png
|
260
|
-
- docs/images/wrench_orange.png
|
261
|
-
- docs/images/zoom.png
|
262
|
-
- docs/index.html
|
263
|
-
- docs/js/darkfish.js
|
264
|
-
- docs/js/navigation.js
|
265
|
-
- docs/js/navigation.js.gz
|
266
|
-
- docs/js/search.js
|
267
|
-
- docs/js/search_index.js
|
268
|
-
- docs/js/search_index.js.gz
|
269
|
-
- docs/js/searcher.js
|
270
|
-
- docs/js/searcher.js.gz
|
271
|
-
- docs/table_of_contents.html
|
272
|
-
- help/loggable_activity_help.txt
|
273
|
-
- lib/generators/.DS_Store
|
274
|
-
- lib/generators/loggable_activity/.DS_Store
|
275
|
-
- lib/generators/loggable_activity/install_generator.rb
|
276
|
-
- lib/generators/loggable_activity/templates/.DS_Store
|
277
|
-
- lib/generators/loggable_activity/templates/binary_ids/create_loggable_activities.rb
|
278
|
-
- lib/generators/loggable_activity/templates/config/locales/loggable_activity.en.yml
|
279
|
-
- lib/generators/loggable_activity/templates/config/loggable_activity.yaml
|
280
|
-
- lib/generators/loggable_activity/templates/create_loggable_activities.rb
|
281
|
-
- lib/generators/loggable_activity/templates/current_user.rb
|
282
|
-
- lib/generators/loggable_activity/templates/loggable_activity.en.yaml
|
251
|
+
- app/assets/config/loggable_activity_manifest.js
|
252
|
+
- app/assets/images/loggable_activity/.keep
|
253
|
+
- app/assets/javascripts/loggable_activity/application.js
|
254
|
+
- app/assets/stylesheets/loggable_activity/application.scss
|
255
|
+
- app/controllers/concerns/.keep
|
256
|
+
- app/controllers/loggable_activity/activities_controller.rb
|
257
|
+
- app/controllers/loggable_activity/application_controller.rb
|
258
|
+
- app/helpers/loggable_activity/activities_helper.rb
|
259
|
+
- app/helpers/loggable_activity/application_helper.rb
|
260
|
+
- app/jobs/loggable_activity/application_job.rb
|
261
|
+
- app/mailers/loggable_activity/application_mailer.rb
|
262
|
+
- app/models/loggable_activity/application_record.rb
|
263
|
+
- app/views/kaminari/kaminari-turbo-bootstrap/_first_page.html.erb
|
264
|
+
- app/views/kaminari/kaminari-turbo-bootstrap/_gap.html.erb
|
265
|
+
- app/views/kaminari/kaminari-turbo-bootstrap/_last_page.html.erb
|
266
|
+
- app/views/kaminari/kaminari-turbo-bootstrap/_next_page.html.erb
|
267
|
+
- app/views/kaminari/kaminari-turbo-bootstrap/_page.html.erb
|
268
|
+
- app/views/kaminari/kaminari-turbo-bootstrap/_paginator.html.erb
|
269
|
+
- app/views/kaminari/kaminari-turbo-bootstrap/_prev_page.html.erb
|
270
|
+
- app/views/layouts/loggable_activity/application.html.erb
|
271
|
+
- app/views/loggable_activity/activities/_activities.html.erb
|
272
|
+
- app/views/loggable_activity/activities/index.html.erb
|
273
|
+
- app/views/loggable_activity/activities/show.html.erb
|
274
|
+
- config/initializers/kaminari_config.rb
|
275
|
+
- config/routes.rb
|
276
|
+
- db/migrate/20240702092648_create_loggable_activity_tables.rb
|
277
|
+
- git-org/HEAD
|
278
|
+
- git-org/config
|
279
|
+
- git-org/description
|
280
|
+
- git-org/hooks/applypatch-msg.sample
|
281
|
+
- git-org/hooks/commit-msg.sample
|
282
|
+
- git-org/hooks/fsmonitor-watchman.sample
|
283
|
+
- git-org/hooks/post-update.sample
|
284
|
+
- git-org/hooks/pre-applypatch.sample
|
285
|
+
- git-org/hooks/pre-commit.sample
|
286
|
+
- git-org/hooks/pre-merge-commit.sample
|
287
|
+
- git-org/hooks/pre-push.sample
|
288
|
+
- git-org/hooks/pre-rebase.sample
|
289
|
+
- git-org/hooks/pre-receive.sample
|
290
|
+
- git-org/hooks/prepare-commit-msg.sample
|
291
|
+
- git-org/hooks/push-to-checkout.sample
|
292
|
+
- git-org/hooks/update.sample
|
293
|
+
- git-org/info/exclude
|
283
294
|
- lib/loggable_activity.rb
|
284
295
|
- lib/loggable_activity/.DS_Store
|
285
296
|
- lib/loggable_activity/activity.rb
|
297
|
+
- lib/loggable_activity/concerns/current_user.rb
|
298
|
+
- lib/loggable_activity/config_schema.json
|
286
299
|
- lib/loggable_activity/configuration.rb
|
287
300
|
- lib/loggable_activity/data_owner.rb
|
288
301
|
- lib/loggable_activity/encryption.rb
|
289
302
|
- lib/loggable_activity/encryption_key.rb
|
303
|
+
- lib/loggable_activity/engine.rb
|
290
304
|
- lib/loggable_activity/error.rb
|
291
305
|
- lib/loggable_activity/hooks.rb
|
292
306
|
- lib/loggable_activity/payload.rb
|
@@ -296,9 +310,7 @@ files:
|
|
296
310
|
- lib/loggable_activity/services/payloads_builder.rb
|
297
311
|
- lib/loggable_activity/services/update_payloads_builder.rb
|
298
312
|
- lib/loggable_activity/version.rb
|
299
|
-
- lib/
|
300
|
-
- pkg/loggable_activity-0.1.35.gem
|
301
|
-
- sig/loggable_activity.rbs
|
313
|
+
- lib/tasks/loggable_activity_tasks.rake
|
302
314
|
homepage: https://loggableactivity-efe7b931c886.herokuapp.com/
|
303
315
|
licenses:
|
304
316
|
- MIT
|
data/.document
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
lib/loggable_activity
|
data/.nojekyll
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
- keep
|
data/.rspec
DELETED
data/CONSIDERTIONS.md
DELETED
@@ -1,129 +0,0 @@
|
|
1
|
-
# Considerations, Work in progress.
|
2
|
-
This document is stored here and might deleted<br/>
|
3
|
-
<br/>
|
4
|
-
It should be easy to configure and use the *LoggablActivity* without having to collect and format data all over the system.<br/>
|
5
|
-
It should also be possible to delete a data owner and then all data related to that data owner should be inaccessible.
|
6
|
-
|
7
|
-
|
8
|
-
### Protection of data that belongs to a data owner
|
9
|
-
One way to protect data in a field is to encrypt it, when requested it can then be decrypted.<br/>
|
10
|
-
If the data is required permanently deleted all there is to do is to throw away the key.<br/>
|
11
|
-
Another way is to delete the content in all fields for a given data owner on request.<br/>
|
12
|
-
|
13
|
-
### Composition of data in a log entry
|
14
|
-
Lets consider an example with a user, the user has som personal information directly on the users DB Record.
|
15
|
-
The user also has a relation to an address and the user might have a couple relations to other users, friends family members etc.<br/>
|
16
|
-
All this is created from one form and when it is submitted we want to log it.
|
17
|
-
One way of do it is to collect all the data from the DB and pack it into a json payload and submit it to the log, but then we have no control of<br/>
|
18
|
-
What data is confidential and who it belongs to. So instead lets make some configurations for how data are handled.
|
19
|
-
<br/>*Example*
|
20
|
-
```
|
21
|
-
┌──────────────────────┐ ┌──────────────────────┐
|
22
|
-
│ User │ ┌──▶│ Address │
|
23
|
-
├──────────────────────┤ │ ├──────────────────────┤
|
24
|
-
│name: String │ │ │street: String │
|
25
|
-
├──────────────────────┤ │ ├──────────────────────┤
|
26
|
-
│date_of_birth: Date │ │ │city: String │
|
27
|
-
├──────────────────────┤ │ └──────────────────────┘
|
28
|
-
│address_id: Reference │──┘
|
29
|
-
├──────────────────────┤
|
30
|
-
│system_task_uuid: UUID│
|
31
|
-
└──────────────────────┘
|
32
|
-
┼
|
33
|
-
│
|
34
|
-
╱│╲
|
35
|
-
┌──────────────────────┐
|
36
|
-
│ Friend │
|
37
|
-
├──────────────────────┤
|
38
|
-
│user_a_id: Reference │
|
39
|
-
├──────────────────────┤
|
40
|
-
│user_b_id: Reference │
|
41
|
-
└──────────────────────┘
|
42
|
-
```
|
43
|
-
Then a payload could look like this
|
44
|
-
```
|
45
|
-
|
46
|
-
{
|
47
|
-
user: {
|
48
|
-
name: Sting
|
49
|
-
date_of_birth "October 2, 1951"
|
50
|
-
address: {
|
51
|
-
street: "some street",
|
52
|
-
city: "London"
|
53
|
-
},
|
54
|
-
friend: [
|
55
|
-
user: {
|
56
|
-
name: "Bob"
|
57
|
-
date_of_birth: "September 01, 1991
|
58
|
-
}
|
59
|
-
]
|
60
|
-
}
|
61
|
-
}
|
62
|
-
```
|
63
|
-
But what about Bob, he is in the system and want to have control of his own data.<br/>
|
64
|
-
To achieve this we need to organize the way we store log entries so owners can be identified even within a payload.
|
65
|
-
```
|
66
|
-
┌────────────────────────┐
|
67
|
-
│ Activity │
|
68
|
-
├────────────────────────┤
|
69
|
-
│key: String │
|
70
|
-
├────────────────────────┤
|
71
|
-
│who_did_it_type: String │
|
72
|
-
├────────────────────────┤
|
73
|
-
│who_did_it_id: UUID │
|
74
|
-
├────────────────────────┤
|
75
|
-
│time: DateTime │
|
76
|
-
└────────────────────────┘
|
77
|
-
┼
|
78
|
-
│
|
79
|
-
│
|
80
|
-
╱│╲
|
81
|
-
┌────────────────────────┐
|
82
|
-
│ Payload │
|
83
|
-
├────────────────────────┤
|
84
|
-
│data: Json │
|
85
|
-
├────────────────────────┤
|
86
|
-
│record_id: UUID │
|
87
|
-
├────────────────────────┤
|
88
|
-
│record_type: String │
|
89
|
-
└────────────────────────┘
|
90
|
-
```
|
91
|
-
So now we can control access to Bobs data in the Logging DB
|
92
|
-
|
93
|
-
### example of how a `Loggable::Activity` is formatted for the view
|
94
|
-
```
|
95
|
-
activity = Loggable::Activity.lastest.last
|
96
|
-
activity.attrs ==>
|
97
|
-
|
98
|
-
payloads: [
|
99
|
-
primary: {
|
100
|
-
name: "User",
|
101
|
-
changes: {
|
102
|
-
attrs: {
|
103
|
-
first_name: {
|
104
|
-
from: "Bob",
|
105
|
-
to: "Rob"
|
106
|
-
}
|
107
|
-
}
|
108
|
-
}
|
109
|
-
}
|
110
|
-
relations: [
|
111
|
-
name: "Demo::Address
|
112
|
-
changes: {
|
113
|
-
street: {
|
114
|
-
from: "5th Avenue",
|
115
|
-
to: "Broadway"
|
116
|
-
}
|
117
|
-
}
|
118
|
-
]
|
119
|
-
]
|
120
|
-
|
121
|
-
|
122
|
-
```
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
data/GETTING-STARTED.md
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
# Getting started
|
2
|
-
This document should you getting started with `LoggableActivity`
|
3
|
-
|
4
|
-
## Prerequisite
|
5
|
-
1 A running Rails Application<br/>
|
6
|
-
2 An authorization system where there is a current user available.
|
7
|
-
|
8
|
-
## Demo Application
|
9
|
-
You can download a demo application from<br/>
|
10
|
-
[https://github.com/LoggableActivity/LoggableActivityDemoApp](https://github.com/LoggableActivity/LoggableActivityDemoApp)
|
11
|
-
<br/>
|
12
|
-
You can try a demo here<br/>
|
13
|
-
[https://loggableactivity-efe7b931c886.herokuapp.com/](https://loggableactivity-efe7b931c886.herokuapp.com/)
|
14
|
-
|
15
|
-
## Getting started
|
16
|
-
First we add the loggable_activity gem to the Gemfile `gem 'loggable_activity', '~> x.x.xx'` and then<br/>
|
17
|
-
```
|
18
|
-
$ bundle install
|
19
|
-
```
|
20
|
-
Then we have to generate some migrations and additionals files<br/>
|
21
|
-
```
|
22
|
-
$ rails generate loggable_activity:install
|
23
|
-
```
|
24
|
-
This will install the following files
|
25
|
-
- app/controllers/concerns/loggable_activity/current_user.rb
|
26
|
-
- config/loggable_activity.yml
|
27
|
-
- config/locales/loggable_activity.en.yml
|
28
|
-
- db/migrate/xxxxxxxxxxxxxx_create_loggable_activities
|
29
|
-
|
30
|
-
|
31
|
-
## Add hoks to models to be logged
|
32
|
-
```
|
33
|
-
class User < ApplicationRecord
|
34
|
-
include LoggableActivity::Hooks
|
35
|
-
```
|
36
|
-
|
37
|
-
## Configuration
|
38
|
-
Update `config/application.rb`, you might do it differently in production
|
39
|
-
```
|
40
|
-
config.loggable_activity = ActiveSupport::OrderedOptions.new
|
41
|
-
config.loggable_activity.actor_display_name = :full_name
|
42
|
-
config.loggable_activity.current_user_model_name = 'User'
|
43
|
-
::LoggableActivity::Configuration.load_config_file('config/loggable_activity.yaml')
|
44
|
-
```
|
45
|
-
- actor_display_name: this is a method on the User model we want to use when presenting the actor.
|
46
|
-
- current_user_model: This is the name of the model we use for current_user
|
47
|
-
- load_config_file: this is the configuration we will look at next.
|
48
|
-
|
49
|
-
## loggable_activity.yaml
|
50
|
-
You have to update the configuration file installed inside the `config/loggable_activity.yaml`
|
51
|
-
This file defines:
|
52
|
-
- What fields in a table to log
|
53
|
-
- What relations to include in a logged activity
|
54
|
-
- What should happen to the aggregation if a record is deleted.
|
55
|
-
- What actions to log automatically
|
56
|
-
|
57
|
-
**!Catch**<br/>
|
58
|
-
`show` can not `auto_log` so it has to be handled manually, more about that later.<br/>
|
59
|
-
*Here is an example of content for the config/loggable_activity.yaml file*
|
60
|
-
```
|
61
|
-
Demo::Club:
|
62
|
-
record_display_name: email
|
63
|
-
route: show_demo_club
|
64
|
-
loggable_attrs:
|
65
|
-
- email
|
66
|
-
- name
|
67
|
-
auto_log:
|
68
|
-
- create
|
69
|
-
- update
|
70
|
-
- destroy
|
71
|
-
relations:
|
72
|
-
- belongs_to: :address
|
73
|
-
model: Demo::Address
|
74
|
-
route: show_address
|
75
|
-
loggable_attrs:
|
76
|
-
- street
|
77
|
-
- city
|
78
|
-
```
|
79
|
-
|
80
|
-
Lets break this down.
|
81
|
-
- First we can se that we are logging a model named Demo::Club.
|
82
|
-
- `record_display_name:` is the field/method on the on the model we want to display as a headline in the log
|
83
|
-
- `route` is a flag used to generate a link to the model logged, more on that later.
|
84
|
-
- Then we can se that we are logging the `email` and `name`.
|
85
|
-
- Then we can se that we are logging `create`, `update`, and `destroy` automatically.
|
86
|
-
- Then there are some relations: that we want to collect and add to the log.<br/>
|
87
|
-
In this example the club belongs to an address so we add the street and city from the address to the log.
|
88
|
-
|
89
|
-
|
90
|
-
## Set current user
|
91
|
-
Add a this to the application_controller.rb
|
92
|
-
```
|
93
|
-
class ApplicationController < ActionController::Base
|
94
|
-
include LoggableActivity::CurrentUser
|
95
|
-
```
|
96
|
-
If there is not current_user nothing will be logged. <br/>
|
97
|
-
You can look inside `app/controllers/concerns/current_user.rb` and alter it with a default `current_user` if needed.
|
98
|
-
|
99
|
-
## Log the show action
|
100
|
-
As mentioned earlier, show can not be logged automatically<br/>
|
101
|
-
If you want to log the show action you can add this to your controllers show method
|
102
|
-
```
|
103
|
-
def show
|
104
|
-
@user.log(:show)
|
105
|
-
```
|
106
|
-
|
107
|
-
## Relations
|
108
|
-
Supported relations at the moment is
|
109
|
-
- belongs_to
|
110
|
-
- has_one
|
111
|
-
- has_many
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
## For developers and contributors
|
116
|
-
If you can download and play around with a demo app
|
117
|
-
- 1 Down the demo project from [demo project on github](https://github.com/LoggableActivity/LoggableActivityDemoApp)
|
118
|
-
- 2 Update the Gemfile in the demo project so it points to your localhost.
|
119
|
-
- 3 you can now build and test you version of the gem `$ gem build loggable_activity.gemspec`
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2024 Max Groenlund
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|