diff options
Diffstat (limited to 'lib/public/User/Backend/IPasswordHashBackend.php')
-rw-r--r-- | lib/public/User/Backend/IPasswordHashBackend.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/public/User/Backend/IPasswordHashBackend.php b/lib/public/User/Backend/IPasswordHashBackend.php new file mode 100644 index 00000000000..2525b4e45ea --- /dev/null +++ b/lib/public/User/Backend/IPasswordHashBackend.php @@ -0,0 +1,30 @@ +<?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; +} |