Documentation
¶
Overview ¶
Package provider_migration composes authorized account resource movement.
Index ¶
- Constants
- func AuthorizeObject(ctx context.Context, object sobject.SharedObject, peers []string, ...) (*sobject.SOState, error)
- func CheckObject(ctx context.Context, object sobject.SharedObject, peers []string) error
- func CopyWorld(ctx context.Context, le *logrus.Entry, ...) error
- func Merge(ctx context.Context, source Account, mounted session.Session, ...) (func(context.Context) (*session.SessionRef, error), error)
- func NewSRPCAccountMigrationServiceHandler(impl SRPCAccountMigrationServiceServer, serviceID string) srpc.Handler
- func RebindSession(ctx context.Context, mounted session.Session, ref *session.SessionRef) error
- func SRPCRegisterAccountMigrationService(mux srpc.Mux, impl SRPCAccountMigrationServiceServer) error
- type Account
- type AccountTransitionReceipt
- func (m *AccountTransitionReceipt) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *AccountTransitionReceipt) CloneVT() *AccountTransitionReceipt
- func (this *AccountTransitionReceipt) EqualMessageVT(thatMsg any) bool
- func (this *AccountTransitionReceipt) EqualVT(that *AccountTransitionReceipt) bool
- func (x *AccountTransitionReceipt) MarshalJSON() ([]byte, error)
- func (x *AccountTransitionReceipt) MarshalProtoJSON(s *json.MarshalState)
- func (x *AccountTransitionReceipt) MarshalProtoText() string
- func (m *AccountTransitionReceipt) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *AccountTransitionReceipt) MarshalToVT(dAtA []byte) (int, error)
- func (m *AccountTransitionReceipt) MarshalVT() (dAtA []byte, err error)
- func (*AccountTransitionReceipt) ProtoMessage()
- func (x *AccountTransitionReceipt) Reset()
- func (m *AccountTransitionReceipt) SizeVT() (n int)
- func (x *AccountTransitionReceipt) String() string
- func (x *AccountTransitionReceipt) UnmarshalJSON(b []byte) error
- func (x *AccountTransitionReceipt) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *AccountTransitionReceipt) UnmarshalVT(dAtA []byte) error
- type CredentialSource
- type Info
- type MigratedSessionRequest
- func (m *MigratedSessionRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *MigratedSessionRequest) CloneVT() *MigratedSessionRequest
- func (this *MigratedSessionRequest) EqualMessageVT(thatMsg any) bool
- func (this *MigratedSessionRequest) EqualVT(that *MigratedSessionRequest) bool
- func (x *MigratedSessionRequest) GetIdentity() *pairing.Identity
- func (x *MigratedSessionRequest) GetTransition() *provider.AccountTransition
- func (x *MigratedSessionRequest) MarshalJSON() ([]byte, error)
- func (x *MigratedSessionRequest) MarshalProtoJSON(s *json.MarshalState)
- func (x *MigratedSessionRequest) MarshalProtoText() string
- func (m *MigratedSessionRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *MigratedSessionRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *MigratedSessionRequest) MarshalVT() (dAtA []byte, err error)
- func (*MigratedSessionRequest) ProtoMessage()
- func (x *MigratedSessionRequest) Reset()
- func (m *MigratedSessionRequest) SizeVT() (n int)
- func (x *MigratedSessionRequest) String() string
- func (x *MigratedSessionRequest) UnmarshalJSON(b []byte) error
- func (x *MigratedSessionRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *MigratedSessionRequest) UnmarshalVT(dAtA []byte) error
- type MigratedSessionResponse
- func (m *MigratedSessionResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *MigratedSessionResponse) CloneVT() *MigratedSessionResponse
- func (this *MigratedSessionResponse) EqualMessageVT(thatMsg any) bool
- func (this *MigratedSessionResponse) EqualVT(that *MigratedSessionResponse) bool
- func (x *MigratedSessionResponse) GetObjects() []*pairing.SharedObject
- func (x *MigratedSessionResponse) MarshalJSON() ([]byte, error)
- func (x *MigratedSessionResponse) MarshalProtoJSON(s *json.MarshalState)
- func (x *MigratedSessionResponse) MarshalProtoText() string
- func (m *MigratedSessionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *MigratedSessionResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *MigratedSessionResponse) MarshalVT() (dAtA []byte, err error)
- func (*MigratedSessionResponse) ProtoMessage()
- func (x *MigratedSessionResponse) Reset()
- func (m *MigratedSessionResponse) SizeVT() (n int)
- func (x *MigratedSessionResponse) String() string
- func (x *MigratedSessionResponse) UnmarshalJSON(b []byte) error
- func (x *MigratedSessionResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *MigratedSessionResponse) UnmarshalVT(dAtA []byte) error
- type SRPCAccountMigrationServiceClient
- type SRPCAccountMigrationServiceHandler
- func (SRPCAccountMigrationServiceHandler) GetMethodIDs() []string
- func (d *SRPCAccountMigrationServiceHandler) GetServiceID() string
- func (d *SRPCAccountMigrationServiceHandler) InvokeMethod(serviceID, methodID string, strm srpc.Stream) (bool, error)
- func (SRPCAccountMigrationServiceHandler) InvokeMethod_DeliverAccountTransition(impl SRPCAccountMigrationServiceServer, strm srpc.Stream) error
- func (SRPCAccountMigrationServiceHandler) InvokeMethod_EnrollMigratedSession(impl SRPCAccountMigrationServiceServer, strm srpc.Stream) error
- type SRPCAccountMigrationServiceServer
- type SRPCAccountMigrationService_DeliverAccountTransitionStream
- type SRPCAccountMigrationService_EnrollMigratedSessionStream
Constants ¶
const RecoveryProtocol = protocol.ID("alpha/account-migration/1")
RecoveryProtocol carries authenticated returning-Session account recovery.
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 ¶
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 ¶
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 ¶
type Account interface {
provider.ProviderAccount
sobject.SharedObjectProvider
session.SessionProvider
GetProviderID() string
GetAccountID() string
MigrationInfo(context.Context, crypto.PrivKey) (*Info, error)
CheckMigrationSessions(context.Context, *provider.AccountTransition, crypto.PrivKey, crypto.PrivKey) error
AcceptMigrationSessions(context.Context, *provider.AccountTransition, crypto.PrivKey, crypto.PrivKey) error
ImportMigrationObject(context.Context, Account, sobject.SharedObject, *sobject.SharedObjectListEntry, *sobject.SOState) error
CommitAccountTransition(context.Context, *provider.AccountTransition, crypto.PrivKey, crypto.PrivKey) error
AttachMigratedSession(context.Context, session.Session, *provider.AccountTransition) (*session.SessionRef, error)
}
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 (m *AccountTransitionReceipt) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*AccountTransitionReceipt) CloneVT ¶
func (m *AccountTransitionReceipt) CloneVT() *AccountTransitionReceipt
func (*AccountTransitionReceipt) EqualMessageVT ¶
func (this *AccountTransitionReceipt) EqualMessageVT(thatMsg any) bool
func (*AccountTransitionReceipt) EqualVT ¶
func (this *AccountTransitionReceipt) EqualVT(that *AccountTransitionReceipt) bool
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 (m *MigratedSessionRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*MigratedSessionRequest) CloneVT ¶
func (m *MigratedSessionRequest) CloneVT() *MigratedSessionRequest
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 (x *MigratedSessionRequest) GetTransition() *provider.AccountTransition
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 (m *MigratedSessionResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*MigratedSessionResponse) CloneVT ¶
func (m *MigratedSessionResponse) CloneVT() *MigratedSessionResponse
func (*MigratedSessionResponse) EqualMessageVT ¶
func (this *MigratedSessionResponse) EqualMessageVT(thatMsg any) bool
func (*MigratedSessionResponse) EqualVT ¶
func (this *MigratedSessionResponse) EqualVT(that *MigratedSessionResponse) bool
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 (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)
}