aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2024-06-27 16:58:06 -0700
committerChristopher Ng <chrng8@gmail.com>2024-07-08 16:30:52 -0700
commitd65f53184e696565c2f955dbf523d84388ead254 (patch)
treeecf9c8e5ffe7a255fbfe91a926ab6c53f48dbd39 /lib
parent34d97d45cfae8a4f82bedb54582c1fc8eaf41369 (diff)
downloadnextcloud-server-d65f53184e696565c2f955dbf523d84388ead254.tar.gz
nextcloud-server-d65f53184e696565c2f955dbf523d84388ead254.zip
docs: Add info for the password hashes
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/public/IUser.php3
-rw-r--r--lib/public/User/Backend/IPasswordHashBackend.php5
2 files changed, 8 insertions, 0 deletions
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;