You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes.php 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. /**
  3. * @author Björn Schießle <schiessle@owncloud.com>
  4. * @author Christopher Schäpers <kondou@ts.unde.re>
  5. * @author Joas Schilling <nickvergessen@owncloud.com>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Thomas Müller <thomas.mueller@tmit.eu>
  8. * @author Tom Needham <tom@owncloud.com>
  9. *
  10. * @copyright Copyright (c) 2015, ownCloud, Inc.
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. use OCP\API;
  27. // Config
  28. API::register(
  29. 'get',
  30. '/config',
  31. array('OC_OCS_Config', 'apiConfig'),
  32. 'core',
  33. API::GUEST_AUTH
  34. );
  35. // Person
  36. API::register(
  37. 'post',
  38. '/person/check',
  39. array('OC_OCS_Person', 'check'),
  40. 'core',
  41. API::GUEST_AUTH
  42. );
  43. // Privatedata
  44. API::register(
  45. 'get',
  46. '/privatedata/getattribute',
  47. array('OC_OCS_Privatedata', 'get'),
  48. 'core',
  49. API::USER_AUTH,
  50. array('app' => '', 'key' => '')
  51. );
  52. API::register(
  53. 'get',
  54. '/privatedata/getattribute/{app}',
  55. array('OC_OCS_Privatedata', 'get'),
  56. 'core',
  57. API::USER_AUTH,
  58. array('key' => '')
  59. );
  60. API::register(
  61. 'get',
  62. '/privatedata/getattribute/{app}/{key}',
  63. array('OC_OCS_Privatedata', 'get'),
  64. 'core',
  65. API::USER_AUTH
  66. );
  67. API::register(
  68. 'post',
  69. '/privatedata/setattribute/{app}/{key}',
  70. array('OC_OCS_Privatedata', 'set'),
  71. 'core',
  72. API::USER_AUTH
  73. );
  74. API::register(
  75. 'post',
  76. '/privatedata/deleteattribute/{app}/{key}',
  77. array('OC_OCS_Privatedata', 'delete'),
  78. 'core',
  79. API::USER_AUTH
  80. );
  81. // cloud
  82. API::register(
  83. 'get',
  84. '/cloud/capabilities',
  85. array('OC_OCS_Cloud', 'getCapabilities'),
  86. 'core',
  87. API::USER_AUTH
  88. );
  89. API::register(
  90. 'get',
  91. '/cloud/users/{userid}',
  92. array('OC_OCS_Cloud', 'getUser'),
  93. 'core',
  94. API::USER_AUTH
  95. );
  96. API::register(
  97. 'get',
  98. '/cloud/user',
  99. array('OC_OCS_Cloud', 'getCurrentUser'),
  100. 'core',
  101. API::USER_AUTH
  102. );
  103. // Server-to-Server Sharing
  104. $s2s = new \OCA\Files_Sharing\API\Server2Server();
  105. API::register('post',
  106. '/cloud/shares',
  107. array($s2s, 'createShare'),
  108. 'files_sharing',
  109. API::GUEST_AUTH
  110. );
  111. API::register('post',
  112. '/cloud/shares/{id}/accept',
  113. array($s2s, 'acceptShare'),
  114. 'files_sharing',
  115. API::GUEST_AUTH
  116. );
  117. API::register('post',
  118. '/cloud/shares/{id}/decline',
  119. array($s2s, 'declineShare'),
  120. 'files_sharing',
  121. API::GUEST_AUTH
  122. );
  123. API::register('post',
  124. '/cloud/shares/{id}/unshare',
  125. array($s2s, 'unshare'),
  126. 'files_sharing',
  127. API::GUEST_AUTH
  128. );