rails_surrogate_key_logging 1.3.0 → 1.4.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c90ffc261a0cc4de8d88266fd00e0ce40c4c5a1802cf60b2fdaa72c6d345d61
|
4
|
+
data.tar.gz: 13dfb52ddf21fd49d28930043a4c8a3160c466fb2a03dfc8e9e369ad9b0007ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc2df820cec2c3c042552fd8e9e7f16c87b5c8592228a9f8c03e9c91e40417d5c0b7cf8cb2e15d729e56837e7ec6cccbb63a75e10c8cfd633ff55c6e029a7668
|
7
|
+
data.tar.gz: 80ce2c893ef9394acec270591f2c63d4f5603d701fd12eb8562a9b23a9d07555f8af0481a0e1df92692900e080bf826025cd20f77295514e8ac5fe0186a659cd
|
@@ -17,11 +17,6 @@ module SurrogateKeyLogging
|
|
17
17
|
g.templates.unshift File.expand_path('lib/templates', root)
|
18
18
|
end
|
19
19
|
|
20
|
-
rake_tasks do
|
21
|
-
# load 'tasks/surrogate_key_logging.rake'
|
22
|
-
# load 'tasks/key_store/active_record.rake'
|
23
|
-
end
|
24
|
-
|
25
20
|
initializer 'surrogate_key_logging.config' do |app|
|
26
21
|
SurrogateKeyLogging.configure do |config|
|
27
22
|
config.enabled = Rails.env.production? unless config.key?(:enabled)
|
@@ -35,7 +30,9 @@ module SurrogateKeyLogging
|
|
35
30
|
end
|
36
31
|
|
37
32
|
initializer 'surrogate_key_logging.middleware' do |app|
|
38
|
-
|
33
|
+
if SurrogateKeyLogging.config.enabled
|
34
|
+
app.middleware.insert_before(0, Middleware)
|
35
|
+
end
|
39
36
|
end
|
40
37
|
|
41
38
|
initializer 'surrogate_key_logging.filter_parameters' do
|
@@ -53,5 +50,15 @@ module SurrogateKeyLogging
|
|
53
50
|
end
|
54
51
|
end
|
55
52
|
|
53
|
+
initializer 'surrogate_key_logging.sidekiq' do
|
54
|
+
if SurrogateKeyLogging.config.enabled && defined?(::Sidekiq)
|
55
|
+
Sidekiq.configure_server do |config|
|
56
|
+
config.server_middleware do |chain|
|
57
|
+
chain.prepend SurrogateKeyLogging::SidekiqMiddleware
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
56
63
|
end
|
57
64
|
end
|
@@ -41,7 +41,7 @@ module SurrogateKeyLogging
|
|
41
41
|
def reset
|
42
42
|
reset! if config.cache
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
def reset!
|
46
46
|
@key_manager = @parameter_filter = nil
|
47
47
|
end
|
@@ -55,7 +55,7 @@ module SurrogateKeyLogging
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def filter_for_attributes(attrs)
|
58
|
-
::ActiveSupport::ParameterFilter.new(attrs, mask: key_manager)
|
58
|
+
config.enabled ? ::ActiveSupport::ParameterFilter.new(attrs, mask: key_manager) : attrs
|
59
59
|
end
|
60
60
|
|
61
61
|
def key_store
|
@@ -63,11 +63,11 @@ module SurrogateKeyLogging
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def filter_parameters(params)
|
66
|
-
parameter_filter.filter params
|
66
|
+
config.enabled ? parameter_filter.filter(params) : params
|
67
67
|
end
|
68
68
|
|
69
69
|
def surrogate_for(value)
|
70
|
-
key_manager.get(value)
|
70
|
+
config.enabled ? key_manager.get(value) : value
|
71
71
|
end
|
72
72
|
|
73
73
|
def add_param_to_filter(attr, *parents)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_surrogate_key_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Yelverton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|