aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federation/lib
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-06-14 09:50:40 +0200
committerjld3103 <jld3103yt@gmail.com>2023-07-10 15:29:07 +0200
commitd8ce744403165fc17fd0b270168dcdc4e4ca21d8 (patch)
tree52c2ee33a417b5eb579cd8ac154b4063f9ee927c /apps/federation/lib
parenta84fa17c7324599f9b872967e7b96d8a504a89b0 (diff)
downloadnextcloud-server-d8ce744403165fc17fd0b270168dcdc4e4ca21d8.tar.gz
nextcloud-server-d8ce744403165fc17fd0b270168dcdc4e4ca21d8.zip
federation: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'apps/federation/lib')
-rw-r--r--apps/federation/lib/Controller/OCSAuthAPIController.php33
1 files changed, 29 insertions, 4 deletions
diff --git a/apps/federation/lib/Controller/OCSAuthAPIController.php b/apps/federation/lib/Controller/OCSAuthAPIController.php
index 5a976720b04..8fa33fa48ef 100644
--- a/apps/federation/lib/Controller/OCSAuthAPIController.php
+++ b/apps/federation/lib/Controller/OCSAuthAPIController.php
@@ -30,6 +30,7 @@ namespace OCA\Federation\Controller;
use OCA\Federation\DbHandler;
use OCA\Federation\TrustedServers;
+use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSForbiddenException;
use OCP\AppFramework\OCSController;
@@ -79,7 +80,13 @@ class OCSAuthAPIController extends OCSController {
*
* @NoCSRFRequired
* @PublicPage
- * @throws OCSForbiddenException
+ *
+ * @param string $url URL of the server
+ * @param string $token Token of the server
+ * @return DataResponse<Http::STATUS_OK, array<empty>, array{}>
+ * @throws OCSForbiddenException Requesting shared secret is not allowed
+ *
+ * 200: Shared secret requested successfully
*/
public function requestSharedSecretLegacy(string $url, string $token): DataResponse {
return $this->requestSharedSecret($url, $token);
@@ -91,7 +98,13 @@ class OCSAuthAPIController extends OCSController {
*
* @NoCSRFRequired
* @PublicPage
- * @throws OCSForbiddenException
+ *
+ * @param string $url URL of the server
+ * @param string $token Token of the server
+ * @return DataResponse<Http::STATUS_OK, array{sharedSecret: string}, array{}>
+ * @throws OCSForbiddenException Getting shared secret is not allowed
+ *
+ * 200: Shared secret returned
*/
public function getSharedSecretLegacy(string $url, string $token): DataResponse {
return $this->getSharedSecret($url, $token);
@@ -102,7 +115,13 @@ class OCSAuthAPIController extends OCSController {
*
* @NoCSRFRequired
* @PublicPage
- * @throws OCSForbiddenException
+ *
+ * @param string $url URL of the server
+ * @param string $token Token of the server
+ * @return DataResponse<Http::STATUS_OK, array<empty>, array{}>
+ * @throws OCSForbiddenException Requesting shared secret is not allowed
+ *
+ * 200: Shared secret requested successfully
*/
public function requestSharedSecret(string $url, string $token): DataResponse {
if ($this->trustedServers->isTrustedServer($url) === false) {
@@ -138,7 +157,13 @@ class OCSAuthAPIController extends OCSController {
*
* @NoCSRFRequired
* @PublicPage
- * @throws OCSForbiddenException
+ *
+ * @param string $url URL of the server
+ * @param string $token Token of the server
+ * @return DataResponse<Http::STATUS_OK, array{sharedSecret: string}, array{}>
+ * @throws OCSForbiddenException Getting shared secret is not allowed
+ *
+ * 200: Shared secret returned
*/
public function getSharedSecret(string $url, string $token): DataResponse {
if ($this->trustedServers->isTrustedServer($url) === false) {