From d65f53184e696565c2f955dbf523d84388ead254 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 27 Jun 2024 16:58:06 -0700 Subject: docs: Add info for the password hashes Signed-off-by: Christopher Ng --- lib/public/IUser.php | 3 +++ lib/public/User/Backend/IPasswordHashBackend.php | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/public/IUser.php b/lib/public/IUser.php index b808e734b95..4ba9a89f064 100644 --- a/lib/public/IUser.php +++ b/lib/public/IUser.php @@ -79,6 +79,7 @@ interface IUser { /** * Get the password hash of the user * + * @return ?string the password hash hashed by `\OCP\Security\IHasher::hash()` * @since 30.0.0 */ public function getPasswordHash(): ?string; @@ -86,6 +87,8 @@ interface IUser { /** * Set the password hash of the user * + * @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 $passwordHash): bool; diff --git a/lib/public/User/Backend/IPasswordHashBackend.php b/lib/public/User/Backend/IPasswordHashBackend.php index 7bb3b33e1d0..2525b4e45ea 100644 --- a/lib/public/User/Backend/IPasswordHashBackend.php +++ b/lib/public/User/Backend/IPasswordHashBackend.php @@ -9,16 +9,21 @@ declare(strict_types=1); 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; -- cgit v1.2.3