Commit graph

173 commits

Author SHA1 Message Date
fatkodima
1e5fb868f6
Auto include middleware for older railses 2021-02-07 12:57:24 -03:00
fatkodima
df354cd141
Make discriminators case-insensitive by default 2021-02-07 12:55:03 -03:00
Gonzalo
33d1bac4a5
test: update ruby and rails versions 2021-01-23 21:26:11 -03:00
fatkodima
9923012fe8
Allow to reset state between tests 2020-04-25 16:22:55 -03:00
Gonzalo Rodriguez
64f879395d
Merge commit '8fcd6c855915c802adeeb1784c503fc74115f5a3' into 6-stable 2020-04-25 16:17:37 -03:00
fatkodima
6cca2467d2
Fix rescuing errors in RedisProxy#increment 2019-12-17 17:54:18 -03:00
Gonzalo Rodriguez
e3056e737f
fix: avoid unintended effects on load_config_initializers and other gems load order
Because of the sort algorithm rails uses to satisfy `after` and `before`
constraints, gems can have unintended effects on others. See
0a120a818d

Prefer making rack-attack middleware idempotent instead of relying on
the load order and the contents of the middleware stack too much.

closes #452
closes #456
2019-10-29 15:45:26 -03:00
Gonzalo Rodriguez
8fcd6c8559
Merge pull request #450 from fatkodima/better-failsafe
Do not rescue all errors for redis backed stores
2019-10-18 17:44:23 -03:00
fatkodima
20ec4d31db Do not rescue all errors for redis backed stores 2019-10-18 02:31:05 +03:00
Gonzalo Rodriguez
55cb6def03
feat: clear custom response when clearing configuration 2019-10-17 14:26:22 -03:00
fatkodima
a34c187dda Allow to configure Retry-After header for default throttled_response handler 2019-10-17 00:26:13 +03:00
fatkodima
2fac6418f8 Fix rescuing errors in RedisProxy#increment 2019-10-15 22:54:33 +03:00
Gonzalo Rodriguez
1167c65ba6
Don't autoplug middleware for untested rails versions 2019-10-12 18:10:10 -03:00
fatkodima
f22b24cbc5 Do not auto-plug for rails < 5 2019-10-08 13:08:07 +03:00
fatkodima
bdfb01ab5b Changes and tests 2019-10-08 12:29:25 +03:00
fatkodima
b512e05786 Auto plug middleware for simpler installation 2019-10-08 12:29:25 +03:00
Gonzalo Rodriguez
bdc89dde7b
test: fix minitest/spec deprecation warnings 2019-10-01 17:19:44 -03:00
Gonzalo Rodriguez
8fafa7602b
style: fix Style/BlockDelimiters cop check 2019-08-02 15:24:17 -03:00
Gonzalo Rodriguez
f5a352b8f9
style: limit line length to 120 columns 2019-08-02 10:51:53 -03:00
Gonzalo Rodriguez
58ba650e6b
feat: provide discriminator in throttle_data 2019-07-10 17:21:48 -03:00
Gonzalo Rodriguez
8e3077c845
style: enabled Style/RedundantBegin rubocop 2019-03-01 21:10:40 -03:00
Gonzalo Rodriguez
7dbb490c01
style: enabled Style/EmptyMethod rubocop 2019-03-01 21:09:46 -03:00
Gonzalo Rodriguez
20d668211e
style: fix Lint/HandleExceptions rubocop 2019-02-28 21:17:36 -03:00
Gonzalo Rodriguez
bf4e902407
Merge pull request #408 from grzuy/style
style: prefer ruby 1.9+ hash syntax
2019-02-28 21:07:20 -03:00
Gonzalo Rodriguez
f772d0b3cd
Merge pull request #406 from grzuy/optional_name
Make blocklist/safelist name argument optional
2019-02-28 21:01:55 -03:00
Gonzalo Rodriguez
c67e71defe
style: prefer ruby 1.9+ hash syntax 2019-02-27 23:29:32 -03:00
Gonzalo Rodriguez
6addaa11d0
feat: make blocklist/safelist name argument optional 2019-02-24 21:04:51 -03:00
Gonzalo Rodriguez
6c6dfb06e3
feat: match ActiveSupport Instrumentation event name format spec 2019-02-24 20:19:38 -03:00
Gonzalo Rodriguez
58aa6714d8
test: let test file be run individually 2019-02-24 20:16:51 -03:00
Gonzalo Rodriguez
8cbd3dc0fc
feat: improve MisconfiguredStoreError exception message to aid debugging 2018-10-11 11:44:10 -03:00
Gonzalo Rodriguez
014f74b95d
Merge pull request #387 from grzuy/fix_redis_3_and_memory_store
[Fixes #355] Fix unexpected error when using redis 3 and any store which is not proxied
2018-10-08 11:33:34 -03:00
Gonzalo Rodriguez
82c0a17dd4
Test against Redis 3.x 2018-09-30 22:02:33 -03:00
Gonzalo Rodriguez
91dbb52235
Remove unwrapping 2018-09-30 13:32:08 -03:00
Jonathan del Strother
5cdc15b35a Add a proxy to deal with ActiveSupport::Cache::MemCacheStore
If connection pooling is used with AS::Cache::MemCacheStore,
unwrap_active_support_stores wouldn't return the underlying dalli instance(s),
and so Rack::Attack.store would be the bare unproxied MemCacheStore instance.

Calling write then increment would silently fail because :raw wasn't used.

With this commit, we no longer try to unwrap AS::Cache::MemCacheStore instances.
2018-09-03 12:00:02 +01:00
Jonathan del Strother
03b8ce6f9e
Refactor the "doesn't leak keys" spec 2018-08-30 21:52:13 -03:00
Gonzalo Rodriguez
b40b5718dc
rubocop --auto-correct 2018-06-29 15:41:36 -03:00
Gonzalo Rodriguez
e50bfbebaa
Acceptance test plain redis as a cache store backend 2018-06-29 15:41:04 -03:00
Gonzalo Rodriguez
aca4078089
Remove unnecessary requires in spec_helper 2018-06-29 11:47:04 -03:00
Gonzalo Rodriguez
73bc739d5a
Merge remote-tracking branch 'doliveirakn/master' 2018-06-29 11:17:19 -03:00
Gonzalo Rodriguez
19e17562c1
Merge pull request #372 from grzuy/drop_deprecated_methods
Remove previously deprecated public methods
2018-06-28 19:12:41 -03:00
Gonzalo Rodriguez
1c1ee918e1
Remove previously deprecated public methods 2018-06-28 17:16:33 -03:00
Gonzalo Rodriguez
8315a1e7e1
Remove support for unmaintained ruby 2.2 2018-06-28 17:08:15 -03:00
Gonzalo Rodriguez
8802ebfbaf
Merge branch '255-correct-object-for-instrumentation' 2018-06-28 16:40:08 -03:00
Gonzalo Rodriguez
a1ea2f9aef
Avoid repetition in spec_helper 2018-06-22 19:04:47 -03:00
Gonzalo Rodriguez
a72bfb5fc7
Only require redis stores when running their respective appraisal 2018-06-22 18:55:27 -03:00
Gonzalo Rodriguez
bd2ade8977
Only require connection_pool running connection_pool appraisal 2018-06-22 17:45:58 -03:00
Gonzalo Rodriguez
79de0d53e1
Only require dalli when running dalli appraisal 2018-06-22 17:45:03 -03:00
Gonzalo Rodriguez
9cc49b4760
Acceptance test ConnectionPool with Dalli::Client (via connection_pool and dalli) as cache store backend 2018-06-22 14:59:44 -03:00
Gonzalo Rodriguez
bcc1f5857e
Acceptance test ActiveSupport::Cache::MemoryStore (via activesupport) as cache store backend 2018-06-22 14:58:00 -03:00
Gonzalo Rodriguez
1f05ff30d5
Fix namespace of test file names 2018-06-22 14:55:22 -03:00