audit

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package audit provides the Auditor interface and supporting types for audit logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auditor

type Auditor interface {
	Record(ctx context.Context, entry Entry) error
	RecordSuccess(ctx context.Context, entry Entry) error
	RecordFailure(ctx context.Context, entry Entry, err error) error
	RecordRejected(ctx context.Context, entry Entry, reason string) error
}

Auditor writes audit entries to persistent storage.

type Entry

type Entry struct {
	Subject *Subject
	Action  string
	Target  Target
	Request any
}

Entry represents a single audit record.

type Subject

type Subject struct {
	SubjectType string
	SubjectID   string
	UID         string
	IPAddress   string
	UserAgent   string
}

Subject carries authenticated actor identity.

type Target

type Target struct {
	Type string
	ID   string
}

Target identifies the resource being acted on.

Jump to

Keyboard shortcuts

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