Skip to content

feat: add configurable per-user rate limiting for review submissions#711

Open
Mridul-Dev123 wants to merge 1 commit intoaiondemand:developfrom
Mridul-Dev123:feat/rate-limit-review-submissions-663
Open

feat: add configurable per-user rate limiting for review submissions#711
Mridul-Dev123 wants to merge 1 commit intoaiondemand:developfrom
Mridul-Dev123:feat/rate-limit-review-submissions-663

Conversation

@Mridul-Dev123
Copy link

(#663)

Change(s)

Change Type: Added

Change Category: Internal

Changelog Entry: Added configurable per-user rate limiting for review submission
requests to prevent users from congesting the review pipeline.

Users are limited to max_submissions_per_user (default: 10) review submission
requests within a rolling submission_window_seconds (default: 3600s = 1 hour)
window. Connector users (platform roles) bypass this limit, as they use the
connector workflow designed for systematic uploads.

The limit values are configurable via config.default.toml or
config.override.toml under the [rate_limits] section.

How to Test

Run the rate limiter unit tests inside Docker:

docker run --rm -v "${PWD}/src:/app" -e KEYCLOAK_CLIENT_SECRET="mocked_secret" \
  --entrypoint sh aiod/metadata_catalogue:local \
  -c "pip install -q pytest && python -m pytest tests/test_review_rate_limit.py -v --noconftest"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants