routes.php 2.8 KB

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