Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router handles HTTP routing
func NewRouter ¶
func NewRouter( authVerifier *auth.Verifier, signService *service.SignService, signerManager evm.SignerManager, ruleRepo storage.RuleRepository, auditRepo storage.AuditRepository, logger *slog.Logger, config RouterConfig, ) (*Router, error)
NewRouter creates a new router
func (*Router) StartRateLimitCleanup ¶
func (r *Router) StartRateLimitCleanup(stop <-chan struct{})
StartRateLimitCleanup starts the rate limit cleanup routine
type RouterConfig ¶
type RouterConfig struct {
Version string
IPWhitelistConfig *middleware.IPWhitelist
IPRateLimit int // requests per minute per IP (pre-auth); 0 = use default (200)
SolidityValidator *evm.SolidityRuleValidator
JSEvaluator *evm.JSRuleEvaluator
Template *TemplateConfig
ApprovalGuard *service.ManualApprovalGuard // optional: for admin resume endpoint
APIKeyRepo storage.APIKeyRepository // optional: for signer access visibility
RulesAPIReadonly bool // block rule/template mutations via API
SignersAPIReadonly bool // block signer/HD-wallet creation via API
}
RouterConfig contains configuration for the router
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server
type ServerConfig ¶
type ServerConfig struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
ReadTimeout time.Duration `yaml:"read_timeout"`
WriteTimeout time.Duration `yaml:"write_timeout"`
// TLS
TLSEnabled bool
TLSCertFile string
TLSKeyFile string
TLSCAFile string // CA cert for mTLS client verification
TLSClientAuth bool // Require client certificates (mTLS)
}
ServerConfig contains configuration for the HTTP server
func DefaultServerConfig ¶
func DefaultServerConfig() ServerConfig
DefaultServerConfig returns the default server configuration
type TemplateConfig ¶
type TemplateConfig struct {
TemplateRepo storage.TemplateRepository
TemplateService *service.TemplateService
}
TemplateConfig contains template-related dependencies for the router
Click to show internal directories.
Click to hide internal directories.