To ensure efficient, secure, and high-performing usage of our URL shortener API, we need to implement rate limits. This will help prevent abuse and ensure fair usage across all users. Specifically, we need to enforce a limit of 10 URL shortens per hour and a total of 50 URL shortens per user for the free plan. Additionally, users should not be able to repeatedly log in to bypass these limits.
Expected Behavior
Each user can shorten up to 10 URLs per hour.
Each user can shorten a total of 50 URLs.
Users will receive a 'RATE_LIMIT_EXCEEDED' 429 error message if they exceed the per-hour limit.
Users will receive an 'API_USAGE_LIMIT_EXCEEDED' 429 error message if they exceed the total limit.
Users should not be able to bypass the limits by logging out and logging back in.
Current Behavior
Users can shorten an unlimited number of URLs without any restrictions.
Users can repeatedly log in to bypass any limitations.
Screenshots
[If applicable, add screenshots or images that help illustrate the issue.]
Reproducibility
[x] This issue is reproducible
[ ] This issue is not reproducible
Steps to Reproduce
Log in to the URL shortener.
Shorten more than 10 URLs within an hour.
Observe that there are no per-hour restrictions in place.
Shorten more than 50 URLs in total.
Observe that there are no total restrictions in place.
Log out and log back in.
Observe that you can continue shortening URLs without any limit.
Severity/Priority
[x] Critical
[ ] High
[ ] Medium
[ ] Low
Additional Information
Implement a tracking mechanism to count the number of URLs shortened by each user.
Ensure that the rate limiting applies consistently across all sessions for a user.
Introduce a mechanism to enforce the rate limits and return appropriate error messages when limits are exceeded.
Users should be informed of their limits and usage.
Checklist
[x] I have read and followed the project's code of conduct.
[x] I have searched for similar issues before creating this one.
[x] I have provided all the necessary information to understand and reproduce the issue.
[x] I am willing to contribute to the resolution of this issue.
Thank you for contributing to our project! We appreciate your help in improving it.
Issue Description
To ensure efficient, secure, and high-performing usage of our URL shortener API, we need to implement rate limits. This will help prevent abuse and ensure fair usage across all users. Specifically, we need to enforce a limit of 10 URL shortens per hour and a total of 50 URL shortens per user for the free plan. Additionally, users should not be able to repeatedly log in to bypass these limits.
Expected Behavior
Current Behavior
Screenshots
[If applicable, add screenshots or images that help illustrate the issue.]
Reproducibility
Steps to Reproduce
Severity/Priority
Additional Information
Checklist
Thank you for contributing to our project! We appreciate your help in improving it.