Version bump to 1.5.0

Andrew Kane committed Aug 19, 2016
commit f2f3cdef1b74159cb6724858614dd7fe5f2366a0
Showing 3 changed files with 19 additions and 3 deletions
CHANGELOG.md +2 -2
@@ @@ -1,6 +1,6 @@
- ## 1.5.0 [unreleased]
+ ## 1.5.0
- - Removed throttling to fix issues with `Rack::Attack` usage outside Ahoy
+ - Removed throttling due to unintended side effects with its implementation
- Ensure basic token requirements
- Fixed visit recreation on cookie expiration
- Fixed issue where `/ahoy/visits` is called indefinitely when `Ahoy.cookie_domain = :all`
README.md +16 -0
@@ @@ -530,6 +530,18 @@ Send a `POST` request as `Content-Type: application/json` to `/ahoy/events` with
Use an array to pass multiple events at once.
+ ## Throttling
+
+ To throttle requests to Ahoy endpoints, check out [Rack::Attack](https://github.com/kickstarter/ack-attack). Here’s a sample config:
+
+ ```ruby
+ Rack::Attack.throttle("ahoy/ip", limit: 20, period: 1.minute) do |req|
+ if req.path.start_with?("/ahoy/")
+ req.ip
+ end
+ end
+ ```
+
## Reference
By default, Ahoy create endpoints at `/ahoy/visits` and `/ahoy/events`. To disable, use:
@@ @@ -540,6 +552,10 @@ Ahoy.mount = false
## Upgrading
+ ### 1.5.0
+
+ There’s nothing to do, but it’s worth noting that simple throttling, which was added in `1.3.0`, was removed due to unintended side effects with its implementation. See the [Throttling](#throttling) section for how to properly add it by hand if needed.
+
### 1.4.0
There’s nothing to do, but it’s worth noting the default store was changed from `ActiveRecordStore` to `ActiveRecordTokenStore` for new installations.
ahoy/version.rb b/lib/ahoy/version.rb +1 -1
@@ @@ -1,3 +1,3 @@
module Ahoy
- VERSION = "1.4.2"
+ VERSION = "1.5.0"
end