rate limits: add /rate_limits endpoint.

Allow users to view their own rate limits with /rate_limits.json.

Note that rate limits are only updated after every API call, so this
page only shows the state of the limits after the last call, not the
current state.
This commit is contained in:
evazion
2021-03-05 16:25:23 -06:00
parent 1ee1e807cf
commit 58e42ee8d3
6 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
class RateLimitsController < ApplicationController
respond_to :html, :json, :xml
def index
@rate_limits = authorize RateLimit.visible(CurrentUser.user).paginated_search(params, count_pages: true)
respond_with(@rate_limits)
end
end