[openstreetmap/openstreetmap-website] Add the ability to rate limit edits (PR #4319)
Tom Hughes
notifications at github.com
Sun Oct 29 19:38:40 UTC 2023
This aims to implement #2342 by rate limiting edits.
The limits work in a similar way to the changeset comment limits and are configurable with the defaults being a ramp up from 1000 changes per hour to 100000 per hour over the first week after a user starts editing. Users that are reported lose some allowance subject to a minimum that defaults to 100 edits per hour.
The increase is non linear, increasing as the square of time elapsed by subject to the lower bound of the initial limit so that it starts to climb after about 18 hours as shown in this graph which shows hours on the X axis versus allowed edits per hour on the Y axis.

Moderators have a separately configurable rate limit and this also introduces a new `importer` role that has a higher rate limit and which can be granted to accounts doing large imports/bulk edits.
Obviously once this agreed cgimap will need work to respect the rate limits.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/4319
-- Commit Summary --
* Add importer role that can be associated with higher rate limits
* Add support for per-user limits on the rate changes can be made
* Enforce rate limit for API calls which make changes
* Add tests for API change rate limits
-- File Changes --
M .rubocop_todo.yml (2)
A app/assets/images/roles/blank_importer.png (0)
A app/assets/images/roles/blank_importer.svg (65)
A app/assets/images/roles/importer.png (0)
A app/assets/images/roles/importer.svg (71)
M app/controllers/api/changesets_controller.rb (4)
M app/controllers/api/nodes_controller.rb (1)
M app/controllers/api/relations_controller.rb (1)
M app/controllers/api/ways_controller.rb (1)
M app/controllers/api_controller.rb (7)
M app/models/user.rb (22)
M app/models/user_role.rb (2)
M config/initializers/migrate.rb (4)
M config/locales/en.yml (3)
M config/settings.yml (6)
A db/migrate/20231029151516_add_importer_role.rb (9)
M db/structure.sql (4)
M test/controllers/api/changesets_controller_test.rb (107)
M test/controllers/api/nodes_controller_test.rb (85)
M test/controllers/api/relations_controller_test.rb (111)
M test/controllers/api/ways_controller_test.rb (105)
M test/factories/user.rb (6)
M test/helpers/user_roles_helper_test.rb (76)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/4319.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4319.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4319
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4319 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231029/562d13b3/attachment-0001.htm>
More information about the rails-dev
mailing list