ownerscope

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package ownerscope provides the fail-closed migration boundary for durable plugin state created before owner-scoped generations were mandatory.

Index

Constants

View Source
const (
	RedevenLegacyInventoryV1       = "redeven-redevplugin-v0.1.0-v0.1.5-layout-v1"
	BuiltInInventoryRegistrySHA256 = "92a2d6ed3a9038e95285faa108e2186cf9d0df343854741c551f8c4039f91217"
)
View Source
const (
	MigrationJournalName = ".redevplugin-owner-scope-migration-v1.json"
	CleanupJournalName   = ".redevplugin-quarantine-cleanup-v1.json"
)

Variables

View Source
var (
	ErrOwnerScopeMigrationRequired  = errors.New("owner scope migration is required")
	ErrOwnerScopeInventoryAmbiguous = errors.New("owner scope inventory is ambiguous")
	ErrOwnerScopeInventoryCorrupt   = errors.New("owner scope legacy inventory is corrupt")
	ErrOwnerScopeJournalCorrupt     = errors.New("owner scope migration journal is corrupt")
	ErrOwnerScopeSnapshotChanged    = errors.New("owner scope migration snapshot changed")
	ErrOwnerScopeTransition         = errors.New("owner scope migration transition is invalid")
	ErrLegacyContainmentRequired    = errors.New("legacy containment evidence is required")
	ErrInvalidQuarantineID          = errors.New("quarantine id is invalid")
	ErrOwnerScopeUnsupported        = errors.New("owner scope migration is unsupported on this platform")
)

Functions

This section is empty.

Types

type CleanupState

type CleanupState string
const (
	CleanupStateNone              CleanupState = ""
	CleanupStateDeletePrepared    CleanupState = "delete_prepared"
	CleanupStateDeleting          CleanupState = "deleting"
	CleanupStateReconcileRequired CleanupState = "delete_reconcile_required"
	CleanupStateDeleted           CleanupState = "deleted"
)

type LegacyContainmentEvidence

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

func NewLegacyContainmentEvidence

func NewLegacyContainmentEvidence(request LegacyContainmentRequest) LegacyContainmentEvidence

type LegacyContainmentRequest

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

func (LegacyContainmentRequest) MigrationID

func (request LegacyContainmentRequest) MigrationID() string

func (LegacyContainmentRequest) QuarantineID

func (request LegacyContainmentRequest) QuarantineID() QuarantineID

func (LegacyContainmentRequest) QuarantineSHA256

func (request LegacyContainmentRequest) QuarantineSHA256() string

func (LegacyContainmentRequest) RootIdentitySHA256

func (request LegacyContainmentRequest) RootIdentitySHA256() string

type LegacyContainmentVerifier

type LegacyContainmentVerifier interface {
	VerifyLegacyContainment(context.Context, LegacyContainmentRequest) (LegacyContainmentEvidence, error)
}

type MigrationState

type MigrationState string
const (
	StatePrepared            MigrationState = "prepared"
	StateQuarantineWriting   MigrationState = "quarantine_writing"
	StateQuarantineCommitted MigrationState = "quarantine_committed"
	StateFreshPrepared       MigrationState = "fresh_prepared"
	StateFreshCommitted      MigrationState = "fresh_committed"
	StateReconcileRequired   MigrationState = "reconcile_required"
	StateFailed              MigrationState = "failed"
)

type OwnerScopeMigration

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

func OpenOwnerScopeMigration

func OpenOwnerScopeMigration(rootDir *os.File, options OwnerScopeMigrationOptions) (*OwnerScopeMigration, error)

func (*OwnerScopeMigration) Close

func (migration *OwnerScopeMigration) Close() error

func (*OwnerScopeMigration) CommitFreshGeneration

func (migration *OwnerScopeMigration) CommitFreshGeneration(ctx context.Context) (Status, error)

func (*OwnerScopeMigration) DeleteQuarantine

func (migration *OwnerScopeMigration) DeleteQuarantine(ctx context.Context) (Status, error)

func (*OwnerScopeMigration) QuarantineUnownedLegacy

func (migration *OwnerScopeMigration) QuarantineUnownedLegacy(ctx context.Context) (Status, error)

func (*OwnerScopeMigration) Status

func (migration *OwnerScopeMigration) Status() Status

type OwnerScopeMigrationOptions

type OwnerScopeMigrationOptions struct {
	Containment LegacyContainmentVerifier
}

type QuarantineID

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

func ParseQuarantineID

func ParseQuarantineID(value string) (QuarantineID, error)

func (QuarantineID) IsZero

func (id QuarantineID) IsZero() bool

func (QuarantineID) String

func (id QuarantineID) String() string

type Status

type Status struct {
	MigrationID           string
	RootIdentitySHA256    string
	LegacySnapshotSHA256  string
	InventoryID           string
	InventorySHA256       string
	State                 MigrationState
	QuarantineID          QuarantineID
	QuarantineSHA256      string
	FreshGenerationID     string
	FreshGenerationSHA256 string
	CleanupState          CleanupState
	Stores                []StoreStatus
}

type StoreDisposition

type StoreDisposition string
const (
	StoreDispositionQuarantine StoreDisposition = "quarantine"
	StoreDispositionTerminate  StoreDisposition = "terminate"
)

type StoreStatus

type StoreStatus struct {
	ID          string
	Scope       string
	Disposition StoreDisposition
	Generation  string
	Outcome     string
}

Jump to

Keyboard shortcuts

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