Versions in this module Expand all Collapse all v0 v0.25.3 Nov 1, 2026 Changes in this version + type APIKeyAuth struct + HeaderName string + Keys []string + QueryParam string + type Auth struct + APIKey *APIKeyAuth + Basic *BasicAuth + Bearer *BearerAuth + Custom *CustomAuth + Enabled bool + HeaderName string + TokenPrefix string + Type string + type BasicAuth struct + Users []User + type BearerAuth struct + Tokens []string + type CSP struct + Custom string + Enabled bool + Mode string + func (c *CSP) GetPolicy() string + type CSRF struct + Enabled bool + ExemptMethods []string + Secret string + TokenCookieName string + TokenFormField string + TokenLength int + func DefaultCSRF() *CSRF + type CustomAuth struct + ExpectedValue string + HeaderName string + Headers map[string]string + type JWT struct + Algorithm string + Enabled bool + Expiry int + Issuer string + Secret string + type Pprof struct + AllowedIPs []string + Enabled bool + Password string + RequireHTTPS bool + Username string + type Protection struct + API *ServiceProtection + Health *ServiceProtection + Metrics *ServiceProtection + PProf *ServiceProtection + Swagger *ServiceProtection + type Security struct + Auth *Auth + CSP *CSP + CSRF *CSRF + JWT *JWT + ModuleName string + Protection *Protection + Validation *Validation + func Default() *Security + func (s *Security) Clone() internal.Configurable + func (s *Security) EnableAuth() *Security + func (s *Security) EnableCSP() *Security + func (s *Security) EnableJWT() *Security + func (s *Security) Get() interface{} + func (s *Security) IsAuthEnabled() bool + func (s *Security) IsCSPEnabled() bool + func (s *Security) IsJWTEnabled() bool + func (s *Security) Set(data interface{}) + func (s *Security) Validate() error + func (s *Security) WithAuth(enabled bool, authType, headerName, tokenPrefix string) *Security + func (s *Security) WithCSP(enabled bool, mode, custom string) *Security + func (s *Security) WithJWT(enabled bool, secret string, expiry int, issuer, algorithm string) *Security + func (s *Security) WithModuleName(moduleName string) *Security + type ServiceProtection struct + AuthRequired bool + AuthType string + Enabled bool + IPWhitelist []string + Password string + RequireHTTPS bool + Username string + type User struct + Password string + Permissions []string + Role string + Username string + type Validation struct + DangerousExtensions []string + HTTPMethods []string + XSSPatterns []string + func DefaultValidation() *Validation