compliance

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package compliance renders bounded, self-contained compliance artifacts. It intentionally has no browser, native-library, or network dependency.

Index

Constants

View Source
const (
	ArchiveManifestName  = "manifest.json"
	ArchiveSchemaVersion = "agentsql.audit-archive/v1"
	// MaximumArchiveBytes is the maximum accepted compressed or expanded archive size.
	MaximumArchiveBytes = 512 << 20
)

Variables

This section is empty.

Functions

func RenderAuditPDF

func RenderAuditPDF(logs []model.AuditLog, options PDFOptions) ([]byte, error)

RenderAuditPDF renders every selected event into a compact, multi-page A4 report. The standard CJK Type0 font mapping keeps the implementation pure Go and allows Chinese audit values without invoking a browser or external tool.

Types

type ArchiveFile

type ArchiveFile struct {
	Name      string
	MediaType string
	Data      []byte
}

ArchiveFile is one payload in a compliance archive.

type ArchiveManifest

type ArchiveManifest struct {
	SchemaVersion string                `json:"schema_version"`
	Kind          string                `json:"kind"`
	GeneratedAt   time.Time             `json:"generated_at"`
	Files         []ArchiveManifestFile `json:"files"`
}

func BuildArchive

func BuildArchive(generatedAt time.Time, files []ArchiveFile) ([]byte, ArchiveManifest, error)

BuildArchive writes a deterministic-shape ZIP with a manifest covering each payload. The manifest is an integrity inventory, not a signature.

func VerifyArchive

func VerifyArchive(contents []byte) (ArchiveManifest, error)

VerifyArchive validates names, bounds, membership, sizes, and every SHA-256 digest. It does not authenticate the archive producer.

type ArchiveManifestFile

type ArchiveManifestFile struct {
	Name      string `json:"name"`
	MediaType string `json:"media_type"`
	Size      int64  `json:"size"`
	SHA256    string `json:"sha256"`
}

type PDFOptions

type PDFOptions struct {
	GeneratedAt time.Time
	Filters     map[string]string
}

PDFOptions describes the request metadata printed in an audit PDF. Filter values must already be safe to disclose; callers must not pass secrets or a free-form keyword value.

Jump to

Keyboard shortcuts

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