]> source.dussan.org Git - nextcloud-server.git/commitdiff
docs: Add info for the password hashes
authorChristopher Ng <chrng8@gmail.com>
Thu, 27 Jun 2024 23:58:06 +0000 (16:58 -0700)
committerChristopher Ng <chrng8@gmail.com>
Mon, 8 Jul 2024 23:30:52 +0000 (16:30 -0700)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
lib/public/IUser.php
lib/public/User/Backend/IPasswordHashBackend.php

index b808e734b95fea5cd8908ddff4337165e871c5d6..4ba9a89f06420632c4300eb54b21fb37fa4c520c 100644 (file)
@@ -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;
index 7bb3b33e1d0a046c5e8b1b1860be2d11e5803d68..2525b4e45ea5733d9a192c883827ca3086b65d32 100644 (file)
@@ -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;