diff options
Diffstat (limited to 'lib/public/Http/WellKnown/IHandler.php')
-rw-r--r-- | lib/public/Http/WellKnown/IHandler.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/public/Http/WellKnown/IHandler.php b/lib/public/Http/WellKnown/IHandler.php new file mode 100644 index 00000000000..274d0241969 --- /dev/null +++ b/lib/public/Http/WellKnown/IHandler.php @@ -0,0 +1,30 @@ +<?php + +declare(strict_types=1); + +/** + * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +namespace OCP\Http\WellKnown; + +/** + * Interface for an app handler that reacts to requests to Nextcloud's well + * known URLs, e.g. to a WebFinger + * + * @ref https://tools.ietf.org/html/rfc5785 + * + * @since 21.0.0 + */ +interface IHandler { + /** + * @param string $service the name of the well known service, e.g. 'webfinger' + * @param IRequestContext $context + * @param IResponse|null $previousResponse the response of the previous handler, if any + * + * @return IResponse|null a response object if the request could be handled, null otherwise + * + * @since 21.0.0 + */ + public function handle(string $service, IRequestContext $context, ?IResponse $previousResponse): ?IResponse; +} |