sanitization

package
v1.0.63 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package sanitization provides centralized data sanitization utilities to prevent sensitive data exposure across the Lift framework.

Index

Constants

This section is empty.

Variables

View Source
var AllowedFields = map[string]bool{
	"card_bin":   true,
	"card_brand": true,
	"card_type":  true,
}

AllowedFields are field names that should not be sanitized

Functions

func SanitizeFieldValue

func SanitizeFieldValue(key string, value any) any

SanitizeFieldValue uses the default sanitizer

func SanitizeHeaders

func SanitizeHeaders(headers map[string][]string) map[string]string

SanitizeHeaders uses the default sanitizer

func SanitizeMap

func SanitizeMap(data map[string]any) map[string]any

SanitizeMap uses the default sanitizer

func SanitizeQueryParams

func SanitizeQueryParams(params map[string][]string) map[string]string

SanitizeQueryParams uses the default sanitizer

Types

type Sanitizer

type Sanitizer struct {
	// contains filtered or unexported fields
}

Sanitizer provides methods for sanitizing various types of data

func Default

func Default() *Sanitizer

Default returns a sanitizer with default data protection configuration

func New

New creates a new Sanitizer with a data protection manager

func (*Sanitizer) SanitizeFieldValue

func (s *Sanitizer) SanitizeFieldValue(key string, value any) any

SanitizeFieldValue sanitizes a field value based on its key name and data classification

func (*Sanitizer) SanitizeHeaders

func (s *Sanitizer) SanitizeHeaders(headers map[string][]string) map[string]string

SanitizeHeaders removes sensitive headers from a map

func (*Sanitizer) SanitizeMap

func (s *Sanitizer) SanitizeMap(data map[string]any) map[string]any

SanitizeMap applies sanitization to all values in a map

func (*Sanitizer) SanitizeQueryParams

func (s *Sanitizer) SanitizeQueryParams(params map[string][]string) map[string]string

SanitizeQueryParams sanitizes query parameters

Jump to

Keyboard shortcuts

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