Help us shape the future of Go! Take the 2026 Go Developer Survey

provider_migration

package
v0.57.13 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package provider_migration composes authorized account resource movement.

Index

Constants

View Source
const RecoveryProtocol = protocol.ID("alpha/account-migration/1")

RecoveryProtocol carries authenticated returning-Session account recovery.

View Source
const SRPCAccountMigrationServiceServiceID = "provider.migration.AccountMigrationService"

Variables

This section is empty.

Functions

func AuthorizeObject

func AuthorizeObject(ctx context.Context, object sobject.SharedObject, peers []string, entityID string) (*sobject.SOState, error)

AuthorizeObject extends the existing signed lineage without replacing roles, grants, roots, or external participants. Existing peers keep their exact role.

func CheckObject

func CheckObject(ctx context.Context, object sobject.SharedObject, peers []string) error

CheckObject requires the current participant to authorize new account peers. Existing third-party permissions remain part of the verified configuration.

func CopyWorld

func CopyWorld(ctx context.Context, le *logrus.Entry, factories *block_transform.StepFactorySet, object sobject.SharedObject, accepted *sobject.SOState, destination block.StoreOps) error

CopyWorld copies every reachable block of the accepted World root and fences the destination. A cache inventory cannot establish completeness. Existing content-addressed blocks make retries safe after any interrupted write.

func Merge

func Merge(ctx context.Context, source Account, mounted session.Session, destination provider.ProviderAccount, destinationRef *session.SessionRef) (func(context.Context) (*session.SessionRef, error), error)

Merge preserves account identities, resource lineage, and source recovery. Provider commits make retries safe; source attachments change only after the destination resources and returning Session authorization are durable.

func NewSRPCAccountMigrationServiceHandler

func NewSRPCAccountMigrationServiceHandler(impl SRPCAccountMigrationServiceServer, serviceID string) srpc.Handler

NewSRPCAccountMigrationServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: provider.migration.AccountMigrationService

func RebindSession

func RebindSession(ctx context.Context, mounted session.Session, ref *session.SessionRef) error

RebindSession publishes an already durable provider attachment at its old UI index.

func SRPCRegisterAccountMigrationService

func SRPCRegisterAccountMigrationService(mux srpc.Mux, impl SRPCAccountMigrationServiceServer) error

SRPCRegisterAccountMigrationService registers the implementation with the mux. Uses the default serviceID: provider.migration.AccountMigrationService

Types

type Account

Account owns migration storage, Session authority, and returning-client enrollment. Mutating methods are called only after the pairing engine's bilateral approval.

type AccountTransitionReceipt

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

AccountTransitionReceipt acknowledges a verified source-account redirect.

func (*AccountTransitionReceipt) CloneMessageVT

func (*AccountTransitionReceipt) CloneVT

func (*AccountTransitionReceipt) EqualMessageVT

func (this *AccountTransitionReceipt) EqualMessageVT(thatMsg any) bool

func (*AccountTransitionReceipt) EqualVT

func (*AccountTransitionReceipt) MarshalJSON

func (x *AccountTransitionReceipt) MarshalJSON() ([]byte, error)

MarshalJSON marshals the AccountTransitionReceipt to JSON.

func (*AccountTransitionReceipt) MarshalProtoJSON

func (x *AccountTransitionReceipt) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the AccountTransitionReceipt message to JSON.

func (*AccountTransitionReceipt) MarshalProtoText

func (x *AccountTransitionReceipt) MarshalProtoText() string

func (*AccountTransitionReceipt) MarshalToSizedBufferVT

func (m *AccountTransitionReceipt) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*AccountTransitionReceipt) MarshalToVT

func (m *AccountTransitionReceipt) MarshalToVT(dAtA []byte) (int, error)

func (*AccountTransitionReceipt) MarshalVT

func (m *AccountTransitionReceipt) MarshalVT() (dAtA []byte, err error)

func (*AccountTransitionReceipt) ProtoMessage

func (*AccountTransitionReceipt) ProtoMessage()

func (*AccountTransitionReceipt) Reset

func (x *AccountTransitionReceipt) Reset()

func (*AccountTransitionReceipt) SizeVT

func (m *AccountTransitionReceipt) SizeVT() (n int)

func (*AccountTransitionReceipt) String

func (x *AccountTransitionReceipt) String() string

func (*AccountTransitionReceipt) UnmarshalJSON

func (x *AccountTransitionReceipt) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the AccountTransitionReceipt from JSON.

