masking

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package masking provides utilities for redacting sensitive data from HTTP events and log messages before storage.

Sensitive data includes: Authorization headers, Cookies, API keys, tokens, passwords, and secrets. Detection is based on field names and regex patterns.

Masking is applied automatically before storing event JSON and log messages in the database. The original unmasked data is still passed to Lua function handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSensitiveBodyField

func IsSensitiveBodyField(key string) bool

IsSensitiveBodyField checks if a JSON body field name suggests it contains sensitive data Uses exact match or prefix match to avoid false positives (e.g., "completion_tokens" should not match "token")

func IsSensitiveKey

func IsSensitiveKey(key string) bool

IsSensitiveKey checks if a key name suggests it contains sensitive data

func IsSensitiveQueryParam

func IsSensitiveQueryParam(key string) bool

IsSensitiveQueryParam checks if a query parameter name suggests it contains sensitive data

func MaskHTTPEvent

func MaskHTTPEvent(event events.HTTPEvent) events.HTTPEvent

MaskHTTPEvent creates a copy of the HTTPEvent with sensitive data masked

func MaskHeaders

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

MaskHeaders masks sensitive headers in a map

func MaskJSONBody

func MaskJSONBody(body string) string

MaskJSONBody attempts to parse the body as JSON and mask sensitive fields If parsing fails, returns the original body unchanged

func MaskLogMessage

func MaskLogMessage(message string) string

MaskLogMessage masks sensitive patterns in log messages

func MaskQueryParams

func MaskQueryParams(query map[string]string) map[string]string

MaskQueryParams masks sensitive query parameters in a map

Types

This section is empty.

Jump to

Keyboard shortcuts

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