auditdb

package
v0.2.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Available = false

Variables

View Source
var ErrNotAvailable = errors.New("auditdb not available in this build")

Functions

This section is empty.

Types

type AuditEvent

type AuditEvent struct {
	ID int64 `json:"id"`

	Time time.Time `json:"time"`

	Host            string `json:"host"`
	Method          string `json:"method"`
	Path            string `json:"path"`
	ContentType     string `json:"content_type"`
	ContentEncoding string `json:"content_encoding,omitempty"`

	Attempted     bool         `json:"attempted"`
	RedactedCount int          `json:"redacted_count"`
	Matches       []AuditMatch `json:"matches"`
	Note          string       `json:"note,omitempty"`

	ResponseStatus      int    `json:"response_status,omitempty"`
	ResponseContentType string `json:"response_content_type,omitempty"`
	RestoreApplied      bool   `json:"restore_applied,omitempty"`
	RestoredCount       int    `json:"restored_count,omitempty"`
}

AuditEvent represents one proxy request's audit record (persisted to SQLite).

type AuditMatch

type AuditMatch struct {
	Category    string `json:"category"`
	Placeholder string `json:"placeholder"`
	Value       string `json:"value"`
	IsPreview   bool   `json:"is_preview"`
	Length      int    `json:"length"`
	Truncated   bool   `json:"truncated"`
}

AuditMatch matches the admin audit display fields (for easier JSON serialization and persistence).

type Store

type Store struct{}

Store is a placeholder implementation for the lite build: SQLite audit persistence is not available.

func Open

func Open(_ string) (*Store, error)

func (*Store) Add

func (s *Store) Add(ev AuditEvent) (AuditEvent, error)

func (*Store) Clear

func (s *Store) Clear() error

func (*Store) Close

func (s *Store) Close() error

func (*Store) List

func (s *Store) List(_ int) ([]AuditEvent, error)

func (*Store) MaxID

func (s *Store) MaxID() (int64, error)

func (*Store) Purge

func (s *Store) Purge(_ time.Duration) (int64, error)

func (*Store) StartPurgeLoop

func (s *Store) StartPurgeLoop(_ time.Duration, _ time.Duration) func()

func (*Store) Update

func (s *Store) Update(_ int64, _ func(*AuditEvent)) error

Jump to

Keyboard shortcuts

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