audit

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: Apache-2.0 Imports: 5 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 {
	ID        string             `json:"id,omitempty"`
	Type      EventType          `json:"type"`
	Timestamp time.Time          `json:"timestamp"`
	Principal identity.Principal `json:"principal"`
	Action    security.Action    `json:"action,omitempty"`
	Resource  security.Resource  `json:"resource"`
	RunID     string             `json:"run_id,omitempty"`
	Outcome   string             `json:"outcome,omitempty"`
	Reason    string             `json:"reason,omitempty"`
	Metadata  map[string]string  `json:"metadata,omitempty"`
	Payload   json.RawMessage    `json:"payload,omitempty"`
}

func CloneEvent

func CloneEvent(event Event) Event

func (Event) WithDefaults

func (event Event) WithDefaults(now time.Time) Event

type EventType

type EventType string
const (
	EventRunSubmitted EventType = "run.submitted"
	EventRunCancelled EventType = "run.cancelled"
	EventHITLDecided  EventType = "hitl.decided"
	EventToolInvoked  EventType = "tool.invoked"
	EventPolicyDenied EventType = "policy.denied"
)

type Sink

type Sink interface {
	Record(ctx context.Context, event Event) error
}

func NoopSink

func NoopSink() Sink

type SinkFunc

type SinkFunc func(ctx context.Context, event Event) error

func (SinkFunc) Record

func (fn SinkFunc) Record(ctx context.Context, event Event) error

Jump to

Keyboard shortcuts

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