func (*AccountTransitionReceipt) UnmarshalProtoJSON

func (x *AccountTransitionReceipt) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the AccountTransitionReceipt message from JSON.

func (*AccountTransitionReceipt) UnmarshalVT

func (m *AccountTransitionReceipt) UnmarshalVT(dAtA []byte) error

type CredentialSource

type CredentialSource interface {
	SessionCredentialStore() object.ObjectStore
	// RetireAccountTransport releases this credential's old account connection.
	// It is called after the pairing receipt and before the destination starts it.
	RetireAccountTransport(context.Context) error
}

CredentialSource exposes only the mounted Session's own credential store. Its retained Session handle owns the store lifetime through migration.

type Info

type Info struct {
	Settings          *sobject.SharedObjectRef
	Endpoint          string
	ParticipantEntity string
	SessionPeers      []string
	// PendingSessionPeers still need to attach after an earlier local migration.
	PendingSessionPeers []string
	ParticipantPeers    []string
	Transition          *provider.AccountTransition
}

Info identifies the provider's current account authority before migration.

type MigratedSessionRequest

type MigratedSessionRequest struct {

	// Transition must match the destination's durable authorization.
	Transition *provider.AccountTransition `protobuf:"bytes,1,opt,name=transition,proto3" json:"transition,omitempty"`
	// Identity proves possession of the caller's Session and local storage keys.
	Identity *pairing.Identity `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	// contains filtered or unexported fields
}

MigratedSessionRequest proves independent Session and destination storage keys.

func (*MigratedSessionRequest) CloneMessageVT

func (*MigratedSessionRequest) CloneVT

func (*MigratedSessionRequest) EqualMessageVT

func (this *MigratedSessionRequest) EqualMessageVT(thatMsg any) bool

func (*MigratedSessionRequest) EqualVT

func (this *MigratedSessionRequest) EqualVT(that *MigratedSessionRequest) bool

func (*MigratedSessionRequest) GetIdentity

func (x *MigratedSessionRequest) GetIdentity() *pairing.Identity

func (*MigratedSessionRequest) GetTransition

func (*MigratedSessionRequest) MarshalJSON

func (x *MigratedSessionRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the MigratedSessionRequest to JSON.

func (*MigratedSessionRequest) MarshalProtoJSON

func (x *MigratedSessionRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the MigratedSessionRequest message to JSON.

func (*MigratedSessionRequest) MarshalProtoText

func (x *MigratedSessionRequest) MarshalProtoText() string

func (*MigratedSessionRequest) MarshalToSizedBufferVT

func (m *MigratedSessionRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*MigratedSessionRequest) MarshalToVT

func (m *MigratedSessionRequest) MarshalToVT(dAtA []byte) (int, error)

func (*MigratedSessionRequest) MarshalVT

func (m *MigratedSessionRequest) MarshalVT() (dAtA []byte, err error)

func (*MigratedSessionRequest) ProtoMessage

func (*MigratedSessionRequest) ProtoMessage()

func (*MigratedSessionRequest) Reset

func (x *MigratedSessionRequest) Reset()

func (*MigratedSessionRequest) SizeVT

func (m *MigratedSessionRequest) SizeVT() (n int)

func (*MigratedSessionRequest) String

func (x *MigratedSessionRequest) String() string

func (*MigratedSessionRequest) UnmarshalJSON

func (x *MigratedSessionRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the MigratedSessionRequest from JSON.

func (*MigratedSessionRequest) UnmarshalProtoJSON

func (x *MigratedSessionRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the MigratedSessionRequest message from JSON.

func (*MigratedSessionRequest) UnmarshalVT

func (m *MigratedSessionRequest) UnmarshalVT(dAtA []byte) error

type MigratedSessionResponse

type MigratedSessionResponse struct {

	// Objects includes canonical settings and every current account object.
	Objects []*pairing.SharedObject `protobuf:"bytes,1,rep,name=objects,proto3" json:"objects,omitempty"`
	// contains filtered or unexported fields
}

MigratedSessionResponse carries verified checkpoints for the enrolled keys.

func (*MigratedSessionResponse) CloneMessageVT

func (*MigratedSessionResponse) CloneVT

func (*MigratedSessionResponse) EqualMessageVT

func (this *MigratedSessionResponse) EqualMessageVT(thatMsg any) bool

func (*MigratedSessionResponse) EqualVT

func (*MigratedSessionResponse) GetObjects

func (x *MigratedSessionResponse) GetObjects() []*pairing.SharedObject

func (*MigratedSessionResponse) MarshalJSON

func (x *MigratedSessionResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the MigratedSessionResponse to JSON.

func (*MigratedSessionResponse) MarshalProtoJSON

func (x *MigratedSessionResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the MigratedSessionResponse message to JSON.

func (*MigratedSessionResponse) MarshalProtoText

func (x *MigratedSessionResponse) MarshalProtoText() string

func (*MigratedSessionResponse) MarshalToSizedBufferVT

func (m *MigratedSessionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*MigratedSessionResponse) MarshalToVT

func (m *MigratedSessionResponse) MarshalToVT(dAtA []byte) (int, error)

func (*MigratedSessionResponse) MarshalVT

func (m *MigratedSessionResponse) MarshalVT() (dAtA []byte, err error)

func (*MigratedSessionResponse) ProtoMessage

func (*MigratedSessionResponse) ProtoMessage()

func (*MigratedSessionResponse) Reset

func (x *MigratedSessionResponse) Reset()

func (*MigratedSessionResponse) SizeVT

func (m *MigratedSessionResponse) SizeVT() (n int)

func (*MigratedSessionResponse) String

func (x *MigratedSessionResponse) String() string

func (*MigratedSessionResponse) UnmarshalJSON

func (x *MigratedSessionResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the MigratedSessionResponse from JSON.

func (*MigratedSessionResponse) UnmarshalProtoJSON

func (x *MigratedSessionResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the MigratedSessionResponse message from JSON.

func (*MigratedSessionResponse) UnmarshalVT

func (m *MigratedSessionResponse) UnmarshalVT(dAtA []byte) error

type SRPCAccountMigrationServiceClient

type SRPCAccountMigrationServiceClient interface {
	// SRPCClient returns the underlying SRPC client.
	SRPCClient() srpc.Client

	// EnrollMigratedSession binds independent destination storage for an approved Session.
	EnrollMigratedSession(ctx context.Context, in *MigratedSessionRequest) (*MigratedSessionResponse, error)
	// DeliverAccountTransition proves a redirect from the recipient's held configuration.
	DeliverAccountTransition(ctx context.Context, in *pairing.SharedObject) (*AccountTransitionReceipt, error)
}

func NewSRPCAccountMigrationServiceClient

func NewSRPCAccountMigrationServiceClient(cc srpc.Client) SRPCAccountMigrationServiceClient

func NewSRPCAccountMigrationServiceClientWithServiceID

func NewSRPCAccountMigrationServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCAccountMigrationServiceClient

type SRPCAccountMigrationServiceHandler

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

func (SRPCAccountMigrationServiceHandler) GetMethodIDs

func (SRPCAccountMigrationServiceHandler) GetMethodIDs() []string

func (*SRPCAccountMigrationServiceHandler) GetServiceID

func (d *SRPCAccountMigrationServiceHandler) GetServiceID() string

func (*SRPCAccountMigrationServiceHandler) InvokeMethod

func (d *SRPCAccountMigrationServiceHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCAccountMigrationServiceHandler) InvokeMethod_DeliverAccountTransition

func (SRPCAccountMigrationServiceHandler) InvokeMethod_DeliverAccountTransition(impl SRPCAccountMigrationServiceServer, strm srpc.Stream) error

func (SRPCAccountMigrationServiceHandler) InvokeMethod_EnrollMigratedSession

func (SRPCAccountMigrationServiceHandler) InvokeMethod_EnrollMigratedSession(impl SRPCAccountMigrationServiceServer, strm srpc.Stream) error

type SRPCAccountMigrationServiceServer

type SRPCAccountMigrationServiceServer interface {
	// EnrollMigratedSession binds independent destination storage for an approved Session.
	EnrollMigratedSession(context.Context, *MigratedSessionRequest) (*MigratedSessionResponse, error)
	// DeliverAccountTransition proves a redirect from the recipient's held configuration.
	DeliverAccountTransition(context.Context, *pairing.SharedObject) (*AccountTransitionReceipt, error)
}

type SRPCAccountMigrationService_DeliverAccountTransitionStream

type SRPCAccountMigrationService_DeliverAccountTransitionStream interface {
	srpc.Stream
}

type SRPCAccountMigrationService_EnrollMigratedSessionStream

type SRPCAccountMigrationService_EnrollMigratedSessionStream interface {
	srpc.Stream
}

Jump to

Keyboard shortcuts

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