Class: Sentry::EventScrubber
- Inherits:
-
Object
- Object
- Sentry::EventScrubber
- Defined in:
- lib/sentry/event_scrubber.rb
Instance Method Summary collapse
- #cleaned_event ⇒ Object
- #email_sanitizer ⇒ Object private
- #filter_request_body ⇒ Object private
-
#initialize(event, _hint) ⇒ EventScrubber
constructor
A new instance of EventScrubber.
- #log_as_warning ⇒ Object private
- #pii_sanitizer ⇒ Object private
- #scrub_with(event:, scrubber:) ⇒ Object private
-
#scrubbers ⇒ Object
NOTE: Unsure if the order matters.
Constructor Details
#initialize(event, _hint) ⇒ EventScrubber
Returns a new instance of EventScrubber.
12 13 14 |
# File 'lib/sentry/event_scrubber.rb', line 12 def initialize(event, _hint) @unclean_event = event end |
Instance Method Details
#cleaned_event ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/sentry/event_scrubber.rb', line 16 def cleaned_event event = @unclean_event scrubbers.each do |scrubber| event = scrub_with(event:, scrubber:) end event end |
#email_sanitizer ⇒ Object (private)
35 36 37 |
# File 'lib/sentry/event_scrubber.rb', line 35 def email_sanitizer Scrubbers::EmailSanitizer.new end |
#filter_request_body ⇒ Object (private)
47 48 49 |
# File 'lib/sentry/event_scrubber.rb', line 47 def filter_request_body Scrubbers::FilterRequestBody.new end |
#log_as_warning ⇒ Object (private)
43 44 45 |
# File 'lib/sentry/event_scrubber.rb', line 43 def log_as_warning Scrubbers::LogAsWarning.new end |
#pii_sanitizer ⇒ Object (private)
39 40 41 |
# File 'lib/sentry/event_scrubber.rb', line 39 def pii_sanitizer Scrubbers::PIISanitizer.new end |
#scrub_with(event:, scrubber:) ⇒ Object (private)
31 32 33 |
# File 'lib/sentry/event_scrubber.rb', line 31 def scrub_with(event:, scrubber:) scrubber.process(event.to_hash) end |
#scrubbers ⇒ Object
NOTE: Unsure if the order matters
25 26 27 |
# File 'lib/sentry/event_scrubber.rb', line 25 def scrubbers [email_sanitizer, pii_sanitizer, log_as_warning, filter_request_body] end |