Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: drop support for blacklist_keys & whitelist_keys #610

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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` & `whitelist_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