rdux 0.12.0 → 0.13.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb992b109d0983534ec092280239b9eb1f689f9e92f5f011047660215ab6a39a
4
- data.tar.gz: 22abeef261cd3d464361ed7b910ce8d033c611e5681f9228e631c99d88758f87
3
+ metadata.gz: 0a4732501f420e77c07dc015b11abfbd2f8c1985229772a2665cde14a99f2752
4
+ data.tar.gz: 7f35b68fa9a573ac225ad2f1aeea19139b56ee9d4a56d2618d638c2cf0cda820
5
5
  SHA512:
6
- metadata.gz: 4aa7c1246cdfd68af71e4171f1e20bab160c52a1e9d891519209a3dd2308307e87ead38b3e66ffce317136de745bfedf88a10544d970bf13e89d58528ab570cf
7
- data.tar.gz: 21b865e2527a7df5d2ab952d44fd607e3fafb8f91f116839d60de3b51f2a5ebec4660e1691e667ad70717fcc6f88fe8e233ff9473f02280fb21e9c294a29c73c
6
+ metadata.gz: b067094df508e07f8165ec5e88c094ec4c6f54bec1ddba8206ecd0bf74b2c6b1f3706c97f1ca56c8b622c68d30c20c272d993da40ce604dfb3cccfaa43084fca
7
+ data.tar.gz: 1b72e8f3b2d4cebb015957c996cee3ad10a428d7d23551ae56ccb5daf70b74f6ce556e36968a851e17fea51bb78e4ac55307f2e86c92d5376be38bb91c54d400
data/lib/rdux/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rdux
4
- VERSION = '0.12.0'
4
+ VERSION = '0.13.0'
5
5
  end
data/lib/rdux.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'rdux/engine'
4
4
  require 'rdux/result'
5
- require 'rdux/sanitize'
6
5
  require 'active_support/concern'
7
6
 
8
7
  module Rdux
@@ -80,7 +79,8 @@ module Rdux
80
79
  end
81
80
 
82
81
  def sanitize(action)
83
- up_payload_sanitized = Sanitize.call(action.up_payload)
82
+ param_filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
83
+ up_payload_sanitized = param_filter.filter(action.up_payload)
84
84
  action.up_payload_sanitized = action.up_payload != up_payload_sanitized
85
85
  action.up_payload_unsanitized = action.up_payload if action.up_payload_sanitized
86
86
  action.up_payload = up_payload_sanitized
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zbigniew Humeniuk
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-03-17 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -16,20 +15,20 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '5.0'
18
+ version: '7.0'
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '8.0'
21
+ version: '9.0'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: '5.0'
28
+ version: '7.0'
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '8.0'
31
+ version: '9.0'
33
32
  - !ruby/object:Gem::Dependency
34
33
  name: pg
35
34
  requirement: !ruby/object:Gem::Requirement
@@ -107,14 +106,12 @@ files:
107
106
  - lib/rdux.rb
108
107
  - lib/rdux/engine.rb
109
108
  - lib/rdux/result.rb
110
- - lib/rdux/sanitize.rb
111
109
  - lib/rdux/version.rb
112
110
  homepage: https://artofcode.co
113
111
  licenses:
114
112
  - MIT
115
113
  metadata:
116
114
  rubygems_mfa_required: 'true'
117
- post_install_message:
118
115
  rdoc_options: []
119
116
  require_paths:
120
117
  - lib
@@ -129,8 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
126
  - !ruby/object:Gem::Version
130
127
  version: '0'
131
128
  requirements: []
132
- rubygems_version: 3.5.16
133
- signing_key:
129
+ rubygems_version: 3.6.8
134
130
  specification_version: 4
135
131
  summary: A Minimal Event Sourcing Plugin for Rails
136
132
  test_files: []
data/lib/rdux/sanitize.rb DELETED
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rdux
4
- module Sanitize
5
- class << self
6
- def call(payload)
7
- filtered_payload = payload.deep_dup # Create a duplicate to avoid modifying the original params
8
- Rails.application.config.filter_parameters.each do |filter_param|
9
- filter_recursive(filtered_payload, filter_param)
10
- end
11
- filtered_payload
12
- end
13
-
14
- private
15
-
16
- def filter_recursive(payload, filter_param)
17
- payload.each do |key, value|
18
- if value.is_a? Hash # If the value is a nested parameter
19
- filter_recursive(value, filter_param)
20
- elsif key == filter_param.to_s # to_s is used to ensure that symbol/string difference does not matter
21
- payload[key] = '[FILTERED]'
22
- end
23
- end
24
- end
25
- end
26
- end
27
- end