Harden explorer AI runtime and API ownership

This commit is contained in:
defiQUG
2026-03-27 14:12:14 -07:00
parent c9e792d55f
commit 3265e94da8
10 changed files with 774 additions and 24 deletions

View File

@@ -11,8 +11,8 @@ import (
"strings"
"time"
"github.com/explorer/backend/auth"
"github.com/explorer/backend/api/middleware"
"github.com/explorer/backend/auth"
httpmiddleware "github.com/explorer/backend/libs/go-http-middleware"
"github.com/jackc/pgx/v5/pgxpool"
)
@@ -23,6 +23,8 @@ type Server struct {
chainID int
walletAuth *auth.WalletAuth
jwtSecret []byte
aiLimiter *AIRateLimiter
aiMetrics *AIMetrics
}
// NewServer creates a new REST API server
@@ -41,6 +43,8 @@ func NewServer(db *pgxpool.Pool, chainID int) *Server {
chainID: chainID,
walletAuth: walletAuth,
jwtSecret: jwtSecret,
aiLimiter: NewAIRateLimiter(),
aiMetrics: NewAIMetrics(),
}
}