mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
Add tracks attr_reader to Configuration (#664)
This commit is contained in:
parent
0fbc9a1c46
commit
427fdfabbc
2 changed files with 34 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ module Rack
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :safelists, :blocklists, :throttles, :anonymous_blocklists, :anonymous_safelists
|
attr_reader :safelists, :blocklists, :throttles, :tracks, :anonymous_blocklists, :anonymous_safelists
|
||||||
attr_accessor :blocklisted_responder, :throttled_responder, :throttled_response_retry_after_header
|
attr_accessor :blocklisted_responder, :throttled_responder, :throttled_response_retry_after_header
|
||||||
|
|
||||||
attr_reader :blocklisted_response, :throttled_response # Keeping these for backwards compatibility
|
attr_reader :blocklisted_response, :throttled_response # Keeping these for backwards compatibility
|
||||||
|
|
|
||||||
33
spec/configuration_spec.rb
Normal file
33
spec/configuration_spec.rb
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require_relative "spec_helper"
|
||||||
|
|
||||||
|
describe Rack::Attack::Configuration do
|
||||||
|
subject { Rack::Attack::Configuration.new }
|
||||||
|
|
||||||
|
describe 'attributes' do
|
||||||
|
it 'exposes the safelists attribute' do
|
||||||
|
_(subject.safelists).must_equal({})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'exposes the blocklists attribute' do
|
||||||
|
_(subject.blocklists).must_equal({})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'exposes the throttles attribute' do
|
||||||
|
_(subject.throttles).must_equal({})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'exposes the tracks attribute' do
|
||||||
|
_(subject.tracks).must_equal({})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'exposes the anonymous_blocklists attribute' do
|
||||||
|
_(subject.anonymous_blocklists).must_equal([])
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'exposes the anonymous_safelists attribute' do
|
||||||
|
_(subject.anonymous_safelists).must_equal([])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in a new issue