// Import LDAP users
966369
func (c *Client) ImportLdapUsers(p *ImportLdapUsersParameter) (*LdapUser, error) {
	obj, err := c.Request("importLdapUsers", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*LdapUser), err
}
433158
func (r *RoleBindingBuilder) Users(users ...string) *RoleBindingBuilder {
	for _, user := range users {
		r.RoleBinding.Subjects = append(r.RoleBinding.Subjects, Subject{Kind: UserKind, APIGroup: GroupName, Name: user})
	}
	return r
}
586395
func (sys *NotificationSys) LoadUsers() []NotificationPeerErr {
	ng := WithNPeers(len(sys.peerClients))
	for idx, client := range sys.peerClients {
		if client == nil {
			continue
		}
		client := client
		ng.Go(context.Background(), client.LoadUsers, idx, *client.host)
	}
	return ng.Wait()
}
270378
func (_class VMClass) Import(sessionID SessionRef, url string, sr SRRef, fullRestore bool, force bool) (_retval []VMRef, _err error) {
	_method := "VM.import"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_urlArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "url"), url)
	if _err != nil {
		return
	}
	_srArg, _err := convertSRRefToXen(fmt.Sprintf("%s(%s)", _method, "sr"), sr)
	if _err != nil {
		return
	}
	_fullRestoreArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "full_restore"), fullRestore)
	if _err != nil {
		return
	}
	_forceArg, _err := convertBoolToXen(fmt.Sprintf("%s(%s)", _method, "force"), force)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _urlArg, _srArg, _fullRestoreArg, _forceArg)
	if _err != nil {
		return
	}
	_retval, _err = convertVMRefSetToGo(_method + " -> ", _result.Value)
	return
}
844231
func (s *FileStorage) LoadUser(email string) (*UserData, error) {
	var err error
	userData := new(UserData)
	userData.Reg, err = s.readFile(s.userRegFile(email))
	if err != nil {
		return nil, err
	}
	userData.Key, err = s.readFile(s.userKeyFile(email))
	if err != nil {
		return nil, err
	}
	return userData, nil
}
595389
func (v *VoiceTarget) AddUser(user *User) {
	v.users = append(v.users, user)
}
455402
func (gm serverMethod) Imports() []string {
	ip := map[string]struct{}{
		`"net/http"`: struct{}{},
	}
	if gm.firstSuccessRespBodyType() != "" || gm.reqBody != "" {
		ip[`"encoding/json"`] = struct{}{}
	}
	if gm.needImportGoramlTypes() {
		ip[`"`+globRootImportPath+"/types"+`"`] = struct{}{}
	}
	for lib := range gm.libImported(globRootImportPath) {
		ip[lib] = struct{}{}
	}
	return commons.MapToSortedStrings(ip)
}
794520
func (b LeveldbAuthBackend) Users() (us []UserData, e error) {
	for _, user := range b.users {
		us = append(us, user)
	}
	return
}
62524
func (conn *Connection) AddUser(username string, password string,
	roles []string, auth Auth) (string, error) {

	userData := UserRecord{
		Name:     username,
		Password: password,
		Roles:    roles,
		TheType:  "user"}
	userDb := conn.SelectDB("_users", auth)
	namestring := "org.couchdb.user:" + userData.Name
	return userDb.Save(&userData, namestring, "")

}
1114405
func (e *SaltpackRecipientKeyfinderEngine) identifyAndAddUserRecipient(m libkb.MetaContext, u string) (err error) {
	upk, err := e.IdentifyUser(m, u) // For existing users
	switch {
	case err == nil:
		// nothing to do here
	case libkb.IsIdentifyProofError(err):
		return fmt.Errorf("Cannot encrypt for %v as their account has changed since you last followed them (it might have been compromised!): please review their identity (with `keybase follow %v`) and then try again (err = %v)", u, u, err)
	case libkb.IsNotFoundError(err) || libkb.IsResolutionNotFoundError(err):
		// recipient is not a keybase user

		expr, err := externals.AssertionParse(m.G(), u)
		if err != nil {
			m.Debug("error parsing assertion: %s", err)
			return libkb.NewRecipientNotFoundError(fmt.Sprintf("Cannot encrypt for %v: it is not a keybase user or social assertion (err = %v)", u, err))
		}
		if _, err := expr.ToSocialAssertion(); err != nil {
			m.Debug("not a social assertion: %s (%s), err: %+v", u, expr, err)
			return libkb.NewRecipientNotFoundError(fmt.Sprintf("Cannot encrypt for %v: it is not a keybase user or social assertion (err = %v)", u, err))
		}

		if !m.ActiveDevice().Valid() {
			return libkb.NewRecipientNotFoundError(fmt.Sprintf("Cannot encrypt for %v: it is not a registered user (cannot encrypt for users not yet on keybase unless you are logged in)", u))
		}
		if !e.Arg.UseEntityKeys {
			return libkb.NewRecipientNotFoundError(fmt.Sprintf("Cannot encrypt for %v: it is not a registered user (you can remove `--no-entity-keys` for users not yet on keybase)", u))
		}
		if e.Arg.NoSelfEncrypt {
			return libkb.NewRecipientNotFoundError(fmt.Sprintf("Cannot encrypt for %v: it is not a registered user (you can remove `--no-self-encrypt` for users not yet on keybase)", u))
		}

		m.Debug("%q is not an existing user, trying to create an implicit team", u)
		err = e.lookupAndAddImplicitTeamKeys(m, u)
		return err
	case libkb.IsNoKeyError(err):
		// User exists but has no keys. Just try adding implicit team keys.
		return e.lookupAndAddImplicitTeamKeys(m, u)
	default:
		return fmt.Errorf("Error while adding keys for %v: %v", u, err)
	}

	err = e.AddDeviceAndPaperKeys(m, upk)
	err2 := e.addPUKOrImplicitTeamKeys(m, upk)
	// If we managed to add at least one key for upk, we are happy.
	if (!(e.Arg.UseDeviceKeys || e.Arg.UsePaperKeys) || err != nil) && (!e.Arg.UseEntityKeys || err2 != nil) {
		return libkb.PickFirstError(err, err2)
	}
	return nil
}
481389
func newLoginLoadUser(g *libkb.GlobalContext, username string) *loginLoadUser {
	return &loginLoadUser{
		Contextified: libkb.NewContextified(g),
		username:     strings.TrimSpace(username),
	}
}
1062764
func (s *PrivateAccountAPI) ImportRawKey(privkey string, password string) (common.Address, error) {
	key, err := crypto.HexToECDSA(privkey)
	if err != nil {
		return common.Address{}, err
	}
	acc, err := fetchKeystore(s.am).ImportECDSA(key, password)
	return acc.Address, err
}
1313870
func (c *UserStore) Add(ctx context.Context, u *chronograf.User) (*chronograf.User, error) {
	if err := c.Ctrl.CreateUser(ctx, u.Name, u.Passwd); err != nil {
		return nil, err
	}
	perms := ToEnterprise(u.Permissions)

	if err := c.Ctrl.SetUserPerms(ctx, u.Name, perms); err != nil {
		return nil, err
	}
	for _, role := range u.Roles {
		if err := c.Ctrl.AddRoleUsers(ctx, role.Name, []string{u.Name}); err != nil {
			return nil, err
		}
	}

	return c.Get(ctx, chronograf.UserQuery{Name: &u.Name})
}
1075798
func (e *PGPKeyfinder) loadUsers(m libkb.MetaContext) {
	if e.runerr != nil {
		return
	}

	for _, u := range e.arg.Usernames {
		arg := libkb.NewLoadUserByNameArg(e.G(), u)
		user, err := libkb.LoadUser(arg)
		if err != nil {
			e.runerr = err
			return
		}
		e.addUser(user, false)
	}

}
894835
func (c *UsergroupsListCall) IncludeUsers(includeUsers bool) *UsergroupsListCall {
	c.includeUsers = includeUsers
	return c
}
406141
func Convert_v1_LDAPSyncConfig_To_config_LDAPSyncConfig(in *v1.LDAPSyncConfig, out *config.LDAPSyncConfig, s conversion.Scope) error {
	return autoConvert_v1_LDAPSyncConfig_To_config_LDAPSyncConfig(in, out, s)
}
300670
func (u *CachedUPAKLoader) LookupUsername(ctx context.Context, uid keybase1.UID) (NormalizedUsername, error) {
	var empty NormalizedUsername
	uids := []keybase1.UID{uid}
	namePkgs, err := u.G().UIDMapper.MapUIDsToUsernamePackages(ctx, u.G(), uids, 0, 0, false)
	if err != nil {
		return empty, err
	}
	if len(namePkgs) == 0 {
		return empty, UserNotFoundError{UID: uid, Msg: "in CachedUPAKLoader"}
	}

	if u.TestDeadlocker != nil {
		u.TestDeadlocker()
	}

	return namePkgs[0].NormalizedUsername, nil
}