Versions in this module Expand all Collapse all v0 v0.1.1 Nov 12, 2026 v0.1.0 Oct 14, 2026 Changes in this version + const ColActorID + const ColAt + const ColCode + const ColID + const ColIP + const ColIdentifier + const ColImpersonatorID + const ColOK + const ColOp + const ColOrgID + const ColPlugin + const ColSessionID + const ColSeverity + const ColSubjectID + const ColTransport + const ColUserAgent + const DefaultPageSize + const DefaultRetention + const EndpointMyEvents + const IDPrefixEvent + const MaxPageSize + const PluginName + const RateCodePrefix + const SeverityAlert + const SeverityInfo + const SeverityWarn + const TableAliasEvent + const TableNameEvent + var ErrNoQueryBackend = auth.NewError("audit.no_query_backend", http.StatusNotImplemented, ...) + var EventActorID = sqlb.Col[string](TableEvent, ColActorID) + var EventAt = sqlb.Col[time.Time](TableEvent, ColAt) + var EventCode = sqlb.Col[string](TableEvent, ColCode) + var EventID = sqlb.Col[string](TableEvent, ColID) + var EventIP = sqlb.Col[string](TableEvent, ColIP) + var EventIdentifier = sqlb.Col[string](TableEvent, ColIdentifier) + var EventImpersonatorID = sqlb.Col[string](TableEvent, ColImpersonatorID) + var EventOK = sqlb.Col[bool](TableEvent, ColOK) + var EventOp = sqlb.Col[string](TableEvent, ColOp) + var EventOrgID = sqlb.Col[string](TableEvent, ColOrgID) + var EventPlugin = sqlb.Col[string](TableEvent, ColPlugin) + var EventSessionID = sqlb.Col[string](TableEvent, ColSessionID) + var EventSeverity = sqlb.Col[string](TableEvent, ColSeverity) + var EventSubjectID = sqlb.Col[string](TableEvent, ColSubjectID) + var EventTransport = sqlb.Col[string](TableEvent, ColTransport) + var EventUserAgent = sqlb.Col[string](TableEvent, ColUserAgent) + var TableEvent = sqlb.Table + func LinkedOp(provider string) auth.EndpointID + func OpsOf(t EventType) []string + type Event struct + ActorID string + At time.Time + Code string + ID string + IP string + Identifier string + ImpersonatorID string + OK bool + Op auth.EndpointID + OrgID string + Plugin string + SessionID string + Severity Severity + SubjectID string + Transport auth.Transport + Type EventType + UserAgent string + func MaskPII(e Event) Event + type EventType string + const TypeAccountLinked + const TypeAccountUnlinked + const TypeEmailVerificationSent + const TypeImpersonationStopped + const TypeInvitationAccepted + const TypeInvitationCanceled + const TypeInvitationCreated + const TypeInvitationRejected + const TypeMemberRemoved + const TypeMemberRoleUpdated + const TypeOrganizationCreated + const TypeOrganizationDeleted + const TypeOrganizationRoleCreated + const TypeOrganizationRoleDeleted + const TypeOrganizationRoleUpdated + const TypeOrganizationUpdated + const TypePasswordChanged + const TypePasswordResetCompleted + const TypePasswordResetRequested + const TypeRateLimitExceeded + const TypeSessionRevoked + const TypeSessionsRevokedAll + const TypeTeamCreated + const TypeTeamDeleted + const TypeTeamMemberAdded + const TypeTeamMemberRemoved + const TypeTeamUpdated + const TypeUserBanned + const TypeUserDeleted + const TypeUserEmailVerified + const TypeUserImpersonated + const TypeUserProfileUpdated + const TypeUserSignedIn + const TypeUserSignedOut + const TypeUserSignedUp + const TypeUserUnbanned + func TypeOf(op auth.EndpointID) EventType + type EventTyper interface + AuditEventTypes func() map[auth.EndpointID]string + type MyQuery struct + Limit int + OrgID string + Page int + Type EventType + type Option func(*Plugin) + func Queries() Option + func Redact(r Redactor) Option + func Retention(d time.Duration) Option + func Severities(m map[auth.EndpointID]Severity) Option + func SeverityFunc(f func(e Event, current Severity) Severity) Option + func Skip(ids ...auth.EndpointID) Option + func To(s Sink) Option + func Types(m map[auth.EndpointID]EventType) Option + type OrgScoped interface + AuditOrgID func() string + type Page struct + Events []Event + Limit int + Page int + Total int64 + type Plugin struct + func New(opts ...Option) *Plugin + func (p *Plugin) Events(ctx context.Context, q Query) (Page, error) + func (p *Plugin) Init(a *auth.Auth) error + func (p *Plugin) MyEvents(ctx context.Context, q MyQuery) (Page, error) + func (p *Plugin) Name() string + func (p *Plugin) OperationHooks() []auth.OperationHook + func (p *Plugin) Operations() []auth.Operation + func (p *Plugin) OpsOf(t EventType) []string + func (p *Plugin) OptionErr() error + func (p *Plugin) RateEvent(ctx context.Context, c *auth.Call, re auth.RateEvent) + func (p *Plugin) Record(ctx context.Context, e Event) error + func (p *Plugin) Sweep(ctx context.Context, _ time.Time) (int64, error) + func (p *Plugin) Tables() []sqlb.Table + func (p *Plugin) TypeOf(op auth.EndpointID) EventType + func (p *Plugin) TypedMigrations(engine string, t auth.SQLTypes) ([]auth.Migration, error) + type Querier interface + Events func(ctx context.Context, q Query) (Page, error) + type Query struct + Identifier string + Limit int + MinSeverity Severity + Op auth.EndpointID + OrgID string + Page int + Severity Severity + Type EventType + UserID string + type Redactor interface + Redact func(ctx context.Context, e Event) Event + var MaskPIIRedactor Redactor = RedactorFunc(func(_ context.Context, e Event) Event { ... }) + type RedactorFunc func(ctx context.Context, e Event) Event + func (f RedactorFunc) Redact(ctx context.Context, e Event) Event + type Severity = auth.SecuritySeverity + func DefaultSeverity(e Event) Severity + type Sink interface + Record func(ctx context.Context, e Event) error + type SinkFunc func(ctx context.Context, e Event) error + func (f SinkFunc) Record(ctx context.Context, e Event) error + type Targeted interface + TargetUserID func() string