Skip to content

Rate Limiting for Webhooks #3152

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

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Rate Limiting for Webhooks #3152

wants to merge 17 commits into from

Conversation

stuartc
Copy link
Member

@stuartc stuartc commented Apr 25, 2025

Description

This PR [adds/changes/fixes]... (A description of your work goes here.)

Closes #__

Validation steps

  1. (How can a reviewer validate your work?)

Additional notes for the reviewer

  1. (Is there anything else the reviewer should know or look out for?)

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

stuartc added 9 commits March 31, 2025 14:02
- Upgraded `hammer_backend_mnesia` to version 0.7.0 and `hammer` to version 7.0.
- Removed old Hammer configuration from `config/config.exs` and `config/test.exs`.
- Introduced a new `Lightning.RateLimiters` module to handle rate limiting for failure alerts.
- Updated `Lightning.FailureAlerter` to utilize the new rate limiting logic.
- Adjusted tests to reflect changes in rate limiting behavior.
- Introduced a new Bash script `local_cluster` for managing local cluster instances.
- The script supports starting multiple instances (1-4) and connecting to specific nodes.
- Added functionality for an optional Caddy reverse proxy to manage traffic on port 4000.
- Updated `bootstrap.ex` to include RTM port configuration and refactored HTTP configuration handling for production and non-production environments.
- Introduced a new function `max_dataclip_size_bytes` in the `Lightning.Config` module to retrieve the maximum dataclip size from application environment.
- Updated `LightningWeb.PlugConfigs` to use the new configuration function instead of directly fetching from the environment.
- Modified tests in `WebhooksControllerTest` to stub the `max_dataclip_size_bytes` function for better isolation and control during testing.
- Renamed `inspect` to `to_list` in `ReplicatedRateLimiter` for clarity.
- Updated `init` function in `ReplicatedRateLimiter` to use a configuration function.
- Removed the `Listener` module from `Lightning.RateLimiters` as it is no longer needed.
- Adjusted tests to reflect the new `to_list` function and removed unnecessary logging setup.
@github-project-automation github-project-automation bot moved this to New Issues in v2 Apr 25, 2025
jyeshe added 2 commits April 30, 2025 11:54
4 out of 10 (40%) left to reach consistency:
DeltaCrdt.get(config.crdt_name, {"project2", "#{Node.self()}"}) #=> {4, 1746007259}
@jyeshe jyeshe force-pushed the rate-limit-webhooks branch 4 times, most recently from 88fdb5b to 4ae3501 Compare April 30, 2025 17:08
@jyeshe jyeshe force-pushed the rate-limit-webhooks branch from 4ae3501 to 5ec9781 Compare May 1, 2025 19:36
@jyeshe jyeshe force-pushed the rate-limit-webhooks branch from bbc4a85 to 6110b1a Compare May 1, 2025 21:17
@jyeshe jyeshe force-pushed the rate-limit-webhooks branch 4 times, most recently from c0c533f to 6212e39 Compare May 2, 2025 09:24
@jyeshe jyeshe force-pushed the rate-limit-webhooks branch from 6212e39 to 285840c Compare May 2, 2025 09:51
@jyeshe jyeshe force-pushed the rate-limit-webhooks branch from 285840c to 2f58f95 Compare May 2, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
Development

Successfully merging this pull request may close these issues.

2 participants