{"modulePath":"github.com/swayyaam/OSCTF","version":"v0.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\nPackage httpserver assembles the chi router: middleware stack, operational endpoints (/healthz, /readyz, /metrics), the mounted /api/v0 handler, and the embedded SPA fallback. It may import everything below it in the tree.\n\n## Functions\n\n```go\nfunc New(d Deps) http.Handler\n```\nNew builds the top-level HTTP handler.\n\n## Types\n\n```go\ntype Deps struct {\n\tLog *slog.Logger\n\t// Handlers implements the generated API surface. Nil mounts a 501 catch-all.\n\tHandlers *handlers.Server\n\tReady    ReadyFunc\n\t// Sessions resolves cookies to identities; nil skips session handling.\n\tSessions *auth.SessionStore\n\t// BaseOrigin is the deployment origin for the CSRF check (required when\n\t// Sessions is set). CORSDevOrigin optionally allows the Vite dev server.\n\tBaseOrigin    string\n\tCORSDevOrigin string\n\t// WSHandler serves GET /api/{v0,v1}/ws (the live scoreboard socket). Nil disables it.\n\tWSHandler http.Handler\n\t// V0Sunset is the date advertised in the /api/v0 Sunset header (RFC 8594). The zero\n\t// value still emits a header (an ancient date); production passes cfg.APIV0Sunset.\n\tV0Sunset time.Time\n\t// Tokens resolves `Authorization: Bearer` API tokens; nil disables token auth.\n\tTokens *auth.TokenService\n\t// Limiter rate-limits token requests by token identity; nil disables that limit.\n\tLimiter         *redisx.Limiter\n\tTokenRateBurst  int\n\tTokenRateWindow time.Duration\n\t// TrustProxy mirrors OSCTF_TRUST_PROXY. When false the server warns once if it\n\t// receives a forwarded header, since a proxy is likely in front but its client IPs\n\t// are being ignored (every request would then key to the proxy IP).\n\tTrustProxy bool\n}\n```\nDeps are the inputs to New.\n\n```go\ntype ReadyFunc func(ctx context.Context) map[string]string\n```\nReadyFunc reports readiness: it returns a map of component name -\u003e failure reason. An empty map means everything is reachable.\n\n","path":"github.com/swayyaam/OSCTF/internal/httpserver","name":"httpserver","synopsis":"Package httpserver assembles the chi router: middleware stack, operational endpoints (/healthz, /readyz, /metrics), the mounted /api/v0 handler, and the embedded SPA fallback.","isRedistributable":true}
