Cohee b2fa6a0afb Add rate limit to basic auth middleware (#5504)
* feat: add rate limiting to basic auth flow

* fix: round up retry-after duration

* feat: enhance point consume logic

* fix: move unauthorized webpage reading inside response function

* refactor: move getIpAddress to express-common

* fix: check for rate limit before checking creds

* fix: use correct rate limit pattern in /recover-step2

* feat: handle CF forwarded IP header in rate limit, whitelist and access logger

* feat: add individual config toggles for forwarded headers

* feat: enhance IP address retrieval to include forwarded IP for access logging

* chore: clean-up diff

* fix: don't consume points for missing credentials

* feat: log rate limited method and URL

Co-authored-by: Copilot <copilot@github.com>

* feat: make rate limiter points configurable

Co-authored-by: Copilot <copilot@github.com>

* feat: implement retry-after header for rate limiting responses

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-05-01 00:09:24 +03:00
2025-07-22 23:34:41 +03:00
2024-01-10 21:41:12 +02:00
2026-03-15 23:35:22 +02:00
2026-03-15 23:35:22 +02:00
2024-02-12 15:56:14 +02:00
2025-07-19 21:02:16 +03:00
2023-07-20 20:32:15 +03:00
2023-07-20 20:32:15 +03:00
2025-07-27 14:13:53 +03:00
2025-07-17 13:49:15 +00:00
2023-11-25 23:45:33 +02:00
2023-07-20 20:32:15 +03:00
2023-08-30 17:03:54 +03:00
2025-07-21 00:24:49 +03:00
S
Description
No description provided
Readme 117 MiB
Languages
JavaScript 88.5%
HTML 8.2%
CSS 2.8%
Less 0.3%