rack-congestion 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +11 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +2 -0
- data/Guardfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +80 -0
- data/Rakefile +5 -0
- data/bin/console +7 -0
- data/bin/setup +5 -0
- data/examples/custom.ru +15 -0
- data/examples/global.ru +14 -0
- data/examples/per_ip_and_global.ru +11 -0
- data/examples/per_path.ru +14 -0
- data/lib/rack/congestion/ip_limiter.rb +9 -0
- data/lib/rack/congestion/limiter.rb +45 -0
- data/lib/rack/congestion/path_limiter.rb +39 -0
- data/lib/rack/congestion/request.rb +33 -0
- data/lib/rack/congestion/version.rb +5 -0
- data/lib/rack/congestion.rb +11 -0
- data/rack-congestion.gemspec +33 -0
- metadata +221 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 693570cf6841abf6dd17eaad6d15fe862d4f9641
|
4
|
+
data.tar.gz: b4cfba48ed33833109973199b7bdd47fb8703229
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2a16cc9ffd977a35fcb1229628c87fa76ebdb602373b2fc7ebd1bb24329816159ae47367f546e31d1b95f1f474c92293034b260fd19a1087508a3a3ee59d450a
|
7
|
+
data.tar.gz: acbdcacc1948ca3e21a65bd20f0dbdcd9ff1672e0147e3ac1e7fed92236ec62c678fbdf6b3b255790bb23805c0fb6e55b9d289262732b7c2ce74bb4a879e3a1d
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Michael Parrish
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# Rack::Congestion
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/parrish/Rack-Congestion.svg?branch=master)](https://travis-ci.org/parrish/Rack-Congestion)
|
4
|
+
[![Test Coverage](https://codeclimate.com/github/parrish/Rack-Congestion/badges/coverage.svg)](https://codeclimate.com/github/parrish/Rack-Congestion)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/parrish/Rack-Congestion/badges/gpa.svg)](https://codeclimate.com/github/parrish/Rack-Congestion)
|
6
|
+
|
7
|
+
Rack middleware for [Congestion](https://github.com/parrish/Congestion)
|
8
|
+
|
9
|
+
Provides rate limiting for Rack-based applications.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'rack-congestion'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install rack-congestion
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
The available limiters are:
|
30
|
+
|
31
|
+
- `Rack::Congestion::Limiter`
|
32
|
+
- Application-wide limiting
|
33
|
+
- `Rack::Congestion::IpLimiter`
|
34
|
+
- Limits requests per-IP
|
35
|
+
- `Rack::Congestion::PathLimiter`
|
36
|
+
- Limits requests for a path segment
|
37
|
+
- e.g. limit requests to `'/api'`
|
38
|
+
- accepts `path:`(required) and `path_matcher:`(optional) options
|
39
|
+
|
40
|
+
Examples and more advanced usage can be found in [examples](examples)
|
41
|
+
|
42
|
+
### In a Rack application
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
require 'rack/congestion'
|
46
|
+
|
47
|
+
# Limit requests to
|
48
|
+
# - a maximum of 100 requests per minute
|
49
|
+
# - a maximum rate of 1 request every 100 milliseconds
|
50
|
+
use Rack::Congestion::IpLimiter, interval: 60, max_in_interval: 100, min_delay: 0.1
|
51
|
+
|
52
|
+
run ->(env){
|
53
|
+
[200, { 'Content-Type' => 'text/plain' }, ['Hello world']]
|
54
|
+
}
|
55
|
+
```
|
56
|
+
|
57
|
+
### In a Rails application
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
# config/application.rb
|
61
|
+
require 'rack/congestion'
|
62
|
+
|
63
|
+
class YourApplication < Rails::Application
|
64
|
+
config.middleware.use Rack::Congestion::IpLimiter
|
65
|
+
end
|
66
|
+
```
|
67
|
+
|
68
|
+
## Development
|
69
|
+
|
70
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
71
|
+
|
72
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To run the specs, run `bundle exec rake`.
|
73
|
+
|
74
|
+
## Contributing
|
75
|
+
|
76
|
+
1. Fork it ( https://github.com/parrish/rack-congestion/fork )
|
77
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
78
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
79
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
80
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/bin/setup
ADDED
data/examples/custom.ru
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rack/congestion'
|
2
|
+
|
3
|
+
class CustomLimiter < Rack::Congestion::PathLimiter
|
4
|
+
def key
|
5
|
+
->{ "#{ request.ip }-#{ path }" }
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
# Limit requests to
|
10
|
+
# - a maximum of 10 requests per minute per user to /api
|
11
|
+
use CustomLimiter, path: 'api', interval: 60, max_in_interval: 10
|
12
|
+
|
13
|
+
run ->(env){
|
14
|
+
[200, { 'Content-Type' => 'text/plain' }, ['Hello world']]
|
15
|
+
}
|
data/examples/global.ru
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rack/congestion'
|
2
|
+
|
3
|
+
# Limit requests to
|
4
|
+
# - a maximum of 10 requests per minute
|
5
|
+
# - a maximum rate of 1 request every second
|
6
|
+
# - Unsuccessful requests count towards limits
|
7
|
+
use Rack::Congestion::Limiter, {
|
8
|
+
interval: 60, max_in_interval: 10, min_delay: 1,
|
9
|
+
track_rejected: true
|
10
|
+
}
|
11
|
+
|
12
|
+
run ->(env){
|
13
|
+
[200, { 'Content-Type' => 'text/plain' }, ['Hello world']]
|
14
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'rack/congestion'
|
2
|
+
|
3
|
+
# Limit requests to
|
4
|
+
# - a global maximum of 10 requests per minute
|
5
|
+
# - a maximum of 1 request per minute per user
|
6
|
+
use Rack::Congestion::Limiter, interval: 60, max_in_interval: 10
|
7
|
+
use Rack::Congestion::IpLimiter, interval: 60, max_in_interval: 1
|
8
|
+
|
9
|
+
run ->(env){
|
10
|
+
[200, { 'Content-Type' => 'text/plain' }, ['Hello world']]
|
11
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rack/congestion'
|
2
|
+
|
3
|
+
# Limit requests to
|
4
|
+
# - a maximum of 10 requests per minute to /api
|
5
|
+
# - a maximum of 5 requests per minute to everything else
|
6
|
+
use Rack::Congestion::PathLimiter, path: 'api', interval: 60,
|
7
|
+
max_in_interval: 10
|
8
|
+
|
9
|
+
use Rack::Congestion::PathLimiter, path: 'other', interval: 60,
|
10
|
+
max_in_interval: 5, path_matcher: /^\/(?!api)/i
|
11
|
+
|
12
|
+
run ->(env){
|
13
|
+
[200, { 'Content-Type' => 'text/plain' }, ['Hello world']]
|
14
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Rack
|
2
|
+
module Congestion
|
3
|
+
class Limiter
|
4
|
+
attr_accessor :app, :options
|
5
|
+
attr_reader :env
|
6
|
+
|
7
|
+
def initialize(app, options = { })
|
8
|
+
self.app = app
|
9
|
+
self.options = options
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(env)
|
13
|
+
dup._call env
|
14
|
+
end
|
15
|
+
|
16
|
+
def _call(env)
|
17
|
+
@env = env
|
18
|
+
request.allowed? ? app.call(env) : rejected_response
|
19
|
+
end
|
20
|
+
|
21
|
+
def request
|
22
|
+
@request ||= Rack::Congestion::Request.new env, key, options
|
23
|
+
end
|
24
|
+
|
25
|
+
def key
|
26
|
+
->{ 'global' }
|
27
|
+
end
|
28
|
+
|
29
|
+
def rejected_response
|
30
|
+
[
|
31
|
+
429,
|
32
|
+
{
|
33
|
+
'Content-Type' => 'text/plain; charset=utf-8',
|
34
|
+
'Retry-After' => backoff
|
35
|
+
},
|
36
|
+
['Rate Limit Exceeded']
|
37
|
+
]
|
38
|
+
end
|
39
|
+
|
40
|
+
def backoff
|
41
|
+
request.backoff.to_s rescue -1
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Rack
|
2
|
+
module Congestion
|
3
|
+
class PathLimiter < Limiter
|
4
|
+
attr_accessor :path, :path_matcher
|
5
|
+
|
6
|
+
def initialize(app, options = { })
|
7
|
+
self.path = normalize_path_from options
|
8
|
+
self.path_matcher = normalize_matcher_from options
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
12
|
+
def _call(env)
|
13
|
+
@env = env
|
14
|
+
ignored? ? app.call(env) : super(env)
|
15
|
+
end
|
16
|
+
|
17
|
+
def key
|
18
|
+
->{ path }
|
19
|
+
end
|
20
|
+
|
21
|
+
def ignored?
|
22
|
+
request.path !~ path_matcher
|
23
|
+
end
|
24
|
+
|
25
|
+
protected
|
26
|
+
|
27
|
+
def normalize_path_from(options)
|
28
|
+
self.path = options.delete :path
|
29
|
+
path.sub(/^\/*/, '/').sub /\/+$/, ''
|
30
|
+
end
|
31
|
+
|
32
|
+
def normalize_matcher_from(options)
|
33
|
+
self.path_matcher = options.delete :path_matcher
|
34
|
+
return path_matcher if path_matcher
|
35
|
+
Regexp.new path.sub(/^\^?/, '^'), 'i'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
module Rack
|
4
|
+
module Congestion
|
5
|
+
class Request
|
6
|
+
extend Forwardable
|
7
|
+
attr_accessor :env, :key, :options
|
8
|
+
|
9
|
+
def_delegators :rack_request,
|
10
|
+
:ip, :path, :content_type, :session, :scheme,
|
11
|
+
:ssl?, :delete?, :get?, :head?, :options?, :link?,
|
12
|
+
:patch?, :post?, :put?, :trace?, :unlink?, :cookies, :xhr?
|
13
|
+
|
14
|
+
def_delegators :congestion,
|
15
|
+
:allowed?, :backoff, :first_request, :last_request,
|
16
|
+
:rejected?, :too_frequent?, :too_many?, :total_requests
|
17
|
+
|
18
|
+
def initialize(env, key, options = { })
|
19
|
+
self.env = env
|
20
|
+
self.key = key
|
21
|
+
self.options = options
|
22
|
+
end
|
23
|
+
|
24
|
+
def rack_request
|
25
|
+
@rack_request ||= Rack::Request.new env
|
26
|
+
end
|
27
|
+
|
28
|
+
def congestion
|
29
|
+
@congestion ||= ::Congestion.request key.call, options
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rack/congestion/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'rack-congestion'
|
8
|
+
spec.version = Rack::Congestion::VERSION
|
9
|
+
spec.authors = ['Michael Parrish']
|
10
|
+
spec.email = ['michael@zooniverse.org']
|
11
|
+
|
12
|
+
spec.summary = %q{Redis rate limiter Rack middleware}
|
13
|
+
spec.description = %q{Rack middleware rate limiter that provides both time-based limits and quantity-based limits}
|
14
|
+
spec.homepage = 'https://github.com/parrish/rack-congestion'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = 'exe'
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_runtime_dependency 'congestion', '~> 0.0.2'
|
23
|
+
spec.add_runtime_dependency 'rack', '>= 1.5'
|
24
|
+
spec.add_runtime_dependency 'rack-test', '>= 0.6'
|
25
|
+
spec.add_development_dependency 'bundler', '>= 1.5'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.2'
|
28
|
+
spec.add_development_dependency 'rspec-its', '~> 1.2'
|
29
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.5'
|
30
|
+
spec.add_development_dependency 'timecop', '~> 0.7'
|
31
|
+
spec.add_development_dependency 'pry'
|
32
|
+
spec.add_development_dependency 'codeclimate-test-reporter'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,221 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rack-congestion
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael Parrish
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: congestion
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.0.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.0.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rack-test
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.6'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.5'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.5'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.2'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.2'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec-its
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: guard-rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '4.5'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '4.5'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: timecop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.7'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.7'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: pry
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: codeclimate-test-reporter
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: Rack middleware rate limiter that provides both time-based limits and
|
168
|
+
quantity-based limits
|
169
|
+
email:
|
170
|
+
- michael@zooniverse.org
|
171
|
+
executables: []
|
172
|
+
extensions: []
|
173
|
+
extra_rdoc_files: []
|
174
|
+
files:
|
175
|
+
- ".gitignore"
|
176
|
+
- ".rspec"
|
177
|
+
- ".travis.yml"
|
178
|
+
- CODE_OF_CONDUCT.md
|
179
|
+
- Gemfile
|
180
|
+
- Guardfile
|
181
|
+
- LICENSE.txt
|
182
|
+
- README.md
|
183
|
+
- Rakefile
|
184
|
+
- bin/console
|
185
|
+
- bin/setup
|
186
|
+
- examples/custom.ru
|
187
|
+
- examples/global.ru
|
188
|
+
- examples/per_ip_and_global.ru
|
189
|
+
- examples/per_path.ru
|
190
|
+
- lib/rack/congestion.rb
|
191
|
+
- lib/rack/congestion/ip_limiter.rb
|
192
|
+
- lib/rack/congestion/limiter.rb
|
193
|
+
- lib/rack/congestion/path_limiter.rb
|
194
|
+
- lib/rack/congestion/request.rb
|
195
|
+
- lib/rack/congestion/version.rb
|
196
|
+
- rack-congestion.gemspec
|
197
|
+
homepage: https://github.com/parrish/rack-congestion
|
198
|
+
licenses:
|
199
|
+
- MIT
|
200
|
+
metadata: {}
|
201
|
+
post_install_message:
|
202
|
+
rdoc_options: []
|
203
|
+
require_paths:
|
204
|
+
- lib
|
205
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
206
|
+
requirements:
|
207
|
+
- - ">="
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: '0'
|
210
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
requirements: []
|
216
|
+
rubyforge_project:
|
217
|
+
rubygems_version: 2.4.6
|
218
|
+
signing_key:
|
219
|
+
specification_version: 4
|
220
|
+
summary: Redis rate limiter Rack middleware
|
221
|
+
test_files: []
|