- Stats, keys, providers, scan, recon, dorks, config endpoints - JSON response wrappers with proper tags for all entities - Filtering, pagination, 404/204/202 status codes - SSE hub stub (full impl in task 2) - Resolved merge conflict in schema.sql - 16 passing tests covering all endpoints
35 lines
893 B
Go
35 lines
893 B
Go
// Package web implements the KeyHunter embedded web dashboard and REST API.
|
|
package web
|
|
|
|
import (
|
|
"github.com/salvacybersec/keyhunter/pkg/dorks"
|
|
"github.com/salvacybersec/keyhunter/pkg/engine"
|
|
"github.com/salvacybersec/keyhunter/pkg/providers"
|
|
"github.com/salvacybersec/keyhunter/pkg/recon"
|
|
"github.com/salvacybersec/keyhunter/pkg/storage"
|
|
)
|
|
|
|
// ServerConfig holds all dependencies injected into the web Server.
|
|
type ServerConfig struct {
|
|
DB *storage.DB
|
|
EncKey []byte
|
|
Providers *providers.Registry
|
|
Dorks *dorks.Registry
|
|
ScanEngine *engine.Engine
|
|
ReconEngine *recon.Engine
|
|
}
|
|
|
|
// Server is the central HTTP server holding all handler dependencies.
|
|
type Server struct {
|
|
cfg ServerConfig
|
|
sse *SSEHub
|
|
}
|
|
|
|
// NewServer creates a Server with the given configuration.
|
|
func NewServer(cfg ServerConfig) *Server {
|
|
return &Server{
|
|
cfg: cfg,
|
|
sse: NewSSEHub(),
|
|
}
|
|
}
|