Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions apps/federation/lib/Controller/OCSAuthAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

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;
Expand Down Expand Up @@ -79,7 +80,13 @@ public function __construct(
*
* @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);
Expand All @@ -91,7 +98,13 @@ public function requestSharedSecretLegacy(string $url, string $token): DataRespo
*
* @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);
Expand All @@ -102,7 +115,13 @@ public function getSharedSecretLegacy(string $url, string $token): DataResponse
*
* @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) {
Expand Down Expand Up @@ -138,7 +157,13 @@ public function requestSharedSecret(string $url, string $token): DataResponse {
*
* @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) {
Expand Down
Loading