Comments (3)
Hi, @micred! Thanks for opening this issue.
I expected to have the passwords filtered in any object,
Where does this expectation come from? Do other error tracking tools do that?
I know that the user should cast the data to hash before calling Airbrake.notify
From what I remember, I think our docs don't make this clear. But the behavior you demonstrated serves as proof of your statement. I think we should make this clearer in the docs as well.
from airbrake-ruby.
Where does this expectation come from? Do other error tracking tools do?
This expectation comes from the README:
blocklist_keys - Specifies which keys in the payload (parameters, session data, environment data, etc) should be filtered.
Ok, no worries if you don't want to merge the PR, makes sense.
from airbrake-ruby.
I leave here a filter for Rails users that filter pretty much everything.
You can specify this filter in your config/initializers/airbrake.rb
.
Airbrake.add_filter do |notice|
unless notice.ignored
# Sanitize and explicitly cast any notification parameter to a hash.
# Airbrake otherwise doesn't blocklist parameters in a non-hash (i.e. ApplicationRecord, ActiveRecord::Relation,
# ActionController::Parameters, OpenStruct...).
notice[:params].deep_transform_values! do |object|
# Convert an ApplicationRecord object into its hash.
object = object.attributes if object.is_a? ApplicationRecord
# Convert an ApplicationRecord object into an array of hashes.
object = object.to_a.map(&:attributes) if object.is_a? ActiveRecord::Relation
# Sets the ActionController::Parameters to true and avoids ActionController::UnfilteredParameters when
# converted to hash.
object = object.permit! if object.is_a? ActionController::Parameters
# rubocop:disable Lint/RescueException
# Either way, try to cast it to a hash when the object is not a Hash but responds to a casting method.
object = begin
if !object.is_a?(Array) && object.respond_to?(:to_h)
object.to_h
elsif object.respond_to? :to_hash
object.to_hash
else
object
end
rescue Exception => e
# If the cast fails for any reason, be conservative and hide everything, but say it
"[The cast to hash of an object of type #{object.class} failed"\
"with an exception of type #{e.class}: #{e.message}]"
end
# rubocop:enable Lint/RescueException
object
end
end
end
from airbrake-ruby.
Related Issues (20)
- rbtree collides with rmagick on aws linux HOT 8
- PerformanceNotifier outputting many logs when it should be disabled HOT 9
- Clarify the impact of disabling the `remote_config` feature HOT 3
- Is Airbrake.merge_context thread safe? HOT 1
- Its possible to log the output of all promises? HOT 5
- Enable proxy when fetching remote config
- Manual test code fails to generate airbrake ; program terminates too quickly HOT 2
- airbrake issues with lack of detail HOT 1
- Remote configuration is polled for despite `ignore_environments` HOT 1
- Errno::EAGAIN: Resource temporarily unavailable with falcon HOT 12
- Performance monitoring scope/features HOT 2
- ArgumentError: invalid byte sequence in UTF-8 when reporting HOT 5
- Airbrake logging an unexpected 500 response from Airbrake API HOT 14
- Exceptions with nil for message cause error in v6.1.1 HOT 5
- Set error_host and apm_host to host by default HOT 3
- HTTP error: can't move from the enclosed thread group HOT 11
- 6.2.1-java missing on rubygems.org HOT 3
- Filter user object
- Error notifications are disabled (missing doc?) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airbrake-ruby.