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,20 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { classifyDdos } from "@/lib/ddos";
|
||||
|
||||
describe("classifyDdos", () => {
|
||||
it.each([
|
||||
["/", "pages"],
|
||||
["/community", "pages"],
|
||||
["/login", "auth"],
|
||||
["/login/", "auth"],
|
||||
["/register", "auth"],
|
||||
["/admin", "auth"],
|
||||
["/admin/home", "auth"],
|
||||
["/api/auth/callback/credentials", "auth"],
|
||||
["/api/articles/hello", "api"],
|
||||
["/api/radio/stream", "api"],
|
||||
])(`classifies %s as %s`, (pathname, expected) => {
|
||||
expect(classifyDdos(pathname)).toBe(expected);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user