audit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package audit is the module manifest: what the kernel needs to know about the audit trail that it cannot learn from a function call.

What it does is subscribe to everything, and the manifest says so with one field: module.SubscribeAll. The kernel expands it into one subscription per declared event once every manifest is in hand, so a module that emits an event is audited by having emitted it — wherever it sits in the composition, and with nothing registered anywhere to make that true.

main used to compute the list and pass it in, which worked only while audit was composed last. A module listed after it was a module nothing recorded, and the failure was silence.

It declares no events of its own. An audit of audits is a loop.

What a payload may carry

The trail stores every payload as its module published it, verbatim, and that is the design: what happened is the event's name and the module's own account of it, and a schema that tried to normalise those would be a schema every new module had to be taught. The price is a convention, and it is stated here because this is the module that pays it — an event carries identifiers, not content.

It is a convention rather than a check, because nothing can read a payload and tell a title from a secret. What it is now is a convention with one enforced case: notification.email_requested used to carry the whole message, address and body and link, which put every notice in the audit trail and would have put every set-password link there the day one was mailed. It carries two identifiers now, and the worker reads the row back. A payload that carries content is a payload kept for a year in a table an administrator can read.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(deps Deps) module.Module

Module is the manifest, and the service it is built on.

Types

type Deps

type Deps struct {
	// Tenants is how the retention sweep reaches every tenant.
	Tenants jobs.TenantLister

	// RetentionDays is how long a row is kept; zero means a year. It is a
	// dependency rather than a constant because a retention period is a
	// compliance obligation, and a module that chose one would be choosing
	// somebody else's. config.Audit is where it comes from.
	RetentionDays int
}

Deps is what this module cannot make for itself.

Directories

Path Synopsis
Package contracts is everything another module, an app or a test may know about the audit trail: the row, the query, the permission and the Service interface.
Package contracts is everything another module, an app or a test may know about the audit trail: the row, the query, the permission and the Service interface.
audittest
Package audittest is the conformance suite for contracts.Service, and a fake that passes it.
Package audittest is the conformance suite for contracts.Service, and a fake that passes it.
Package internal is every implementation of the audit module.
Package internal is every implementation of the audit module.

Jump to

Keyboard shortcuts

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