fix: close auth, permission, contract and e2e review blockers

This commit is contained in:
Your Name
2026-05-28 15:19:13 +08:00
parent f33e39a702
commit 6be90ddff8
29 changed files with 1356 additions and 259 deletions

View File

@@ -1,6 +1,7 @@
package middleware
import (
"os"
"sync"
"time"
@@ -89,6 +90,12 @@ func (m *RateLimitMiddleware) Refresh() gin.HandlerFunc {
}
func (m *RateLimitMiddleware) limitForKey(key string, windowSeconds int, capacity int64) gin.HandlerFunc {
if os.Getenv("DISABLE_RATE_LIMIT") == "1" {
return func(c *gin.Context) {
c.Next()
}
}
limiter := m.getOrCreateLimiter(key, time.Duration(windowSeconds)*time.Second, capacity)
return func(c *gin.Context) {