canvas-lms/app
Simon Williams 256e0bf276 allow custom throttling per access token or user id
this allows customizing the throttle settings value by updating a JSON
hash in the Setting table: `request_throttle.custom_settings` (see
formatting below)

The Setting value is a hash of client identifiers -> custom settings.
A custom setting is a hash with some subset of the following keys: hwm,
maximum, outflow, up_front_cost.  the values of those keys are floats.
For example:

  Setting.set(
    'request_throttle.custom_settings',
    { 'user:10000000000001' => { 'hwm' => 1000.0 } }.to_json
  )

these values will be used instead of the default values for requests
from that specific client_identifier

fixes CNVS-35965

test plan:
- set up a script that hammers the API and gets throttled
- create two users with two tokens
- set maximum and hwm to really high values for one (by user id), and
  verify that it is no longer throttled
- repeat, but use the access token as the id

Change-Id: I8a5e393721c7cbd4c754989ba219f92f0e280ee1
Reviewed-on: https://gerrit.instructure.com/105302
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-04-28 17:52:13 +00:00
..
coffeescripts da licença part 41 2017-04-28 17:33:21 +00:00
controllers Revert to old masquerade 2017-04-28 16:25:04 +00:00
helpers da licença part 17 2017-04-27 21:53:50 +00:00
jsx Revert to old masquerade 2017-04-28 16:25:04 +00:00
messages Fix link for offline export notifications 2017-04-07 21:25:53 +00:00
middleware allow custom throttling per access token or user id 2017-04-28 17:52:13 +00:00
models da licença part 14 2017-04-28 17:30:12 +00:00
observers da licença part 19 2017-04-27 21:52:22 +00:00
presenters da licença part 20 2017-04-27 21:51:29 +00:00
serializers da licença part 21 2017-04-27 21:51:31 +00:00
stylesheets Revert to old masquerade 2017-04-28 16:25:04 +00:00
views Revert to old masquerade 2017-04-28 16:25:04 +00:00