docs: Add info for the password hashes

Signed-off-by: Christopher Ng <chrng8@gmail.com>
pull/46123/head
Christopher Ng 2 years ago
parent 34d97d45cf
commit d65f53184e
  1. 3
      lib/public/IUser.php
  2. 5
      lib/public/User/Backend/IPasswordHashBackend.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;

@ -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;

Loading…
Cancel
Save