fix: remove rate limit for authenticated users, increase for public
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m4s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m4s
This commit is contained in:
parent
ee441dfefd
commit
7278008d7e
1 changed files with 1 additions and 7 deletions
|
|
@ -127,7 +127,7 @@ func main() {
|
||||||
// Public Share Endpoints (Rate Limited)
|
// Public Share Endpoints (Rate Limited)
|
||||||
public := app.Group("/api/public")
|
public := app.Group("/api/public")
|
||||||
public.Use(limiter.New(limiter.Config{
|
public.Use(limiter.New(limiter.Config{
|
||||||
Max: 20,
|
Max: 500,
|
||||||
Expiration: 1 * time.Minute,
|
Expiration: 1 * time.Minute,
|
||||||
}))
|
}))
|
||||||
public.Post("/share/:id/token", shareHandler.CreateShareToken)
|
public.Post("/share/:id/token", shareHandler.CreateShareToken)
|
||||||
|
|
@ -141,12 +141,6 @@ func main() {
|
||||||
// === PROTECTED ROUTES (require JWT) ===
|
// === PROTECTED ROUTES (require JWT) ===
|
||||||
protected := app.Group("/api", middleware.AuthMiddleware(cfg.JWTSecret))
|
protected := app.Group("/api", middleware.AuthMiddleware(cfg.JWTSecret))
|
||||||
|
|
||||||
// Apply rate limiting to all authenticated endpoints (e.g. 100 req/min)
|
|
||||||
protected.Use(limiter.New(limiter.Config{
|
|
||||||
Max: 100,
|
|
||||||
Expiration: 1 * time.Minute,
|
|
||||||
}))
|
|
||||||
|
|
||||||
// Token refresh
|
// Token refresh
|
||||||
protected.Post("/auth/refresh", authHandler.Refresh)
|
protected.Post("/auth/refresh", authHandler.Refresh)
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue