Documentation
¶
Overview ¶
Package auditapi holds what the /site and /api read surfaces of the Audit log share (ADR 0022): cursor and page-size handling, and the customer-facing view of an entry, so the two handler packages map one shape and cannot diverge on masking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBadCursor = errors.New("invalid cursor")
ErrBadCursor is returned for a cursor that is not a positive entry id.
Functions ¶
func NextCursor ¶
NextCursor renders the cursor of the next page.
Types ¶
type View ¶
type View struct {
ID int64
OccurredAt time.Time
ActorKind string
ActorID *string
ActorName *string
Action string
TargetType string
TargetID *string
TargetName *string
Diff map[string]jx.Raw
RequestID *string
IP *string
UserAgent *string
}
View is an Audit entry as a customer sees it. A Staff member appears only as events.StaffLabel, with no id.
func StaffViewOf ¶
func StaffViewOf(e *ent.AuditEntry) View
StaffViewOf builds the platform console's view: like ViewOf, except that a Service credential is named (the customer sees it as "Sphericon staff").
func ViewOf ¶
func ViewOf(e *ent.AuditEntry) View
ViewOf builds the customer-facing view of a stored entry.