Skip to content

Commit

Permalink
config: drop support for blacklist_keys & whitelist_keys
Browse files Browse the repository at this point in the history
Fixes #602
  • Loading branch information
kyrylo committed Aug 12, 2020
1 parent 1b8a25e commit 9e20873
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 54 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Airbrake Ruby Changelog
* Dropped support for `:start_time` & `:end_time` params for APM methods such as
`Airbrake.notify_request`
([#609](https://github.com/airbrake/airbrake-ruby/pull/609))
* Dropped support for `blacklist_keys` & `whitelit_keys`
([#610](https://github.com/airbrake/airbrake-ruby/pull/610))

### [v5.0.0.rc.2][v5.0.0.rc.2] (July 29, 2020)

Expand Down
26 changes: 0 additions & 26 deletions lib/airbrake-ruby/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module Airbrake
#
# @api public
# @since v1.0.0
# rubocop:disable Metrics/ClassLength
class Config
# @return [Integer] the project identificator. This value *must* be set.
# @api public
Expand Down Expand Up @@ -83,18 +82,12 @@ class Config
# @since v4.15.0
attr_accessor :allowlist_keys

# @deprecated Use allowlist_keys instead
alias whitelist_keys allowlist_keys

# @return [Array<String, Symbol, Regexp>] the keys, which should be
# filtered
# @api public
# @since v4.15.0
attr_accessor :blocklist_keys

# @deprecated Use blocklist_keys instead
alias blacklist_keys blocklist_keys

# @return [Boolean] true if the library should attach code hunks to each
# frame in a backtrace, false otherwise
# @api public
Expand Down Expand Up @@ -185,24 +178,6 @@ def initialize(user_config = {})
end
# rubocop:enable Metrics/AbcSize

def blacklist_keys=(keys)
loc = caller_locations(1..1).first
Kernel.warn(
"#{loc.path}:#{loc.lineno}: warning: blacklist_keys= is deprecated " \
"use blocklist_keys= instead",
)
self.blocklist_keys = keys
end

def whitelist_keys=(keys)
loc = caller_locations(1..1).first
Kernel.warn(
"#{loc.path}:#{loc.lineno}: warning: whitelist_keys= is deprecated " \
"use allowlist_keys= instead",
)
self.allowlist_keys = keys
end

# The full URL to the Airbrake Notice API. Based on the +:error_host+ option.
# @return [URI] the endpoint address
def error_endpoint
Expand Down Expand Up @@ -288,5 +263,4 @@ def set_option(option, value)
raise Airbrake::Error, "unknown option '#{option}'"
end
end
# rubocop:enable Metrics/ClassLength
end
28 changes: 0 additions & 28 deletions spec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,32 +173,4 @@
expect(subject.logger.level).to eq(Logger::WARN)
end
end

describe "#blacklist_keys=" do
before { allow(Kernel).to receive(:warn) }

it "sets blocklist_keys instead" do
subject.blacklist_keys = [1, 2, 3]
expect(subject.blocklist_keys).to eq([1, 2, 3])
end

it "prints a warning" do
expect(Kernel).to receive(:warn).with(/use blocklist_keys= instead/)
subject.blacklist_keys = [1, 2, 3]
end
end

describe "#whitelist_keys=" do
before { allow(Kernel).to receive(:warn) }

it "sets allowlist_keys instead" do
subject.whitelist_keys = [1, 2, 3]
expect(subject.allowlist_keys).to eq([1, 2, 3])
end

it "prints a warning" do
expect(Kernel).to receive(:warn).with(/use allowlist_keys= instead/)
subject.whitelist_keys = [1, 2, 3]
end
end
end

0 comments on commit 9e20873

Please sign in to comment.