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

fix(rate-limit): use the value of an object key, instead of the key itself #7877

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

naftis
Copy link
Collaborator

@naftis naftis commented Oct 30, 2024

With this payload to /auth/authenticate

{ username: 'test.user', password: 'test' }

the cached rate-limiting key was username:/auth/authenticate.
It's supposed to be test.user:/auth/authenticate.

This comment has been minimized.

Copy link
Collaborator

@tahmidrahman-dsi tahmidrahman-dsi left a comment

Choose a reason for hiding this comment

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

Nice one

@naftis naftis changed the title chore(tests): add rate limiting tests for multiple users fix(rate-limit): fixes a specific key not being used in Redis Oct 30, 2024
@naftis naftis changed the title fix(rate-limit): fixes a specific key not being used in Redis fix(rate-limit): use the value of an object key, instead of the key itself Oct 30, 2024
@naftis naftis added this to the v1.6.0 milestone Oct 30, 2024
@ocrvs-bot
Copy link
Collaborator

Your environment is deployed to https://improve-rate-limit-tests.opencrvs.dev

@naftis naftis merged commit ad5c9ed into develop Oct 31, 2024
58 checks passed
@naftis naftis deleted the improve-rate-limit-tests branch October 31, 2024 11:59
github-actions bot pushed a commit that referenced this pull request Oct 31, 2024
naftis added a commit that referenced this pull request Oct 31, 2024
…tself (#7877)

* feat(tests): add rate limiting tests for multiple users

* fix: ratelimiting using 'username' as key instead of the actual username

* fix: add other tests back

* fix: do a full object access like the function supports

* chore(changelog): amend for 1.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants