fix: Make the IProvideUserSecretBackend usable

When implementing this for user_saml, I noticed that we do need to make
the return value nullable as otherwise there are no way for this feature
to be optional for the admin.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
This commit is contained in:
Carl Schwan 2026-06-01 14:00:44 +02:00 committed by backportbot[bot]
parent 28dc8bd417
commit a379aedde5
2 changed files with 15 additions and 4 deletions

View file

@ -9,6 +9,8 @@
namespace OCP\Authentication;
use OCP\HintException;
/**
* Interface IProvideUserSecretBackend
*
@ -18,8 +20,14 @@ interface IProvideUserSecretBackend {
/**
* Optionally returns a stable per-user secret. This secret is for
* instance used to secure file encryption keys.
* @return string
*
* @return non-empty-string|null Returns the per-user secret if the backend
* is configured or null otherwise.
* @throws HintException when the backend is configured to return a per-user
* secret but is unable to do so.
*
* @since 23.0.0
* @since 35.0.0 The returns value is now optional.
*/
public function getCurrentUserSecret(): string;
public function getCurrentUserSecret(): ?string;
}

View file

@ -13,11 +13,14 @@ namespace OCP\User\Backend;
*/
interface ICheckPasswordBackend {
/**
* @since 14.0.0
* Check if the password is correct without logging in the user
* returns the user id or false.
*
* @param string $loginName The loginname
* @param string $loginName The login name
* @param string $password The password
* @return string|false The uid on success false on failure
* @since 14.0.0
*
*/
public function checkPassword(string $loginName, string $password);
}