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;