Documentation
¶
Overview ¶
Package audit writes the immutable audit log: who did what to which target, before and after, from where, and whether it was allowed.
Index ¶
Constants ¶
View Source
const ( Allowed = "allowed" Denied = "denied" Failed = "error" )
Result of an audited action.
Variables ¶
This section is empty.
Functions ¶
func PrincipalFrom ¶
PrincipalFrom returns the acting principal stored in ctx, if any.
func WithPrincipal ¶
WithPrincipal stores the acting principal in ctx.
Types ¶
type Event ¶
type Event struct {
WorkspaceID *uuid.UUID
Action string // dotted verb: "routing.update", "apikey.create", "auth.sign_in"
TargetType string
TargetID string
TargetName string
Result string
Reason string
Before any
After any
Metadata map[string]any
// Actor overrides the actor taken from the context (system jobs, sign-in).
Actor *Actor
}
Event is one audit entry. Use Log to write it.
Click to show internal directories.
Click to hide internal directories.