Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the rate of allowed requests #1969

Merged
merged 2 commits into from
Aug 4, 2020

Conversation

mpeven
Copy link
Contributor

@mpeven mpeven commented Jul 30, 2020

Increase the amount of requests that an "unauthenticated" user can perform, to prevent throttling errors when using the CLI.

Motivation and context

Hitting the /login endpoint from an unauthenticated user can trigger throttling. While throttling should be kept, as it is good practice, the rate can be increased as the user may have valid authentication. A reasonable level of 100 requests/minute should be enough to enforce good practices while preventing headaches for users trying to automate tasks with the CLI.

(This rate was chosen to be similar to the rate limiting docs for Laravel)

How has this been tested?

Manually.

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

@mpeven mpeven requested a review from nmanovic as a code owner July 30, 2020 19:23
@coveralls
Copy link

coveralls commented Jul 30, 2020

Pull Request Test Coverage Report for Build 6700

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 69.039%

Files with Coverage Reduction New Missed Lines %
cvat/apps/engine/media_extractors.py 5 76.11%
Totals Coverage Status
Change from base Build 6698: -0.02%
Covered Lines: 11177
Relevant Lines: 15673

💛 - Coveralls

@mpeven
Copy link
Contributor Author

mpeven commented Aug 3, 2020

@nmanovic if it helps in the review - I discussed this on Gitter with @azhavoro and he agrees this is a correct change to make.

@nmanovic
Copy link
Contributor

nmanovic commented Aug 3, 2020

@mpeven , thanks for the PR. 👍 Let me think a little bit about the issue. I understand the problem. Your new limit looks reasonable and I don't think that it is a security issue (100 per minute is pretty small). I will come back soon.

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mpeven , thanks one more time. Let's use the solution till we have something better.

@nmanovic nmanovic merged commit 737e948 into cvat-ai:develop Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants