security

package
v0.0.0-...-0b0e567 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCallWrapper

func NewCallWrapper(opts ...Option) client.CallWrapper

NewCallWrapper creates a new call wrapper for security checks

func NewClientWrapper

func NewClientWrapper(opts ...Option) client.Wrapper

NewClientWrapper creates a new client wrapper for security checks

func NewHandlerWrapper

func NewHandlerWrapper(opts ...Option) server.HandlerWrapper

NewHandlerWrapper creates a new handler wrapper for basic security checks

Types

type Config

type Config struct {
	XSSPatterns          []string          `yaml:"xss_patterns,omitempty"`
	SQLInjectionPatterns []string          `yaml:"sql_injection_patterns,omitempty"`
	SecurityHeaders      map[string]string `yaml:"security_headers,omitempty"`
}

type Option

type Option func(*Options)

Option function for setting options

func WithConfig

func WithConfig(cfg *Config) Option

func WithSQLInjectionPatterns

func WithSQLInjectionPatterns(patterns []string) Option

WithSQLInjectionPatterns sets custom SQL injection patterns

func WithSecurityHeaders

func WithSecurityHeaders(headers map[string]string) Option

WithSecurityHeaders sets custom security headers

func WithXSSPatterns

func WithXSSPatterns(patterns []string) Option

WithXSSPatterns sets custom XSS patterns

type Options

type Options struct {
	XSSPatterns          []string
	SQLInjectionPatterns []string
	SecurityHeaders      map[string]string
}

Options for the security middleware

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns default options

Source Files

  • options.go
  • wrappers.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL