audit

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Actor     string
	SessionID *uuid.UUID
	RunID     *uuid.UUID
	Action    string
	Metadata  models.JSONB
}

type Logger

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

func New

func New(db *sqlx.DB, hmacKey string) *Logger

New creates an audit Logger. hmacKey is the raw HMAC-SHA256 signing key (AUDIT_HMAC_KEY env var). Pass an empty string to disable signing.

func (*Logger) Log

func (l *Logger) Log(ctx context.Context, e Event)

func (*Logger) VerifyAuditSig

func (l *Logger) VerifyAuditSig(entry *models.AuditLog) bool

VerifyAuditSig re-computes the HMAC for entry and returns true when it matches the stored Sig. Returns false when signing is not configured.

Jump to

Keyboard shortcuts

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