audit

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendRequest

type AppendRequest struct {
	ActorType    string
	ActorID      string
	Action       string
	ResourceType string
	ResourceID   string
	Outcome      string
	Details      any
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(database *storage.DB, privateKey ed25519.PrivateKey, anchorPath string) (*Service, error)

func NewWithKeyring

func NewWithKeyring(database *storage.DB, privateKey ed25519.PrivateKey, historical []ed25519.PublicKey, anchorPath string) (*Service, error)

NewWithKeyring keeps historical audit records verifiable across signing-key rotation. Historical keys are verification-only; all new entries and anchors use the current private key.

func (*Service) Append

func (service *Service) Append(ctx context.Context, request AppendRequest) (model.AuditEntry, error)

func (*Service) AppendWithMutation

func (service *Service) AppendWithMutation(
	ctx context.Context,
	request AppendRequest,
	mutation storage.AuditedMutation,
) (model.AuditEntry, error)

AppendWithMutation serializes the chain and executes a storage-issued closed mutation capability. Only reviewed storage transitions can implement that capability, and each commits the entry in the same SQLite transaction as its domain mutation. The external anchor advances only after that commit.

func (*Service) Verify

func (service *Service) Verify(ctx context.Context) error

Jump to

Keyboard shortcuts

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