fix(routes): apply rate-limit and metrics middleware to /api/v2
The authenticated v1 group installs setupRateLimit and setupMetricsMiddleware; the v2 group only had cache-control and token middleware, so authenticated v2 endpoints bypassed the configured API rate limiter and route metrics. Mirror the v1 stack.
This commit is contained in:
parent
d2a3186b3e
commit
14446e3c41
|
|
@ -382,6 +382,10 @@ func noStoreCacheControl() echo.MiddlewareFunc {
|
|||
func registerAPIRoutesV2(e *echo.Echo, a *echo.Group) {
|
||||
a.Use(noStoreCacheControl())
|
||||
a.Use(SetupTokenMiddleware())
|
||||
// Match the authenticated v1 group: rate limiting and route metrics
|
||||
// apply to v2 resource endpoints too.
|
||||
setupRateLimit(a, config.RateLimitKind.GetString())
|
||||
setupMetricsMiddleware(a)
|
||||
|
||||
api := apiv2.NewAPI(e, a)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue