]> source.dussan.org Git - nextcloud-server.git/commit
feat(Reference): Add public API endpoints to get references 46378/head
authorJonas <jonas@freesources.org>
Mon, 8 Jul 2024 09:29:26 +0000 (11:29 +0200)
committerJonas <jonas@freesources.org>
Wed, 17 Jul 2024 10:56:41 +0000 (12:56 +0200)
commit1671bf3ef219dd641b51b4d154ea701c6a7cf6b9
tree70b971f9fea1968d7ec3c48b71dd5d1522500922
parentb06ce832d8f280b9c008b91c41757e8eab37dc77
feat(Reference): Add public API endpoints to get references

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>
core/Controller/ReferenceApiController.php
core/openapi-full.json
core/openapi.json
lib/composer/composer/autoload_classmap.php
lib/composer/composer/autoload_static.php
lib/private/Collaboration/Reference/ReferenceManager.php
lib/public/Collaboration/Reference/IPublicReferenceProvider.php [new file with mode: 0644]
lib/public/Collaboration/Reference/IReferenceManager.php
lib/public/Collaboration/Reference/LinkReferenceProvider.php