feat(v2/httpserver): merge full access logger from v2/http into httpserver
Summary
Merges the full-featured access logger developed on db-v2-http-access-logger into the httpserver package, eliminating the standalone v2/http package entirely.
Changes
-
v2/correlation— new package for correlation ID context propagation (InjectToContext/ExtractFromContext), replacing the previous v1 dependency -
v2/httpserver/access_logger.go— full access logger promoted fromv2/http, now exported asAccessLogger(next http.Handler, logger *slog.Logger) http.Handlerfor standalone use -
v2/httpserver/mask.go— URL masking utilities (unexported), parity with v1 mask package and GitLab Rails sensitive param list -
v2/httpserver/middleware.go— replaces the minimalloggingMiddleware(3 fields) withaccessLoggerMiddlewarewrapping the fullAccessLogger -
v2/httpserver/server_test.go— updatesTestLoggingMiddleware_LogsRequestto match the new"access"message and"uri"field
Log fields emitted
correlation_id, method, uri, status, duration_s, system, host, proto, remote_addr, remote_ip, referrer, user_agent, written_bytes, content_type, ttfb_s
Sensitive query params (password, token, secret, key, etc.) and URL userinfo are masked with [FILTERED]. X-Forwarded-For is used when present to surface the real client IP.
Why merge into httpserver?
- Avoids the
v2/httppackage name clashing with"net/http"in every caller - Single canonical home for HTTP middleware alongside tracing
-
AccessLoggeris usable both as the built-in middleware (viaConfig.Logger) and as a standalone handler wrapper for sub-routers or non-Server use