Skip to content

Fix rate-limit whitelist handling - #8415

Open
puneetdixit200 wants to merge 1 commit into
AdguardTeam:masterfrom
puneetdixit200:fix-ratelimit-whitelist
Open

Fix rate-limit whitelist handling#8415
puneetdixit200 wants to merge 1 commit into
AdguardTeam:masterfrom
puneetdixit200:fix-ratelimit-whitelist

Conversation

@puneetdixit200

Copy link
Copy Markdown

Closes #8349.

This passes the configured rate-limit whitelist into the dnsproxy rate-limit middleware. Each whitelisted IP is converted to a full-length prefix, so repeated UDP requests from that address bypass the rate limiter while other clients still use the configured per-subnet buckets.

Testing:

  • go test ./internal/dnsforward -run '^TestNewRatelimitMw_ratelimitWhitelist$' -count=1\n- go test ./internal/dnsforward -count=1\n- go vet ./internal/dnsforward\n- go tool gofumpt --extra -e -l internal/dnsforward/config.go internal/dnsforward/config_internal_test.go\n- git diff --check

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.

Rate limiting allow list regression

2 participants