Documentation
¶
Overview ¶
Package ownerscope provides the fail-closed migration boundary for durable plugin state created before owner-scoped generations were mandatory.
Index ¶
- Constants
- Variables
- type CleanupState
- type LegacyContainmentEvidence
- type LegacyContainmentRequest
- type LegacyContainmentVerifier
- type MigrationState
- type OwnerScopeGeneration
- type OwnerScopeMigration
- func (migration *OwnerScopeMigration) ActiveGenerationPath(rootPath string) (string, error)
- func (migration *OwnerScopeMigration) Close() error
- func (migration *OwnerScopeMigration) CommitFreshGeneration(ctx context.Context) (Status, error)
- func (migration *OwnerScopeMigration) DeleteQuarantine(ctx context.Context) (Status, error)
- func (migration *OwnerScopeMigration) QuarantineUnownedLegacy(ctx context.Context) (Status, error)
- func (migration *OwnerScopeMigration) Status() Status
- type OwnerScopeMigrationOptions
- type QuarantineID
- type Status
- type StoreDisposition
- type StoreStatus
Constants ¶
const ( RedevenLegacyInventoryV1 = "redeven-redevplugin-v0.1.0-v0.1.5-layout-v1" BuiltInInventoryRegistrySHA256 = "92a2d6ed3a9038e95285faa108e2186cf9d0df343854741c551f8c4039f91217" )
const ( MigrationJournalName = ".redevplugin-owner-scope-migration-v1.json" CleanupJournalName = ".redevplugin-quarantine-cleanup-v1.json" )
Variables ¶
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 OwnerScopeGeneration ¶ added in v0.6.6
OwnerScopeGeneration is the committed durable state generation prepared for host initialization. Path is the only directory where the host should create ReDevPlugin-owned durable state.
func PrepareOwnerScopeGeneration ¶ added in v0.6.6
func PrepareOwnerScopeGeneration(ctx context.Context, rootPath string) (generation OwnerScopeGeneration, err error)
PrepareOwnerScopeGeneration opens or resumes the owner-scope migration at rootPath and returns its committed active generation. Recognized unowned legacy state is quarantined and retained; this function never deletes it. Unknown, corrupt, failed, or reconcile-required state remains fail closed.
type OwnerScopeMigration ¶
type OwnerScopeMigration struct {
// contains filtered or unexported fields
}
func OpenOwnerScopeMigration ¶
func OpenOwnerScopeMigration(rootDir *os.File, options OwnerScopeMigrationOptions) (*OwnerScopeMigration, error)
func (*OwnerScopeMigration) ActiveGenerationPath ¶ added in v0.6.6
func (migration *OwnerScopeMigration) ActiveGenerationPath(rootPath string) (string, error)
ActiveGenerationPath returns the durable state root for the committed owner-scoped generation. The supplied path must still identify the exact migration root that was opened, so callers cannot redirect state through a replacement directory between migration and host initialization.
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
}