feat(security): add Redis-backed app-layer anti-DDoS rate limiting to proxy
Gitea Actions Runner Test / test-job (push) Successful in 1s
CI / check (push) Successful in 31s
CI / tests-integration (push) Successful in 1m42s
CI / tests-unit (push) Successful in 1m47s
CI / tests-ui (push) Successful in 2m40s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 2m3s
Gitea Actions Runner Test / test-job (push) Successful in 1s
CI / check (push) Successful in 31s
CI / tests-integration (push) Successful in 1m42s
CI / tests-unit (push) Successful in 1m47s
CI / tests-ui (push) Successful in 2m40s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 2m3s
This commit is contained in:
1 parent
d8f2a21011
commit
98a184953a
5 files changed
+184
-8
No files matched your search
@@ -0,0 +1,18 @@
|
||||
export type DdosCategory = "pages" | "api" | "auth";
|
||||
|
||||
export function classifyDdos(pathname: string): DdosCategory {
|
||||
if (
|
||||
pathname === "/api/auth" ||
|
||||
pathname.startsWith("/api/auth/") ||
|
||||
pathname === "/login" ||
|
||||
pathname.startsWith("/login/") ||
|
||||
pathname === "/register" ||
|
||||
pathname.startsWith("/register/") ||
|
||||
pathname === "/admin" ||
|
||||
pathname.startsWith("/admin/")
|
||||
) {
|
||||
return "auth";
|
||||
}
|
||||
if (pathname.startsWith("/api/")) return "api";
|
||||
return "pages";
|
||||
}
|
||||
Reference in new issue
Block a user