feat(auth): upgrade casbin to v3 and enhance connection pool configurations
Some checks failed
Build / build (push) Successful in 2m23s
Build / build-docker (push) Failing after 1m37s

- Upgrade casbin from v2 to v3 across go.mod and pkg/auth/casbin.go
- Add slide captcha verification to registration flow (CheckVerified, ConsumeVerified)
- Add DB wrapper with connection pool statistics and health checks
- Add Redis connection pool optimizations with stats and health monitoring
- Add new config options: ConnMaxLifetime, HealthCheckInterval, EnableRetryOnError
- Optimize slow query threshold from 200ms to 100ms
- Add ping with retry mechanism for database and Redis connections
This commit is contained in:
2026-02-25 19:00:50 +08:00
parent 1da0ee1ed1
commit a111872b32
15 changed files with 534 additions and 93 deletions

3
go.mod
View File

@@ -8,7 +8,7 @@ go 1.25.0
require (
github.com/alicebob/miniredis/v2 v2.36.1
github.com/casbin/casbin/v2 v2.135.0
github.com/casbin/casbin/v3 v3.10.0
github.com/gin-gonic/gin v1.11.0
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/joho/godotenv v1.5.1
@@ -33,7 +33,6 @@ require (
github.com/bmatcuk/doublestar/v4 v4.10.0 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic/loader v0.5.0 // indirect
github.com/casbin/casbin/v3 v3.10.0 // indirect
github.com/casbin/govaluate v1.10.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/glebarez/go-sqlite v1.22.0 // indirect