2021-07-12 13:22:04 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2021-07-12 13:22:04 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2021-07-12 13:22:04 -04:00
|
|
|
*/
|
|
|
|
|
// use OCP namespace for all classes that are considered public.
|
2024-05-23 03:26:56 -04:00
|
|
|
// This means that they should be used by apps instead of the internal Nextcloud classes
|
2021-07-12 13:22:04 -04:00
|
|
|
|
|
|
|
|
namespace OCP\Authentication;
|
|
|
|
|
|
2026-06-01 08:00:44 -04:00
|
|
|
use OCP\HintException;
|
|
|
|
|
|
2021-07-12 13:22:04 -04:00
|
|
|
/**
|
|
|
|
|
* Interface IProvideUserSecretBackend
|
|
|
|
|
*
|
|
|
|
|
* @since 23.0.0
|
|
|
|
|
*/
|
|
|
|
|
interface IProvideUserSecretBackend {
|
|
|
|
|
/**
|
|
|
|
|
* Optionally returns a stable per-user secret. This secret is for
|
|
|
|
|
* instance used to secure file encryption keys.
|
2026-06-01 08:00:44 -04:00
|
|
|
*
|
|
|
|
|
* @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.
|
|
|
|
|
*
|
2021-07-12 13:22:04 -04:00
|
|
|
* @since 23.0.0
|
2026-06-01 08:00:44 -04:00
|
|
|
* @since 35.0.0 The returns value is now optional.
|
2021-07-12 13:22:04 -04:00
|
|
|
*/
|
2026-06-01 08:00:44 -04:00
|
|
|
public function getCurrentUserSecret(): ?string;
|
2021-07-12 13:22:04 -04:00
|
|
|
}
|