Documentation
¶
Overview ¶
Package acceptance defines recoverable audit ingestion contracts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Fingerprint ¶
Fingerprint returns the digest your adapter can check against a receipt.
Types ¶
type Appender ¶
Appender lets legacy writers share the backend's chain lock and configured hasher with reliable writers. It does not make legacy Record idempotent.
type Receipt ¶
type Receipt struct {
Producer string `json:"producer"`
Installation string `json:"installation"`
SourceKey string `json:"source_key"`
SourceFingerprint string `json:"source_fingerprint"`
Fingerprint string `json:"fingerprint"`
AppID string `json:"app_id"`
OrgID string `json:"org_id"`
TenantID string `json:"tenant_id"`
EventID id.ID `json:"event_id"`
StreamID id.ID `json:"stream_id"`
Sequence uint64 `json:"sequence"`
Hash string `json:"hash"`
HashScheme string `json:"hash_scheme"`
HashKeyID string `json:"hash_key_id"`
}
Receipt survives payload retention and erasure without an automatic expiry. HashScheme and HashKeyID describe the accepted digest, not signed checkpoints or external anchoring. A plain digest provides no protection from a database writer.
type Request ¶
type Request struct {
Producer string `json:"producer"`
Installation string `json:"installation"`
SourceKey string `json:"source_key"`
SourceFingerprint string `json:"source_fingerprint"`
OrgID string `json:"org_id"`
Event *audit.Event `json:"event"`
}
Request binds a trusted source delivery to explicit scope and event content. Your host must authenticate Producer and Installation and authorize scope. SourceFingerprint describes the source envelope, not the audit event digest. Timestamp is required and keeps nanosecond precision. Context never overrides scope.
type Store ¶
type Store interface {
Accept(context.Context, Request, *hash.Chain, func(*audit.Event) error) (*Receipt, error)
}
Store serializes receipt recovery before prepare, then atomically commits the event, stream creation/pin/head, and receipt. prepare seals only a new event. It must never run for a replay or the losing concurrent first request.