routes.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * Copyright (c) 2012, Tom Needham <tom@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or later.
  5. * See the COPYING-README file.
  6. */
  7. // Config
  8. OC_API::register(
  9. 'get',
  10. '/config',
  11. array('OC_OCS_Config', 'apiConfig'),
  12. 'core',
  13. OC_API::GUEST_AUTH
  14. );
  15. // Person
  16. OC_API::register(
  17. 'post',
  18. '/person/check',
  19. array('OC_OCS_Person', 'check'),
  20. 'core',
  21. OC_API::GUEST_AUTH
  22. );
  23. // Privatedata
  24. OC_API::register(
  25. 'get',
  26. '/privatedata/getattribute',
  27. array('OC_OCS_Privatedata', 'get'),
  28. 'core',
  29. OC_API::USER_AUTH,
  30. array('app' => '', 'key' => '')
  31. );
  32. OC_API::register(
  33. 'get',
  34. '/privatedata/getattribute/{app}',
  35. array('OC_OCS_Privatedata', 'get'),
  36. 'core',
  37. OC_API::USER_AUTH,
  38. array('key' => '')
  39. );
  40. OC_API::register(
  41. 'get',
  42. '/privatedata/getattribute/{app}/{key}',
  43. array('OC_OCS_Privatedata', 'get'),
  44. 'core',
  45. OC_API::USER_AUTH
  46. );
  47. OC_API::register(
  48. 'post',
  49. '/privatedata/setattribute/{app}/{key}',
  50. array('OC_OCS_Privatedata', 'set'),
  51. 'core',
  52. OC_API::USER_AUTH
  53. );
  54. OC_API::register(
  55. 'post',
  56. '/privatedata/deleteattribute/{app}/{key}',
  57. array('OC_OCS_Privatedata', 'delete'),
  58. 'core',
  59. OC_API::USER_AUTH
  60. );
  61. // cloud
  62. OC_API::register(
  63. 'get',
  64. '/cloud/capabilities',
  65. array('OC_OCS_Cloud', 'getCapabilities'),
  66. 'core',
  67. OC_API::USER_AUTH
  68. );
  69. OC_API::register(
  70. 'get',
  71. '/cloud/users/{userid}',
  72. array('OC_OCS_Cloud', 'getUser'),
  73. 'core',
  74. OC_API::USER_AUTH
  75. );
  76. OC_API::register(
  77. 'get',
  78. '/cloud/user',
  79. array('OC_OCS_Cloud', 'getCurrentUser'),
  80. 'core',
  81. OC_API::USER_AUTH
  82. );
  83. // Server-to-Server Sharing
  84. $s2s = new \OCA\Files_Sharing\API\Server2Server();
  85. OC_API::register('post',
  86. '/cloud/shares',
  87. array($s2s, 'createShare'),
  88. 'files_sharing',
  89. OC_API::GUEST_AUTH
  90. );
  91. OC_API::register('post',
  92. '/cloud/shares/{id}/accept',
  93. array($s2s, 'acceptShare'),
  94. 'files_sharing',
  95. OC_API::GUEST_AUTH
  96. );
  97. OC_API::register('post',
  98. '/cloud/shares/{id}/decline',
  99. array($s2s, 'declineShare'),
  100. 'files_sharing',
  101. OC_API::GUEST_AUTH
  102. );
  103. OC_API::register('post',
  104. '/cloud/shares/{id}/unshare',
  105. array($s2s, 'unshare'),
  106. 'files_sharing',
  107. OC_API::GUEST_AUTH
  108. );