0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-02-23 00:19:14 +00:00
nextcloud_server/lib/public/User/Backend/IPasswordHashBackend.php
Christopher Ng d65f53184e docs: Add info for the password hashes
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2024-07-08 16:30:52 -07:00

30 lines
726 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\User\Backend;
use InvalidArgumentException;
/**
* @since 30.0.0
*/
interface IPasswordHashBackend {
/**
* @return ?string the password hash hashed by `\OCP\Security\IHasher::hash()`
* @since 30.0.0
*/
public function getPasswordHash(string $userId): ?string;
/**
* @param string $passwordHash the password hash hashed by `\OCP\Security\IHasher::hash()`
* @throws InvalidArgumentException when `$passwordHash` is not a valid hash
* @since 30.0.0
*/
public function setPasswordHash(string $userId, string $passwordHash): bool;
}