diff options
-rw-r--r-- | apps/federation/appinfo/routes.php | 4 | ||||
-rw-r--r-- | apps/federation/lib/Controller/OCSAuthAPIController.php | 31 |
2 files changed, 33 insertions, 2 deletions
diff --git a/apps/federation/appinfo/routes.php b/apps/federation/appinfo/routes.php index 4c742dd705c..01c37eab584 100644 --- a/apps/federation/appinfo/routes.php +++ b/apps/federation/appinfo/routes.php @@ -45,12 +45,12 @@ $application->registerRoutes( 'ocs' => [ // old endpoints, only used by Nextcloud and ownCloud [ - 'name' => 'OCSAuthAPI#getSharedSecret', + 'name' => 'OCSAuthAPI#getSharedSecretLegacy', 'url' => '/api/v1/shared-secret', 'verb' => 'GET', ], [ - 'name' => 'OCSAuthAPI#requestSharedSecret', + 'name' => 'OCSAuthAPI#requestSharedSecretLegacy', 'url' => '/api/v1/request-shared-secret', 'verb' => 'POST', ], diff --git a/apps/federation/lib/Controller/OCSAuthAPIController.php b/apps/federation/lib/Controller/OCSAuthAPIController.php index 6cd3b1890ef..1176434a4b8 100644 --- a/apps/federation/lib/Controller/OCSAuthAPIController.php +++ b/apps/federation/lib/Controller/OCSAuthAPIController.php @@ -94,6 +94,37 @@ class OCSAuthAPIController extends OCSController{ * @NoCSRFRequired * @PublicPage * + * request received to ask remote server for a shared secret, for legacy end-points + * + * @param string $url + * @param string $token + * @return Http\DataResponse + * @throws OCSForbiddenException + */ + public function requestSharedSecretLegacy($url, $token) { + return $this->requestSharedSecret($url, $token); + } + + + /** + * @NoCSRFRequired + * @PublicPage + * + * create shared secret and return it, for legacy end-points + * + * @param string $url + * @param string $token + * @return Http\DataResponse + * @throws OCSForbiddenException + */ + public function getSharedSecretLegacy($url, $token) { + return $this->getSharedSecret($url, $token); + } + + /** + * @NoCSRFRequired + * @PublicPage + * * request received to ask remote server for a shared secret * * @param string $url |