Browse Source

give old end-points a seperate name

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
pull/3614/head
Bjoern Schiessle 9 years ago
committed by Roeland Jago Douma
parent
commit
3bc72f7224
No known key found for this signature in database GPG Key ID: F941078878347C0C
  1. 4
      apps/federation/appinfo/routes.php
  2. 31
      apps/federation/lib/Controller/OCSAuthAPIController.php

4
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',
],

31
apps/federation/lib/Controller/OCSAuthAPIController.php

@ -90,6 +90,37 @@ class OCSAuthAPIController extends OCSController{
$this->logger = $logger;
}
/**
* @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

Loading…
Cancel
Save