Skip to content

Commit

Permalink
Merge branch 'main' into jiang925/dynamic-weight
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy authored Nov 15, 2023
2 parents 1c02f54 + ffc2102 commit 531679d
Show file tree
Hide file tree
Showing 63 changed files with 637 additions and 317 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: build

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
services:
redis:
image: redis
ports:
- 6379:6379
memcached:
image: memcached
ports:
- 11211:11211
strategy:
matrix:
ruby:
- '3.2'
- '3.1'
- '3.0'
- '2.7'
- '2.6'
- '2.5'
gemfile:
- rack_3
- rack_2
- rack_1
- rails_7_1
- rails_7_0
- rails_6_1
- rails_6_0
- rails_5_2
- dalli3
- dalli2
- redis_5
- redis_4
- connection_pool_dalli
- active_support_7_1_redis_cache_store
- active_support_7_1_redis_cache_store_pooled
- active_support_7_0_redis_cache_store
- active_support_7_0_redis_cache_store_pooled
- active_support_6_redis_cache_store
- active_support_6_redis_cache_store_pooled
- active_support_5_redis_cache_store
- active_support_5_redis_cache_store_pooled
- redis_store
exclude:
- gemfile: rack_1
ruby: '3.2'
- gemfile: rails_5_2
ruby: '3.2'
- gemfile: active_support_5_redis_cache_store
ruby: '3.2'
- gemfile: active_support_5_redis_cache_store_pooled
ruby: '3.2'
- gemfile: dalli2
ruby: '3.2'
- gemfile: rack_1
ruby: '3.1'
- gemfile: rails_5_2
ruby: '3.1'
- gemfile: active_support_5_redis_cache_store
ruby: '3.1'
- gemfile: active_support_5_redis_cache_store_pooled
ruby: '3.1'
- gemfile: dalli2
ruby: '3.1'
- gemfile: rack_1
ruby: '3.0'
- gemfile: rails_5_2
ruby: '3.0'
- gemfile: active_support_5_redis_cache_store
ruby: '3.0'
- gemfile: active_support_5_redis_cache_store_pooled
ruby: '3.0'
- gemfile: dalli2
ruby: '3.0'
- gemfile: rack_1
ruby: '2.7'
- gemfile: rails_7_0
ruby: '2.6'
- gemfile: rails_7_0
ruby: '2.5'
- gemfile: active_support_7_0_redis_cache_store
ruby: '2.6'
- gemfile: active_support_7_0_redis_cache_store
ruby: '2.5'
- gemfile: active_support_7_0_redis_cache_store_pooled
ruby: '2.6'
- gemfile: active_support_7_0_redis_cache_store_pooled
ruby: '2.5'
- gemfile: rails_7_1
ruby: '2.6'
- gemfile: rails_7_1
ruby: '2.5'
- gemfile: active_support_7_1_redis_cache_store
ruby: '2.6'
- gemfile: active_support_7_1_redis_cache_store
ruby: '2.5'
- gemfile: active_support_7_1_redis_cache_store_pooled
ruby: '2.6'
- gemfile: active_support_7_1_redis_cache_store_pooled
ruby: '2.5'
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake

3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require:
- rubocop-minitest
- rubocop-performance
- rubocop-rake

inherit_mode:
merge:
Expand Down Expand Up @@ -56,7 +58,6 @@ Security:

Style/BlockDelimiters:
Enabled: true
IgnoredMethods: [] # Workaround rubocop bug: https://github.com/rubocop-hq/rubocop/issues/6179

Style/ClassAndModuleChildren:
Enabled: true
Expand Down
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

75 changes: 56 additions & 19 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# frozen_string_literal: true

appraise "rack_3" do
gem "rack", "~> 3.0"
end

appraise "rack_2" do
gem "rack", "~> 2.0"
end
Expand All @@ -17,6 +21,14 @@ appraise "rack_1" do
gem "rack-test", ">= 0.6"
end

appraise 'rails_7-1' do
gem 'railties', '~> 7.1.0'
end

appraise 'rails_7-0' do
gem 'railties', '~> 7.0.0'
end

appraise 'rails_6-1' do
gem 'railties', '~> 6.1.0'
end
Expand All @@ -29,46 +41,71 @@ appraise 'rails_5-2' do
gem 'railties', '~> 5.2.0'
end

appraise 'rails_4-2' do
gem 'railties', '~> 4.2.0'
appraise 'dalli2' do
gem 'dalli', '~> 2.0'
end

# Override rack-test version constraint by making it more loose
# so it's compatible with actionpack 4.2.x
gem "rack-test", ">= 0.6"
appraise 'dalli3' do
gem 'dalli', '~> 3.0'
end

appraise 'dalli2' do
gem 'dalli', '~> 2.0'
appraise 'redis_5' do
gem 'redis', '~> 5.0'
end

appraise 'redis_4' do
gem 'redis', '~> 4.0'
end

appraise 'redis_3' do
gem 'redis', '~> 3.3'
appraise "connection_pool_dalli" do
gem "connection_pool", "~> 2.2"
gem "dalli", "~> 3.0"
end

