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: applying rate limiting middleware to all except push endpoints #328

Merged
merged 1 commit into from
May 16, 2024

Conversation

geekbrother
Copy link
Contributor

@geekbrother geekbrother commented May 16, 2024

Description

This PR applying the rate-limiting middleware to all endpoints except message push because it's used by the Relay and validated by the signature.

Also, this PR fixes the bug of double applying the geoblock and with state middlewares.

How Has This Been Tested?

  • Current integration tests.

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@geekbrother geekbrother self-assigned this May 16, 2024
@arein arein added the accepted The issue has been accepted into the project label May 16, 2024
@geekbrother geekbrother force-pushed the fix/rate_limit_push_exception branch from 881b9ee to b3ebb48 Compare May 16, 2024 14:03
@geekbrother geekbrother marked this pull request as draft May 16, 2024 16:43
@geekbrother geekbrother force-pushed the fix/rate_limit_push_exception branch from b3ebb48 to df18a14 Compare May 16, 2024 16:48
.route(
"/:tenant_id/clients/:id",
post(handlers::push_message::handler),
)
.layer(global_middleware);

let app = if let Some(geoblock) = state_arc.geoblock.clone() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this part as we are applying the geoblock and state later and not depending on the multitenant feature. This is a fix to double applying the geoblock and state.

@geekbrother geekbrother marked this pull request as ready for review May 16, 2024 16:51
@geekbrother geekbrother marked this pull request as draft May 16, 2024 16:53
@geekbrother geekbrother force-pushed the fix/rate_limit_push_exception branch from df18a14 to e3122ba Compare May 16, 2024 17:28
@geekbrother geekbrother marked this pull request as ready for review May 16, 2024 17:37
Copy link
Member

@chris13524 chris13524 left a comment

Choose a reason for hiding this comment

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

Thanks!

@geekbrother geekbrother merged commit 532a9bc into main May 16, 2024
6 checks passed
@geekbrother geekbrother deleted the fix/rate_limit_push_exception branch May 16, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue has been accepted into the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants