Files

20 lines
1.1 KiB
Go

package store
// InitializePendingAccount is reserved for the local machine/DB owner CLI. It
// accepts a stable user ID and expected versions, never an actor string from a
// request. The audit actor is the actual local OS UID. The caller must use the
// protected delivery channel; a failed delivery is retried with the same ID.
func (s *Store) InitializePendingAccount(userID string, expectedStateVersion, expectedGeneration int64) (string, error) {
out, err := s.InitializePendingAccountWithAudit(userID, expectedStateVersion, expectedGeneration, "")
return out.Plain, err
}
// CreateLocalPendingAccount is the local owner-only new-account path. Account
// and first activation grant commit together, including a local administrator
// flag when explicitly requested by the machine/DB owner CLI. That flag is now
// rejected: administrator appointment is reserved to the super administrator.
func (s *Store) CreateLocalPendingAccount(owner, name string, isAdmin bool) (Account, string, error) {
account, out, err := s.CreateLocalPendingAccountWithAudit(owner, name, isAdmin, "")
return account, out.Plain, err
}