refactor(api): rate limiting sistemini basitleştir ve sadece login endpoint'inde tut

Merkezi rate limiting middleware dosyasını kaldırıp rate limiting'i sadece
login endpoint'ine özel hale getirildi. Diğer API endpoint'lerindeki rate
limiting kısıtlamaları (loop, timer, torrent) kaldırıldı. Login rate limiter
artık auth.routes.ts dosyasında inline olarak tanımlanıyor.
This commit is contained in:
2026-01-05 19:43:41 +03:00
parent 377971411a
commit 9f3b2cbb24
5 changed files with 24 additions and 68 deletions

View File

@@ -10,11 +10,10 @@ import { config } from "../config";
import { setArchiveStatus } from "../torrent/torrent.archive";
import { nowIso } from "../utils/time";
import { readLoopLogs } from "../storage/loopLogs";
import { apiLimiter } from "../middleware/rate-limiter";
const router = Router();
router.post("/start", apiLimiter, async (req, res) => {
router.post("/start", async (req, res) => {
const parsed = loopStartSchema.safeParse(req.body);
if (!parsed.success) {
return res.status(400).json({ error: parsed.error.flatten() });
@@ -71,7 +70,7 @@ router.post("/start", apiLimiter, async (req, res) => {
res.json(job);
});
router.post("/stop/:jobId", apiLimiter, async (req, res) => {
router.post("/stop/:jobId", async (req, res) => {
const { jobId } = req.params;
const job = await stopLoopJob(jobId);
if (!job) {
@@ -86,7 +85,7 @@ router.post("/stop/:jobId", apiLimiter, async (req, res) => {
res.json(job);
});
router.post("/stop-by-hash", apiLimiter, async (req, res) => {
router.post("/stop-by-hash", async (req, res) => {
const { hash } = req.body ?? {};
if (!hash) {
return res.status(400).json({ error: "Missing hash" });