appraise "connection_pool_dalli" do
appraise "active_support_7-1_redis_cache_store" do
gem "activesupport", "~> 7.1.0"
gem "redis", "~> 5.0"
end

appraise "active_support_7-1_redis_cache_store_pooled" do
gem "activesupport", "~> 7.1.0"
gem "connection_pool", "~> 2.2"
gem "redis", "~> 5.0"
end

appraise "active_support_7-0_redis_cache_store" do
gem "activesupport", "~> 7.0.0"
gem "redis", "~> 5.0"
end

appraise "active_support_7-0_redis_cache_store_pooled" do
gem "activesupport", "~> 7.0.0"
gem "connection_pool", "~> 2.2"
gem "dalli", "~> 2.7"
gem "redis", "~> 5.0"
end

appraise "active_support_redis_cache_store" do
appraise "active_support_6_redis_cache_store" do
gem "activesupport", "~> 6.1.0"
gem "redis", "~> 4.0"
gem "redis", "~> 5.0"
end

appraise "active_support_redis_cache_store_pooled" do
appraise "active_support_6_redis_cache_store_pooled" do
gem "activesupport", "~> 6.1.0"
gem "connection_pool", "~> 2.2"
gem "redis", "~> 4.0"
gem "redis", "~> 5.0"
end

appraise "redis_store" do
gem "redis-store", "~> 1.5"
appraise "active_support_5_redis_cache_store" do
gem "activesupport", "~> 5.2.0"
gem "redis", "~> 5.0"
end

appraise "active_support_redis_store" do
gem "redis-activesupport", "~> 5.0"
appraise "active_support_5_redis_cache_store_pooled" do
gem "activesupport", "~> 5.2.0"
gem "connection_pool", "~> 2.2"
gem "redis", "~> 5.0"
end

appraise "redis_store" do
gem "redis-store", "~> 1.5"
end
68 changes: 67 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,64 @@
# Changelog

All notable changes to this project will be documented in this file.
This file will no longer be updated - all changes after v6.7.0 will only be documented in the relevant release note.

## [6.7.0] - 2023-07-26

- Replace git.io URL by @kyoshidajp in #579
- test: update rack-test to v2 from v1 by @grzuy in #587
- Update example description to not suggest using a deprecated method by @MaksimAbramchuk in #589
- Add note about cache stores and in-memory caches. by @nateberkopec in #604
- ci: tests against redis gem v5 by @grzuy in #612
- Support rack 3 by @ioquatix in #586
- Gem release management. by @ioquatix in #614

## [6.6.1] - 2022-04-14

### Fixed

- Fixes deprecation warning in redis 4.6+ ([@ixti])

## [6.6.0] - 2022-01-29

### Added

- Ability to have access to the `request` object instead of only `env` (still can access env with `request.env`) when
customizing throttle and blocklist responses with new methods `Rack::Attack.blocklisted_responder=` and
`Rack::Attack.throttled_responder=` which yield the request to your lambda. ([@NikolayRys])

### Deprecated

- `Rack::Attack.blocklisted_response=`
- `Rack::Attack.throttled_response=`

## [6.5.0] - 2021-02-07

### Added

- Added ability to normalize throttle discriminator by setting `Rack::Attack.throttle_discriminator_normalizer` (@fatkodima)

Example:

Rack::Attack.throttle_discriminator_normalizer = ->(discriminator) { ... }

or disable default normalization with:

Rack::Attack.throttle_discriminator_normalizer = nil

### Removed

- Dropped support for ruby v2.4
- Dropped support for rails v5.1

## [6.4.0] - 2021-01-23

### Added

- Added support for ruby v3.0

### Removed

- Dropped support for ruby v2.3

## [6.3.1] - 2020-05-21

Expand Down Expand Up @@ -222,6 +280,12 @@ so your custom code is less prone to race conditions ([#282](https://github.com/
- Remove unused variable
- Extract mandatory options to constants


[6.7.0]: https://github.com/rack/rack-attack/compare/v6.6.1...v6.7.0/
[6.6.1]: https://github.com/rack/rack-attack/compare/v6.6.0...v6.6.1/
[6.6.0]: https://github.com/rack/rack-attack/compare/v6.5.0...v6.6.0/
[6.5.0]: https://github.com/rack/rack-attack/compare/v6.4.0...v6.5.0/
[6.4.0]: https://github.com/rack/rack-attack/compare/v6.3.1...v6.4.0/
[6.3.1]: https://github.com/rack/rack-attack/compare/v6.3.0...v6.3.1/
[6.3.0]: https://github.com/rack/rack-attack/compare/v6.2.2...v6.3.0/
[6.2.2]: https://github.com/rack/rack-attack/compare/v6.2.1...v6.2.2/
Expand Down Expand Up @@ -255,3 +319,5 @@ so your custom code is less prone to race conditions ([#282](https://github.com/

[@fatkodima]: https://github.com/fatkodima
[@rofreg]: https://github.com/rofreg
[@NikolayRys]: https://github.com/NikolayRys
[@ixti]: https://github.com/ixti
Loading

0 comments on commit 531679d

Please sign in to comment.