defra_ruby_alert 2.0.0 → 2.1.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 +4 -4
- data/README.md +7 -7
- data/lib/defra_ruby/alert/airbrake_runner.rb +2 -2
- data/lib/defra_ruby/alert/configuration.rb +2 -2
- data/lib/defra_ruby/alert/version.rb +1 -1
- data/spec/defra_ruby/alert/airbrake_runner_spec.rb +1 -1
- data/spec/defra_ruby/alert/configuration_spec.rb +1 -1
- data/spec/examples.txt +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd752fb4d156ca20aa6c449a7a537ccc174b2749c738f086e8f1ba3834fefbf9
|
4
|
+
data.tar.gz: 8b7038c5c82b72d17c8e600de490becc8cd93686e61571c62a666493e2e1e842
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58fb7b1763a226d9b9e17625512242f0f641256dca858959ecc1cbba6de55e32170396bcc2f2ed79aff9a1ee47a43eb03aa11de7adc8113c54c6af3bcdc39f7d
|
7
|
+
data.tar.gz: 7668f51ade4c8a7debe50c56508521d984def72d73e561308d4bc1092151d2b58477445227ff7a9bd7baf18f6aeb4f057cd5f56e7a17085b3f74fc32afc3381f
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Defra Ruby Alert
|
2
2
|
|
3
|
-
[](https://travis-ci.com/DEFRA/defra-ruby-alert)
|
4
4
|
[](https://sonarcloud.io/dashboard?id=DEFRA_defra-ruby-alert)
|
5
5
|
[](https://sonarcloud.io/dashboard?id=DEFRA_defra-ruby-alert)
|
6
|
-
[](https://hakiri.io/github/DEFRA/defra-ruby-alert/main)
|
7
7
|
[](https://badge.fury.io/rb/defra_ruby_alert)
|
8
8
|
[](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3)
|
9
9
|
|
@@ -11,7 +11,7 @@ Currently there are a number of Rails based digital services in Defra, all of wh
|
|
11
11
|
|
12
12
|
This means we are often duplicating the code to configure and manage Airbrake across them. So we created this gem 😁!
|
13
13
|
|
14
|
-
|
14
|
+
Its aim is to help us
|
15
15
|
|
16
16
|
- start to reduce the duplication across projects
|
17
17
|
- be consistent in how we configure and manage Airbrake
|
@@ -73,17 +73,17 @@ The gem has been designed to be used by our Rails apps, so we would also expect
|
|
73
73
|
config.environment = Rails.env
|
74
74
|
```
|
75
75
|
|
76
|
-
###
|
76
|
+
### blocklist
|
77
77
|
|
78
78
|
> Specifies which keys in the payload (parameters, session data, environment data, etc) should be filtered. Before sending an error, filtered keys will be substituted with the [Filtered] label.
|
79
79
|
|
80
|
-
Not every project uses this, but some do hence we provide the ability to specify a
|
80
|
+
Not every project uses this, but some do hence we provide the ability to specify a blocklist.
|
81
81
|
|
82
82
|
```ruby
|
83
|
-
config.
|
83
|
+
config.blocklist = [/password/i, /postcode/i, :name]
|
84
84
|
```
|
85
85
|
|
86
|
-
See Airbrake's [
|
86
|
+
See Airbrake's [blocklist_keys](https://github.com/airbrake/airbrake-ruby#blocklist_keys) for more details.
|
87
87
|
|
88
88
|
## Usage
|
89
89
|
|
@@ -62,8 +62,8 @@ module DefraRuby
|
|
62
62
|
# A list of parameters that should be filtered out of what is sent to
|
63
63
|
# Airbrake. By default, all "password" attributes will have their contents
|
64
64
|
# replaced.
|
65
|
-
# https://github.com/airbrake/airbrake-ruby#
|
66
|
-
c.
|
65
|
+
# https://github.com/airbrake/airbrake-ruby#blocklist_keys
|
66
|
+
c.blocklist_keys = DefraRuby::Alert.configuration.blocklist
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
@@ -4,10 +4,10 @@ module DefraRuby
|
|
4
4
|
module Alert
|
5
5
|
class Configuration
|
6
6
|
attr_accessor :root_directory, :logger, :environment
|
7
|
-
attr_accessor :host, :project_key, :
|
7
|
+
attr_accessor :host, :project_key, :blocklist, :enabled
|
8
8
|
|
9
9
|
def initialize
|
10
|
-
@
|
10
|
+
@blocklist = []
|
11
11
|
@enabled = false
|
12
12
|
end
|
13
13
|
end
|
data/spec/examples.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
-------------------------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/defra_ruby/alert/airbrake_runner_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/defra_ruby/alert/airbrake_runner_spec.rb[1:1:2:1] | passed | 0.
|
5
|
-
./spec/defra_ruby/alert/airbrake_runner_spec.rb[1:1:3:1] | passed | 0.
|
6
|
-
./spec/defra_ruby/alert/configuration_spec.rb[1:1] | passed | 0.
|
7
|
-
./spec/defra_ruby/alert_spec.rb[1:1:1] | passed | 0.
|
8
|
-
./spec/defra_ruby/alert_spec.rb[1:2:1:1] | passed | 0.
|
9
|
-
./spec/defra_ruby/alert_spec.rb[1:2:2:1] | passed | 0.
|
10
|
-
./spec/defra_ruby/alert_spec.rb[1:3:1] | passed | 0.
|
3
|
+
./spec/defra_ruby/alert/airbrake_runner_spec.rb[1:1:1] | passed | 0.00255 seconds |
|
4
|
+
./spec/defra_ruby/alert/airbrake_runner_spec.rb[1:1:2:1] | passed | 0.00052 seconds |
|
5
|
+
./spec/defra_ruby/alert/airbrake_runner_spec.rb[1:1:3:1] | passed | 0.00062 seconds |
|
6
|
+
./spec/defra_ruby/alert/configuration_spec.rb[1:1] | passed | 0.00259 seconds |
|
7
|
+
./spec/defra_ruby/alert_spec.rb[1:1:1] | passed | 0.00304 seconds |
|
8
|
+
./spec/defra_ruby/alert_spec.rb[1:2:1:1] | passed | 0.0017 seconds |
|
9
|
+
./spec/defra_ruby/alert_spec.rb[1:2:2:1] | passed | 0.00178 seconds |
|
10
|
+
./spec/defra_ruby/alert_spec.rb[1:3:1] | passed | 0.01859 seconds |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: defra_ruby_alert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Defra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake
|