mirror of
https://github.com/nextcloud/server.git
synced 2025-02-14 21:09:20 +00:00
![Jonas](/assets/img/avatar_default.png)
Calling the public API endpoints will check for matching registered reference providers that implement `IPublicReferenceProvider` and call their respective functions. If no matching provider is found, the default `LinkReferenceProvider` will be used to provide open graph data. The frontend reference widget components will call these endpoints from unauthorized sessions, e.g. in public shares. If present, the sharing token of the origin URL is passed to `resolveReferencePublic()` as additional information for the reference provider to determine the access scope. This allows the respective reference providers to determine whether the origin share has access to the linked resource. `getCacheKeyPublic` also gets the sharing token so it can scope the cached entry to it. Contributes to #45978 Signed-off-by: Jonas <jonas@freesources.org>
33 lines
936 B
PHP
33 lines
936 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/**
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OCP\Collaboration\Reference;
|
|
|
|
/**
|
|
* @since 30.0.0
|
|
*/
|
|
interface IPublicReferenceProvider extends IReferenceProvider {
|
|
/**
|
|
* Return a reference with its metadata for a given reference identifier and sharingToken
|
|
*
|
|
* @since 30.0.0
|
|
*/
|
|
public function resolveReferencePublic(string $referenceText, string $sharingToken): ?IReference;
|
|
|
|
/**
|
|
* Return a custom cache key to be used for caching the metadata
|
|
* This could be for example the current sharingToken if the reference
|
|
* access permissions are different for each share
|
|
*
|
|
* Should return null, if the cache is only related to the
|
|
* reference id and has no further dependency
|
|
*
|
|
* @since 30.0.0
|
|
*/
|
|
public function getCacheKeyPublic(string $referenceId, string $sharingToken): ?string;
|
|
}
|