routes.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bjoern Schiessle <bjoern@schiessle.org>
  6. * @author Björn Schießle <bjoern@schiessle.org>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. *
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. $application = new \OCA\Federation\AppInfo\Application();
  25. $application->registerRoutes(
  26. $this,
  27. [
  28. 'routes' => [
  29. [
  30. 'name' => 'Settings#addServer',
  31. 'url' => '/trusted-servers',
  32. 'verb' => 'POST'
  33. ],
  34. [
  35. 'name' => 'Settings#removeServer',
  36. 'url' => '/trusted-servers/{id}',
  37. 'verb' => 'DELETE'
  38. ],
  39. [
  40. 'name' => 'Settings#autoAddServers',
  41. 'url' => '/auto-add-servers',
  42. 'verb' => 'POST'
  43. ],
  44. ],
  45. 'ocs' => [
  46. // old endpoints, only used by Nextcloud and ownCloud
  47. [
  48. 'name' => 'OCSAuthAPI#getSharedSecretLegacy',
  49. 'url' => '/api/v1/shared-secret',
  50. 'verb' => 'GET',
  51. ],
  52. [
  53. 'name' => 'OCSAuthAPI#requestSharedSecretLegacy',
  54. 'url' => '/api/v1/request-shared-secret',
  55. 'verb' => 'POST',
  56. ],
  57. // new endpoints, published as public api
  58. [
  59. 'name' => 'OCSAuthAPI#getSharedSecret',
  60. 'root' => '/cloud',
  61. 'url' => '/shared-secret',
  62. 'verb' => 'GET',
  63. ],
  64. [
  65. 'name' => 'OCSAuthAPI#requestSharedSecret',
  66. 'root' => '/cloud',
  67. 'url' => '/shared-secret',
  68. 'verb' => 'POST',
  69. ],
  70. ],
  71. ]
  72. );