You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting rate limit per user (by setting zone: 'user'), the rate limit uses the ip zone instead.
Steps to reproduce
Set a rate limit of 1 per user, to a cloud functions for instance. Then call it with one user (using session token) and then with another one.
Actual Outcome
The rate limit is stored for the ip address.
Expected Outcome
The rate limit should be stored for the ID of the user and not the ip address.
Environment
Server
Parse Server version: 8.0.0
Operating system: macOS
Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local and AWS
Database
System (MongoDB or Postgres): MongoDB
Database version: 8
Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas
Client
SDK (iOS, Android, JavaScript, PHP, Unity, etc): JavaScript and curl
SDK version: latest
Logs
I can see where the bug is located. In the middlewares.js file, there is a keyGenerator that checks if request.zone === 'user' instead of checking route.zone
ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
New Issue Checklist
Issue Description
When setting rate limit per user (by setting
zone: 'user'
), the rate limit uses the ip zone instead.Steps to reproduce
Set a rate limit of 1 per user, to a cloud functions for instance. Then call it with one user (using session token) and then with another one.
Actual Outcome
The rate limit is stored for the ip address.
Expected Outcome
The rate limit should be stored for the ID of the user and not the ip address.
Environment
Server
8.0.0
macOS
local
andAWS
Database
MongoDB
8
MongoDB Atlas
Client
JavaScript
andcurl
latest
Logs
I can see where the bug is located. In the middlewares.js file, there is a keyGenerator that checks if
request.zone === 'user'
instead of checkingroute.zone
Setting request.zone = 'user' in the beginning of express routing makes it work.
The text was updated successfully, but these errors were encountered: