-
Notifications
You must be signed in to change notification settings - Fork 343
[POC] Try removing all dev dependencies #709
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
base: main
Are you sure you want to change the base?
Conversation
56eaaca to
62a0e32
Compare
62a0e32 to
47610c3
Compare
3bc94cb to
8c257ba
Compare
| Rack::Attack.blocklist("allow2ban pentesters") do |request| | ||
| Rack::Attack::Allow2Ban.filter(request.ip, maxretry: 2, findtime: 30, bantime: 60) do | ||
| request.path.include?("scarce-resource") | ||
| if defined?(::ActiveSupport::Cache::MemoryStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe "Blocking an IP" do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
| before do | ||
| Rack::Attack.blocklist do |request| | ||
| request.ip == "1.2.3.4" | ||
| if defined?(::ActiveSupport::Notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe "Blocking an IP subnet" do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
| describe "Customizing throttled response" do | ||
| before do | ||
| Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new | ||
| if defined?(::ActiveSupport::Cache::MemoryStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe "fail2ban" do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Cache::MemoryStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe "Safelist an IP" do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
| before do | ||
| Rack::Attack.blocklist do |request| | ||
| request.ip == "1.2.3.4" | ||
| if defined?(::ActiveSupport::Notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe "Safelisting an IP subnet" do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe "#throttle" do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Cache::MemoryStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe "#track" do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe "#track with throttle-ish options" do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Cache::MemoryStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
| get '/', {}, 'REMOTE_ADDR' => '1.2.3.4' | ||
|
|
||
| _(last_response.status).must_equal 200 | ||
| if defined?(::ActiveSupport::Cache::MemoryStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| Rack::Attack.blocklist('pentest') do |req| | ||
| Rack::Attack::Fail2Ban.filter(req.ip, @f2b_options) { req.query_string =~ /OMGHAX/ } | ||
| if defined?(::ActiveSupport::Cache::MemoryStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
| Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new | ||
| Rack::Attack.throttle('ip/sec', limit: 1, period: @period) { |req| req.ip } | ||
| end | ||
| if defined?(::ActiveSupport::Cache::MemoryStore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
|
|
||
| describe 'Rack::Attack.track' do | ||
| let(:notifications) { [] } | ||
| if defined?(::ActiveSupport::Notifications) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests shouldn't be tied to active support
Follow-up of #706 (comment)