Harden explorer AI runtime and API ownership
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user