admincontract

package
v0.3.3 Latest Latest
Warning

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

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

Documentation

Overview

Package admincontract owns the versioned provider-neutral datasource administration commitment grammar shared with external lifecycle writers.

The package contains no provider, command, transport, or service dependency. Concrete LDAP and SQL mutations remain owned by dkim2d internal packages.

Index

Constants

View Source
const (
	// ContractVersion is the exact cross-repository compatibility version.
	ContractVersion = "dkim2-admin-contract-v1"
)

Variables

This section is empty.

Functions

func ValidCommand

func ValidCommand(command Command) bool

ValidCommand reports whether a campaign command belongs to this contract version.

func ValidState

func ValidState(state State) bool

ValidState reports whether a public campaign state belongs to this contract version.

Types

type AuditReceipt

type AuditReceipt struct {
	Version         string
	Generation      uint64
	Schema          string
	Lifecycle       string
	OperationClass  string
	ContentDigest   Digest
	DestroyedAt     time.Time
	Result          string
	PolicyVersion   string
	PurgePlanDigest Digest
}

AuditReceipt is compact key-free destruction evidence.

type CampaignPlan

type CampaignPlan struct {
	Version                string
	Mode                   Mode
	SourceSchema           string
	SourceGeneration       uint64
	CandidateGeneration    uint64
	OperationID            string
	Work                   []WorkItem
	EmergencyReason        string
	RotationPolicyVersion  string
	DNSPolicyVersion       string
	RetentionPolicyVersion string
	LimitProfileVersion    string
}

CampaignPlan is the exact key-free normal or emergency plan projection.

type Command

type Command string

Command identifies one closed campaign control action.

const (
	CommandPlan       Command = "plan"
	CommandPrepare    Command = "prepare"
	CommandStage      Command = "stage"
	CommandDNSExport  Command = "dns_export"
	CommandDNSProve   Command = "dns_prove"
	CommandActivate   Command = "activate"
	CommandStatus     Command = "status"
	CommandReconcile  Command = "reconcile"
	CommandAbort      Command = "abort"
	CommandPurgePlan  Command = "purge_plan"
	CommandPurgeApply Command = "purge_apply"
)

Command values identify the closed campaign control vocabulary.

type DNSBatch

type DNSBatch struct {
	CandidateDigest  Digest
	FrozenWorkDigest Digest
	Ordinal          uint32
	Start            uint32
	End              uint32
	Total            uint32
}

DNSBatch binds one deterministic contiguous work range to immutable candidate content.

type Digest

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

Digest contains one exact nonzero SHA-256 commitment.

func AuditCommitment

func AuditCommitment(receipt AuditReceipt) (Digest, error)

AuditCommitment validates and commits one compact key-free purge receipt.

func CampaignPlanDigest

func CampaignPlanDigest(plan CampaignPlan) (Digest, error)

CampaignPlanDigest validates and commits to one complete frozen campaign plan.

func DNSBatchDigest

func DNSBatchDigest(batch DNSBatch) (Digest, error)

DNSBatchDigest validates and commits one deterministic contiguous DNS batch.

func FrozenWorkDigest

func FrozenWorkDigest(work []WorkItem) (Digest, error)

FrozenWorkDigest validates and commits to an already canonical work inventory.

func ParseDigest

func ParseDigest(value []byte) (Digest, error)

ParseDigest validates and detaches one exact SHA-256 commitment.

func ParseDigestHex

func ParseDigestHex(value string) (Digest, error)

ParseDigestHex validates one canonical lowercase hexadecimal commitment.

func PurgePlanDigest

func PurgePlanDigest(plan PurgePlan) (Digest, error)

PurgePlanDigest validates and commits one exact ordered noncurrent target set.

func (Digest) Bytes

func (d Digest) Bytes() []byte

Bytes returns a detached binary commitment for protected persistence.

func (Digest) Equal

func (d Digest) Equal(other Digest) bool

Equal compares two initialized commitments without early exit.

func (Digest) Hex

func (d Digest) Hex() string

Hex returns canonical hexadecimal for public synthetic conformance fixtures.

func (Digest) Valid

func (d Digest) Valid() bool

Valid reports whether the digest is initialized.

type Mode

type Mode string

Mode identifies a closed rotation operation class.

const (
	// ModeNormal rotates the complete frozen active binding inventory once.
	ModeNormal Mode = "normal"
	// ModeEmergency rotates one exact binding for an explicit emergency reason.
	ModeEmergency Mode = "emergency"
)

State values describe the closed externally visible campaign progression.

type PurgePlan

type PurgePlan struct {
	Version           string
	CurrentGeneration uint64
	InventoryVersion  string
	PolicyVersion     string
	Targets           []PurgeTarget
}

PurgePlan is one read-only exact ordered destructive work projection.

type PurgeTarget

type PurgeTarget struct {
	Generation    uint64
	Schema        string
	Lifecycle     string
	ContentDigest Digest
}

PurgeTarget is one exact noncurrent generation selected by retention policy.

type State

type State string

State identifies one closed public campaign state.

const (
	StatePlanned           State = "planned"
	StatePreparing         State = "preparing"
	StatePrepared          State = "prepared"
	StateStaged            State = "staged"
	StateDNSInProgress     State = "dns_in_progress"
	StateDNSComplete       State = "dns_complete"
	StateActivating        State = "activating"
	StateActivated         State = "activated"
	StateConflict          State = "conflict"
	StateFailed            State = "failed"
	StateAborted           State = "aborted"
	StateReconcileRequired State = "reconcile_required"
)

State values describe the closed externally visible campaign progression.

type WorkItem

type WorkItem struct {
	Tenant     string
	Domain     string
	Use        string
	Profile    string
	Algorithms []string
}

WorkItem is one canonical active tenant, domain, use, and profile binding.

Jump to

Keyboard shortcuts

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