Documentation
¶
Overview ¶
Package identityimport copies Control's legacy identity data (v2_user identity columns and v2_user_mfa) into the identity module with IdentityService.ImportAccounts. The kernel drives it: batches are checkpointed in v4_kernel_identity_authority so an interrupted import resumes, and a delta import re-sends what changed since the previous one: users or their MFA row updated since, and deletions (linked users whose v2_user row is gone), which every import finishes with. Identity never reads v2_user.password itself. Invite codes stay with Control: registration consumes them through KernelIdentity.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrRunning = errors.New("an identity import is already running") ErrNotImportable = errors.New("identity is authoritative: importing would overwrite its accounts") ErrNoFullImport = errors.New("a delta import needs a completed full import") ErrNotInitialized = errors.New("the identity importer is not configured") )
Errors of Run.
Functions ¶
func AccountUUID ¶
AccountUUID is the account UUID of a legacy user without a link yet.
func SetDefault ¶
SetDefault installs the server's runner and database for the admin API.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
ImportID string `json:"import_id"`
Delta bool `json:"delta"`
// UserCursor is the last user id sent.
UserCursor uint `json:"user_cursor"`
UsersDone bool `json:"users_done"`
// DeletionsDone is set once identity deleted every account whose
// subscriber is gone.
DeletionsDone bool `json:"deletions_done"`
// Since is the lower bound of a delta import: the start of the
// previous completed import.
Since int64 `json:"since"`
StartedAt int64 `json:"started_at"`
CompletedAt int64 `json:"completed_at"`
Accounts uint64 `json:"accounts"`
Deleted uint64 `json:"deleted"`
LastError string `json:"last_error,omitempty"`
}
Checkpoint is the import progress stored in the authority row.
type Importer ¶
type Importer struct {
DB *gorm.DB
Connect func() (grpc.ClientConnInterface, error)
// BatchSize defaults to 500.
BatchSize int
// Now defaults to time.Now.
Now func() time.Time
// contains filtered or unexported fields
}
Importer runs imports, one at a time.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner runs imports in the background for the server's lifetime.