Documentation
¶
Index ¶
- Constants
- func GetClientIP(r *http.Request) string
- func IPWhitelistMiddleware(cfg *config.Config) func(http.Handler) http.Handler
- func JWTAuthMiddleware(cfg *config.Config) func(http.Handler) http.Handler
- func LoggingMiddleware(next http.Handler) http.Handler
- func SecurityHeadersMiddleware(next http.Handler) http.Handler
Constants ¶
View Source
const (
UserContextKey contextKey = "user"
)
Variables ¶
This section is empty.
Functions ¶
func GetClientIP ¶
GetClientIP extracts the real client IP address Exported for backward compatibility - delegates to netutil.GetClientIP Deprecated: Use netutil.GetClientIP directly for new code
func IPWhitelistMiddleware ¶
IPWhitelistMiddleware enforces IP-based access control SECURITY: Logs warning at startup if whitelist file is missing (all IPs will be denied)
func JWTAuthMiddleware ¶
JWTAuthMiddleware validates JWT tokens The authService is created once and reused for all requests (performance optimization)
func LoggingMiddleware ¶
LoggingMiddleware logs all HTTP requests
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.