将用户信息 array 转换成 Base User
@param array $user
@return \asbamboo\security\user\BaseUser
4506
private function convertUser(array $user) : UserInterface
    {
        $baseUser   = new BaseUser();
        $baseUser->setLoginName($user['login_name']);
        $baseUser->setLoginPassword($user['login_password']);
        $baseUser->setRoles($user['roles']);
        return $baseUser;
    }
235947
protected function create(array $data)
    {
        if (!isset($data['name']) || trim($data['name']) == '') {
            $data['name'] = $data['email'];
        }
        $user = User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            ]);
        return $user;
    }
248637
protected function mapUserToObject(array $user)
    {
        $fields = $this->getDriverConfig('mapFields');
        array_walk($fields, function (&$val, $k, $user) {
            $val = Arr::get($user, $val);
        }, $user);

        return (new User)->setRaw($user)->configurable($fields);
    }
420129
public function removeUser($user)
    {
        $username = ($user instanceof UserInformation) ? $user->getUsername() : (string) $user;

        $this->configSource->set('auth-password/' . $username, null);

        return $this;
    }
46772
public function addUser($user)
    {
        $this->configSource->set('auth-password/' . $user->getUsername(), $user->values());

        return $this;
    }
508460
public function deleteUser($user)
    {
        $params = [
            'name' => $user,
        ];

        $body = $this->request(self::URI_AUTH_USER_DELETE, $params);

        return $body;
    }
1004350
public function get($user)
    {
        if (!is_string($user)) {
            throw new \InvalidArgumentException();
        }

        if (!isset($this->keys[$user])) {
            return new \ArrayIterator();
        }

        return new \ArrayIterator($this->keys[$user]);
    }
1175913
protected function getUserInformation($user = null)
    {
        // Defaults
        if (is_null($user)) {
            return [
                'name' => 'Guest',
                'user' => ['guest' => true],
            ];
        }

        // The default auth identifer is the ID number, which isn't all that
        // useful. Try username and email.
        $identifier = $user->getAuthIdentifier();
        if (is_numeric($identifier)) {
            try {
                if ($user->username) {
                    $identifier = $user->username;
                } elseif ($user->email) {
                    $identifier = $user->email;
                }
            } catch (\Exception $e) {
            }
        }

        return [
            'name' => $identifier,
            'user' => $user instanceof Arrayable ? $user->toArray() : $user,
        ];
    }
1267708
public function create(array $credentials)
	{
		if ( ! isset($credentials['permissions']) )
		{
			$credentials['permissions'] = array();
		}

		$user = $this->createModel();
		$user->values($credentials);
		$user->save();

		return $user;
	}
347110
public function serialize(User $user)
    {
        return [
            self::SERIALIZED_USER_USERNAME_KEY => $this->encrypt($user->getUsername(), $this->surrogateKey),
            self::SERIALIZED_USER_PASSWORD_KEY => $this->encrypt($user->getPassword(), $this->surrogateKey),
            self::SERIALIZED_USER_KEY_KEY => $this->encrypt($this->surrogateKey, $this->key),
        ];
    }
427745
public function getUser($user)
    {
        $params = [
            'name' => $user,
        ];

        $body = $this->request(self::URI_AUTH_USER_GET, $params);
        if ($this->pretty && isset($body['roles'])) {
            return $body['roles'];
        }

        return $body;
    }
221651
protected function mapUserToObject(array $user)
    {
        return (new Passport())->setRaw($user)->map([
            'id' => $user['id'],
            'name' => $user['fullname'],
            'email' => $user['email'],
            'avatar' => $user['avatar']['url'] ?? null,
        ]);
    }
1280463
public function mapUser(array $data)
    {
        $user = new User();
        $user->id = $data['contentobject_id'];
        $user->login = $data['login'];
        $user->email = $data['email'];
        $user->passwordHash = $data['password_hash'];
        $user->hashAlgorithm = (int)$data['password_hash_type'];
        $user->isEnabled = (bool)$data['is_enabled'];
        $user->maxLogin = $data['max_login'];

        return $user;
    }
90812
public function makeUserLoggedIn($user)
    {
        if (!is_array($user) && !is_object($user)) {
            $user = $this->getUser($user);
        } elseif (!($user instanceof UserDataInterface)) {
            $user = new UserData($user);
        }

        if ($user->isNull()) {
            return false;
        }

        return $this->getHandler()->login($user);
    }
172711
public function addUser($user)
    {
        if (!$this->hasUser($user)) {
            return RoleUser::create(['role_id' => $this->id, 'user_id' => $user->id]);
        }

        return false;
    }
760055
public function createUser(array $data) : User
    {
        $data['password'] = Hash::make($data['password']);
        return $this->create($data);
    }
843220
protected function create(array $data)
    {
        $user = User::create([
            'uuid' => (string) Str::uuid(),
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);

        return $user;
    }