Skip to content

Commit 18c1da1

Browse files
committed
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>
1 parent c3f5c36 commit 18c1da1

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

lib/public/Authentication/IProvideUserSecretBackend.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
namespace OCP\Authentication;
1111

12+
use OCP\HintException;
13+
1214
/**
1315
* Interface IProvideUserSecretBackend
1416
*
@@ -18,8 +20,14 @@ interface IProvideUserSecretBackend {
1820
/**
1921
* Optionally returns a stable per-user secret. This secret is for
2022
* instance used to secure file encryption keys.
21-
* @return string
23+
*
24+
* @return non-empty-string|null Returns the per-user secret if the backend
25+
* is configured or null otherwise.
26+
* @throws HintException when the backend is configured to returns a per-user
27+
* secret but is unable to do so.
28+
*
2229
* @since 23.0.0
30+
* @since 35.0.0 The returns value is now optional.
2331
*/
24-
public function getCurrentUserSecret(): string;
32+
public function getCurrentUserSecret(): ?string;
2533
}

lib/public/User/Backend/ICheckPasswordBackend.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
*/
1414
interface ICheckPasswordBackend {
1515
/**
16-
* @since 14.0.0
16+
* Check if the password is correct without logging in the user
17+
* returns the user id or false.
1718
*
18-
* @param string $loginName The loginname
19+
* @param string $loginName The login name
1920
* @param string $password The password
2021
* @return string|false The uid on success false on failure
22+
*@since 14.0.0
23+
*
2124
*/
2225
public function checkPassword(string $loginName, string $password);
2326
}

0 commit comments

Comments
 (0)