loggable_activity 0.5.6 → 0.5.7
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/GETTING-STARTED.md +1 -0
- data/docker-compose.yml +27 -0
- data/docs/CHANGELOG_md.html +318 -0
- data/docs/CHEAT_SHEET_md.html +168 -0
- data/docs/CODE_OF_CONDUCT_md.html +250 -0
- data/docs/CreateLoggableActivities.html +175 -0
- data/docs/CreateLoggableActivityTables.html +173 -0
- data/docs/GETTING-STARTED_md.html +211 -0
- data/docs/Gemfile.html +153 -0
- data/docs/Gemfile_lock.html +438 -0
- data/docs/LoggableActivity/ActivitiesController.html +160 -0
- data/docs/LoggableActivity/ActivitiesHelper.html +158 -0
- data/docs/LoggableActivity/Activity.html +565 -0
- data/docs/LoggableActivity/ApplicationController.html +97 -0
- data/docs/LoggableActivity/ApplicationHelper.html +91 -0
- data/docs/LoggableActivity/ApplicationJob.html +97 -0
- data/docs/LoggableActivity/ApplicationMailer.html +97 -0
- data/docs/LoggableActivity/ApplicationRecord.html +97 -0
- data/docs/LoggableActivity/Configuration.html +237 -0
- data/docs/LoggableActivity/ConfigurationError.html +142 -0
- data/docs/LoggableActivity/CurrentActor.html +166 -0
- data/docs/LoggableActivity/DataOwner.html +138 -0
- data/docs/LoggableActivity/Encryption.html +321 -0
- data/docs/LoggableActivity/EncryptionError.html +142 -0
- data/docs/LoggableActivity/EncryptionKey.html +399 -0
- data/docs/LoggableActivity/Engine.html +108 -0
- data/docs/LoggableActivity/Error.html +142 -0
- data/docs/LoggableActivity/Generators/InstallGenerator.html +212 -0
- data/docs/LoggableActivity/Generators.html +91 -0
- data/docs/LoggableActivity/Hooks.html +841 -0
- data/docs/LoggableActivity/Payload.html +430 -0
- data/docs/LoggableActivity/Sanitizer.html +134 -0
- data/docs/LoggableActivity/Services/BasePayloadsBuilder.html +472 -0
- data/docs/LoggableActivity/Services/CustomPayloadsBuilder.html +225 -0
- data/docs/LoggableActivity/Services/DestroyPayloadsBuilder.html +396 -0
- data/docs/LoggableActivity/Services/PayloadsBuilder.html +348 -0
- data/docs/LoggableActivity/Services/UpdatePayloadsBuilder.html +540 -0
- data/docs/LoggableActivity/Services.html +93 -0
- data/docs/LoggableActivity.html +173 -0
- data/docs/MIT-LICENSE.html +132 -0
- data/docs/Object.html +110 -0
- data/docs/README_md.html +186 -0
- data/docs/Rakefile.html +134 -0
- data/docs/app/assets/config/loggable_activity_manifest_js.html +126 -0
- data/docs/app/assets/javascripts/loggable_activity/application_js.html +124 -0
- data/docs/app/assets/stylesheets/loggable_activity/activities_scss.html +154 -0
- data/docs/app/assets/stylesheets/loggable_activity/application_scss.html +142 -0
- data/docs/app/views/layouts/loggable_activity/application_html_slim.html +145 -0
- data/docs/app/views/loggable_activity/activities/_activities_html_slim.html +159 -0
- data/docs/created.rid +74 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +687 -0
- 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/git-org/HEAD.html +126 -0
- data/docs/git-org/config.html +128 -0
- data/docs/git-org/description.html +126 -0
- data/docs/git-org/hooks/applypatch-msg_sample.html +128 -0
- data/docs/git-org/hooks/commit-msg_sample.html +138 -0
- data/docs/git-org/hooks/fsmonitor-watchman_sample.html +302 -0
- data/docs/git-org/hooks/post-update_sample.html +128 -0
- data/docs/git-org/hooks/pre-applypatch_sample.html +128 -0
- data/docs/git-org/hooks/pre-commit_sample.html +174 -0
- data/docs/git-org/hooks/pre-merge-commit_sample.html +133 -0
- data/docs/git-org/hooks/pre-push_sample.html +161 -0
- data/docs/git-org/hooks/pre-rebase_sample.html +282 -0
- data/docs/git-org/hooks/pre-receive_sample.html +144 -0
- data/docs/git-org/hooks/prepare-commit-msg_sample.html +136 -0
- data/docs/git-org/hooks/push-to-checkout_sample.html +178 -0
- data/docs/git-org/hooks/update_sample.html +226 -0
- data/docs/git-org/info/exclude.html +126 -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 +166 -0
- data/docs/js/darkfish.js +97 -0
- data/docs/js/navigation.js +105 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +110 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/lib/loggable_activity/config_schema_json.html +205 -0
- data/docs/lib/tasks/loggable_activity_tasks_rake.html +128 -0
- data/docs/table_of_contents.html +954 -0
- data/lib/loggable_activity/concerns/current_actor.rb +25 -0
- data/lib/loggable_activity/hooks.rb +41 -19
- data/lib/loggable_activity/version.rb +1 -1
- data/lib/loggable_activity.rb +1 -1
- metadata +114 -3
- data/lib/loggable_activity/concerns/current_user.rb +0 -26
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class LoggableActivity::EncryptionKey - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../";
|
|
11
|
+
var index_rel_prefix = "../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
|
15
|
+
<script src="../js/search.js" defer></script>
|
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<body id="top" role="document" class="class">
|
|
25
|
+
<nav role="navigation">
|
|
26
|
+
<div id="project-navigation">
|
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
28
|
+
<h2>
|
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
|
30
|
+
</h2>
|
|
31
|
+
|
|
32
|
+
<div id="table-of-contents-navigation">
|
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
41
|
+
<div id="search-field-wrapper">
|
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
51
|
+
</form>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<div id="class-metadata">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
|
62
|
+
<h3>Parent</h3>
|
|
63
|
+
|
|
64
|
+
<p class="link">ActiveRecord::Base
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<!-- Method Quickref -->
|
|
71
|
+
<div id="method-list-section" class="nav-section">
|
|
72
|
+
<h3>Methods</h3>
|
|
73
|
+
|
|
74
|
+
<ul class="link-list" role="directory">
|
|
75
|
+
<li ><a href="#method-c-create_encryption_key">::create_encryption_key</a>
|
|
76
|
+
<li ><a href="#method-c-for_record">::for_record</a>
|
|
77
|
+
<li ><a href="#method-c-for_record_by_type_and_id">::for_record_by_type_and_id</a>
|
|
78
|
+
<li ><a href="#method-c-random_key">::random_key</a>
|
|
79
|
+
<li ><a href="#method-i-delete">#delete</a>
|
|
80
|
+
<li ><a href="#method-i-deleted-3F">#deleted?</a>
|
|
81
|
+
<li ><a href="#method-i-mark_as_deleted-21">#mark_as_deleted!</a>
|
|
82
|
+
<li ><a href="#method-i-restore-21">#restore!</a>
|
|
83
|
+
</ul>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
</nav>
|
|
88
|
+
|
|
89
|
+
<main role="main" aria-labelledby="class-LoggableActivity::EncryptionKey">
|
|
90
|
+
<h1 id="class-LoggableActivity::EncryptionKey" class="class">
|
|
91
|
+
class LoggableActivity::EncryptionKey
|
|
92
|
+
</h1>
|
|
93
|
+
|
|
94
|
+
<section class="description">
|
|
95
|
+
|
|
96
|
+
<p>This class represents the encryption key used to unlock the data for one payload. When deleted, only the encryption_key field is deleted.</p>
|
|
97
|
+
|
|
98
|
+
</section>
|
|
99
|
+
|
|
100
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
107
|
+
<header>
|
|
108
|
+
<h3>Public Class Methods</h3>
|
|
109
|
+
</header>
|
|
110
|
+
|
|
111
|
+
<div id="method-c-create_encryption_key" class="method-detail ">
|
|
112
|
+
<div class="method-header">
|
|
113
|
+
<div class="method-heading">
|
|
114
|
+
<span class="method-name">create_encryption_key</span><span
|
|
115
|
+
class="method-args">(record_type, record_id)</span>
|
|
116
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<div class="method-description">
|
|
121
|
+
<p>Creates an encryption key for a record, optionally using a parent key.</p>
|
|
122
|
+
|
|
123
|
+
<pre>@param record_type [String] The type of the record.
|
|
124
|
+
@param record_id [Integer] The ID of the record.
|
|
125
|
+
@param parent_key [::LoggableActivity::EncryptionKey, nil] The parent encryption key, if any.
|
|
126
|
+
@return [::LoggableActivity::EncryptionKey] The created encryption key.</pre>
|
|
127
|
+
|
|
128
|
+
<p>Example:</p>
|
|
129
|
+
|
|
130
|
+
<pre class="ruby"><span class="ruby-operator">::</span><span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">EncryptionKey</span>.<span class="ruby-identifier">create_encryption_key</span>(<span class="ruby-string">'User'</span>, <span class="ruby-value">1</span>)
|
|
131
|
+
</pre>
|
|
132
|
+
|
|
133
|
+
<p>Returns:</p>
|
|
134
|
+
|
|
135
|
+
<pre class="ruby">{
|
|
136
|
+
<span class="ruby-value">:id</span> <span class="ruby-operator">=></span> <span class="ruby-value">39</span>,
|
|
137
|
+
<span class="ruby-value">:parent_key_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">38</span>,
|
|
138
|
+
<span class="ruby-value">:key</span> <span class="ruby-operator">=></span> <span class="ruby-string">"a8f4774e7f42eb253045a4db7de7b79e"</span>,
|
|
139
|
+
<span class="ruby-value">:record_type</span> <span class="ruby-operator">=></span> <span class="ruby-string">"User"</span>,
|
|
140
|
+
<span class="ruby-value">:record_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">1</span>
|
|
141
|
+
}
|
|
142
|
+
</pre>
|
|
143
|
+
|
|
144
|
+
<div class="method-source-code" id="create_encryption_key-source">
|
|
145
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 109</span>
|
|
146
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">create_encryption_key</span>(<span class="ruby-identifier">record_type</span>, <span class="ruby-identifier">record_id</span>)
|
|
147
|
+
<span class="ruby-identifier">create</span>(<span class="ruby-value">record_type:</span>, <span class="ruby-value">record_id:</span>, <span class="ruby-value">secret_key:</span> <span class="ruby-identifier">random_key</span>)
|
|
148
|
+
<span class="ruby-keyword">end</span></pre>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div id="method-c-for_record" class="method-detail ">
|
|
156
|
+
<div class="method-header">
|
|
157
|
+
<div class="method-heading">
|
|
158
|
+
<span class="method-name">for_record</span><span
|
|
159
|
+
class="method-args">(record)</span>
|
|
160
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div class="method-description">
|
|
165
|
+
<p>Returns an encryption key for a record, optionally using a parent key.</p>
|
|
166
|
+
|
|
167
|
+
<pre>@param record [ActiveRecord::Base] The record for which to get the encryption key.
|
|
168
|
+
@param parent_key [::LoggableActivity::EncryptionKey, nil] The parent encryption key, if any.
|
|
169
|
+
@return [::LoggableActivity::EncryptionKey] The encryption key for the record.</pre>
|
|
170
|
+
|
|
171
|
+
<p>Example:</p>
|
|
172
|
+
|
|
173
|
+
<pre class="ruby"><span class="ruby-identifier">user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value">1</span>)
|
|
174
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">EncryptionKey</span>.<span class="ruby-identifier">for_record</span>(<span class="ruby-identifier">user</span>)
|
|
175
|
+
</pre>
|
|
176
|
+
|
|
177
|
+
<p>Returns:</p>
|
|
178
|
+
|
|
179
|
+
<pre class="ruby">{
|
|
180
|
+
<span class="ruby-value">:id</span> <span class="ruby-operator">=></span> <span class="ruby-value">39</span>,
|
|
181
|
+
<span class="ruby-value">:parent_key_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">38</span>,
|
|
182
|
+
<span class="ruby-value">:key</span> <span class="ruby-operator">=></span> <span class="ruby-string">"a8f4774e7f42eb253045a4db7de7b79e"</span>,
|
|
183
|
+
<span class="ruby-value">:record_type</span> <span class="ruby-operator">=></span> <span class="ruby-string">"User"</span>,
|
|
184
|
+
<span class="ruby-value">:record_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">1</span>
|
|
185
|
+
}
|
|
186
|
+
</pre>
|
|
187
|
+
|
|
188
|
+
<div class="method-source-code" id="for_record-source">
|
|
189
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 81</span>
|
|
190
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">for_record</span>(<span class="ruby-identifier">record</span>)
|
|
191
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">nil?</span>
|
|
192
|
+
|
|
193
|
+
<span class="ruby-identifier">encryption_key</span> = <span class="ruby-identifier">find_by</span>(<span class="ruby-value">record:</span>)
|
|
194
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">encryption_key</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">encryption_key</span>
|
|
195
|
+
|
|
196
|
+
<span class="ruby-identifier">create_encryption_key</span>(<span class="ruby-identifier">record</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">record</span>.<span class="ruby-identifier">id</span>)
|
|
197
|
+
<span class="ruby-keyword">end</span></pre>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<div id="method-c-for_record_by_type_and_id" class="method-detail ">
|
|
205
|
+
<div class="method-header">
|
|
206
|
+
<div class="method-heading">
|
|
207
|
+
<span class="method-name">for_record_by_type_and_id</span><span
|
|
208
|
+
class="method-args">(record_type, record_id)</span>
|
|
209
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
|
|
213
|
+
<div class="method-description">
|
|
214
|
+
<p>Returns an encryption key for a record by its type and ID, optionally using a parent key.</p>
|
|
215
|
+
|
|
216
|
+
<pre>@param record_type [String] The type of the record.
|
|
217
|
+
@param record_id [Integer] The ID of the record.
|
|
218
|
+
@param parent_key [::LoggableActivity::EncryptionKey, nil] The parent encryption key, if any.
|
|
219
|
+
@return [::LoggableActivity::EncryptionKey] The encryption key for the record.</pre>
|
|
220
|
+
|
|
221
|
+
<p>Example:</p>
|
|
222
|
+
|
|
223
|
+
<pre class="ruby"><span class="ruby-operator">::</span><span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">EncryptionKey</span>.<span class="ruby-identifier">for_record_by_type_and_id</span>(<span class="ruby-string">'User'</span>, <span class="ruby-value">1</span>)
|
|
224
|
+
</pre>
|
|
225
|
+
|
|
226
|
+
<p>Returns:</p>
|
|
227
|
+
|
|
228
|
+
<pre class="ruby">{
|
|
229
|
+
<span class="ruby-value">:id</span> <span class="ruby-operator">=></span> <span class="ruby-value">39</span>,
|
|
230
|
+
<span class="ruby-value">:parent_key_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">38</span>,
|
|
231
|
+
<span class="ruby-value">:key</span> <span class="ruby-operator">=></span> <span class="ruby-string">"a8f4774e7f42eb253045a4db7de7b79e"</span>,
|
|
232
|
+
<span class="ruby-value">:record_type</span> <span class="ruby-operator">=></span> <span class="ruby-string">"User"</span>,
|
|
233
|
+
<span class="ruby-value">:record_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">1</span>
|
|
234
|
+
}
|
|
235
|
+
</pre>
|
|
236
|
+
|
|
237
|
+
<div class="method-source-code" id="for_record_by_type_and_id-source">
|
|
238
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 55</span>
|
|
239
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">for_record_by_type_and_id</span>(<span class="ruby-identifier">record_type</span>, <span class="ruby-identifier">record_id</span>)
|
|
240
|
+
<span class="ruby-identifier">encryption_key</span> = <span class="ruby-identifier">find_by</span>(<span class="ruby-value">record_type:</span>, <span class="ruby-value">record_id:</span>)
|
|
241
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">encryption_key</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">encryption_key</span>
|
|
242
|
+
|
|
243
|
+
<span class="ruby-identifier">create_encryption_key</span>(<span class="ruby-identifier">record_type</span>, <span class="ruby-identifier">record_id</span>)
|
|
244
|
+
<span class="ruby-keyword">end</span></pre>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
<div id="method-c-random_key" class="method-detail ">
|
|
252
|
+
<div class="method-header">
|
|
253
|
+
<div class="method-heading">
|
|
254
|
+
<span class="method-name">random_key</span><span
|
|
255
|
+
class="method-args">()</span>
|
|
256
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<div class="method-description">
|
|
261
|
+
<p>Generates a random encryption key.</p>
|
|
262
|
+
|
|
263
|
+
<pre>@return [String] The generated encryption key.</pre>
|
|
264
|
+
|
|
265
|
+
<p>Example:</p>
|
|
266
|
+
|
|
267
|
+
<pre class="ruby"><span class="ruby-operator">::</span><span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">EncryptionKey</span>.<span class="ruby-identifier">random_key</span>
|
|
268
|
+
</pre>
|
|
269
|
+
|
|
270
|
+
<p>Returns:</p>
|
|
271
|
+
|
|
272
|
+
<pre class="ruby"><span class="ruby-string">"a8f4774e7f42eb253045a4db7de7b79e"</span>
|
|
273
|
+
</pre>
|
|
274
|
+
|
|
275
|
+
<div class="method-source-code" id="random_key-source">
|
|
276
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 123</span>
|
|
277
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">random_key</span>
|
|
278
|
+
<span class="ruby-comment"># Generate 32 random bytes (256 bits) directly</span>
|
|
279
|
+
<span class="ruby-identifier">encryption_key</span> = <span class="ruby-constant">SecureRandom</span>.<span class="ruby-identifier">random_bytes</span>(<span class="ruby-value">32</span>)
|
|
280
|
+
<span class="ruby-comment"># Encode the key in Base64 to ensure it's in a transferable format</span>
|
|
281
|
+
<span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">encryption_key</span>).<span class="ruby-identifier">strip</span>
|
|
282
|
+
<span class="ruby-keyword">end</span></pre>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
</section>
|
|
290
|
+
|
|
291
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
292
|
+
<header>
|
|
293
|
+
<h3>Public Instance Methods</h3>
|
|
294
|
+
</header>
|
|
295
|
+
|
|
296
|
+
<div id="method-i-delete" class="method-detail ">
|
|
297
|
+
<div class="method-header">
|
|
298
|
+
<div class="method-heading">
|
|
299
|
+
<span class="method-name">delete</span><span
|
|
300
|
+
class="method-args">()</span>
|
|
301
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
<div class="method-description">
|
|
306
|
+
<p>Delete the encryption key by updating the key to nil. Nullify the delete_at field, so the key is not deleted when the sanitization task runs.</p>
|
|
307
|
+
|
|
308
|
+
<div class="method-source-code" id="delete-source">
|
|
309
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 27</span>
|
|
310
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete</span>
|
|
311
|
+
<span class="ruby-identifier">update</span>(<span class="ruby-value">secret_key:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">delete_at:</span> <span class="ruby-keyword">nil</span>)
|
|
312
|
+
<span class="ruby-keyword">end</span></pre>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
<div id="method-i-deleted-3F" class="method-detail ">
|
|
320
|
+
<div class="method-header">
|
|
321
|
+
<div class="method-heading">
|
|
322
|
+
<span class="method-name">deleted?</span><span
|
|
323
|
+
class="method-args">()</span>
|
|
324
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
<div class="method-description">
|
|
329
|
+
<p>check if the encryption key is deleted or it is about to be deleted</p>
|
|
330
|
+
|
|
331
|
+
<div class="method-source-code" id="deleted-3F-source">
|
|
332
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 21</span>
|
|
333
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">deleted?</span>
|
|
334
|
+
<span class="ruby-identifier">secret_key</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">delete_at</span>.<span class="ruby-identifier">present?</span>
|
|
335
|
+
<span class="ruby-keyword">end</span></pre>
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
</div>
|
|
341
|
+
|
|
342
|
+
<div id="method-i-mark_as_deleted-21" class="method-detail ">
|
|
343
|
+
<div class="method-header">
|
|
344
|
+
<div class="method-heading">
|
|
345
|
+
<span class="method-name">mark_as_deleted!</span><span
|
|
346
|
+
class="method-args">()</span>
|
|
347
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<div class="method-description">
|
|
352
|
+
<p>Prepare the record for deletion</p>
|
|
353
|
+
|
|
354
|
+
<div class="method-source-code" id="mark_as_deleted-21-source">
|
|
355
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 16</span>
|
|
356
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mark_as_deleted!</span>
|
|
357
|
+
<span class="ruby-constant">LoggableActivity</span>.<span class="ruby-identifier">task_for_sanitization</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">update</span>(<span class="ruby-value">delete_at:</span> <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>.<span class="ruby-identifier">month</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">delete</span>
|
|
358
|
+
<span class="ruby-keyword">end</span></pre>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
</div>
|
|
364
|
+
|
|
365
|
+
<div id="method-i-restore-21" class="method-detail ">
|
|
366
|
+
<div class="method-header">
|
|
367
|
+
<div class="method-heading">
|
|
368
|
+
<span class="method-name">restore!</span><span
|
|
369
|
+
class="method-args">()</span>
|
|
370
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
<div class="method-description">
|
|
375
|
+
<p>Restores the encryption key by updating the delete_at field to nil.</p>
|
|
376
|
+
|
|
377
|
+
<div class="method-source-code" id="restore-21-source">
|
|
378
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 32</span>
|
|
379
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">restore!</span>
|
|
380
|
+
<span class="ruby-identifier">update</span>(<span class="ruby-value">delete_at:</span> <span class="ruby-keyword">nil</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">delete_at</span> <span class="ruby-operator">&&</span> <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">delete_at</span>
|
|
381
|
+
<span class="ruby-keyword">end</span></pre>
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
</div>
|
|
387
|
+
|
|
388
|
+
</section>
|
|
389
|
+
|
|
390
|
+
</section>
|
|
391
|
+
</main>
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
<footer id="validator-badges" role="contentinfo">
|
|
395
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
396
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
|
397
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
398
|
+
</footer>
|
|
399
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class LoggableActivity::Engine - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../";
|
|
11
|
+
var index_rel_prefix = "../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
|
15
|
+
<script src="../js/search.js" defer></script>
|
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<body id="top" role="document" class="class">
|
|
25
|
+
<nav role="navigation">
|
|
26
|
+
<div id="project-navigation">
|
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
28
|
+
<h2>
|
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
|
30
|
+
</h2>
|
|
31
|
+
|
|
32
|
+
<div id="table-of-contents-navigation">
|
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
41
|
+
<div id="search-field-wrapper">
|
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
51
|
+
</form>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<div id="class-metadata">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
|
62
|
+
<h3>Parent</h3>
|
|
63
|
+
|
|
64
|
+
<p class="link">Rails::Engine
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</div>
|
|
71
|
+
</nav>
|
|
72
|
+
|
|
73
|
+
<main role="main" aria-labelledby="class-LoggableActivity::Engine">
|
|
74
|
+
<h1 id="class-LoggableActivity::Engine" class="class">
|
|
75
|
+
class LoggableActivity::Engine
|
|
76
|
+
</h1>
|
|
77
|
+
|
|
78
|
+
<section class="description">
|
|
79
|
+
|
|
80
|
+
<p><a href="Engine.html"><code>Engine</code></a></p>
|
|
81
|
+
|
|
82
|
+
<p>This module defines the <a href="../LoggableActivity.html"><code>LoggableActivity</code></a> engine for use within a Rails application. It leverages Rails::Engine to create an isolated namespace, ensuring that the components of the <a href="../LoggableActivity.html"><code>LoggableActivity</code></a> engine (such as models, controllers, and views) do not interfere with those of the host application or other engines.</p>
|
|
83
|
+
|
|
84
|
+
<p>Example Usage: In a Rails application, you can mount this engine to make its functionality available:</p>
|
|
85
|
+
|
|
86
|
+
<pre class="ruby"><span class="ruby-identifier">mount</span> <span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">Engine</span>, <span class="ruby-value">at:</span> <span class="ruby-string">"/loggable_activity"</span>
|
|
87
|
+
</pre>
|
|
88
|
+
|
|
89
|
+
<p>This will allow the application to utilize the features provided by the <a href="../LoggableActivity.html"><code>LoggableActivity</code></a> engine under the specified mount path.</p>
|
|
90
|
+
|
|
91
|
+
</section>
|
|
92
|
+
|
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
</section>
|
|
100
|
+
</main>
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
<footer id="validator-badges" role="contentinfo">
|
|
104
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
105
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
|
106
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
107
|
+
</footer>
|
|
108
|
+
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class LoggableActivity::Error - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../";
|
|
11
|
+
var index_rel_prefix = "../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
|
15
|
+
<script src="../js/search.js" defer></script>
|
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<body id="top" role="document" class="class">
|
|
25
|
+
<nav role="navigation">
|
|
26
|
+
<div id="project-navigation">
|
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
28
|
+
<h2>
|
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
|
30
|
+
</h2>
|
|
31
|
+
|
|
32
|
+
<div id="table-of-contents-navigation">
|
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
41
|
+
<div id="search-field-wrapper">
|
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
51
|
+
</form>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<div id="class-metadata">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
|
62
|
+
<h3>Parent</h3>
|
|
63
|
+
|
|
64
|
+
<p class="link">StandardError
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<!-- Method Quickref -->
|
|
71
|
+
<div id="method-list-section" class="nav-section">
|
|
72
|
+
<h3>Methods</h3>
|
|
73
|
+
|
|
74
|
+
<ul class="link-list" role="directory">
|
|
75
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
|
76
|
+
</ul>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
</div>
|
|
80
|
+
</nav>
|
|
81
|
+
|
|
82
|
+
<main role="main" aria-labelledby="class-LoggableActivity::Error">
|
|
83
|
+
<h1 id="class-LoggableActivity::Error" class="class">
|
|
84
|
+
class LoggableActivity::Error
|
|
85
|
+
</h1>
|
|
86
|
+
|
|
87
|
+
<section class="description">
|
|
88
|
+
|
|
89
|
+
<p><a href="Error.html"><code>Error</code></a> class for loggable activity.</p>
|
|
90
|
+
|
|
91
|
+
</section>
|
|
92
|
+
|
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
100
|
+
<header>
|
|
101
|
+
<h3>Public Class Methods</h3>
|
|
102
|
+
</header>
|
|
103
|
+
|
|
104
|
+
<div id="method-c-new" class="method-detail ">
|
|
105
|
+
<div class="method-header">
|
|
106
|
+
<div class="method-heading">
|
|
107
|
+
<span class="method-name">new</span><span
|
|
108
|
+
class="method-args">(msg = '')</span>
|
|
109
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<div class="method-description">
|
|
114
|
+
|
|
115
|
+
<div class="method-calls-super">
|
|
116
|
+
Calls superclass method
|
|
117
|
+
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<div class="method-source-code" id="new-source">
|
|
121
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/error.rb, line 6</span>
|
|
122
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">msg</span> = <span class="ruby-string">''</span>)
|
|
123
|
+
<span class="ruby-keyword">super</span>
|
|
124
|
+
<span class="ruby-keyword">end</span></pre>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
</section>
|
|
132
|
+
|
|
133
|
+
</section>
|
|
134
|
+
</main>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<footer id="validator-badges" role="contentinfo">
|
|
138
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
139
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
|
140
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
141
|
+
</footer>
|
|
142
|
+
|