diff options
Diffstat (limited to 'core/Controller/AppPasswordController.php')
-rw-r--r-- | core/Controller/AppPasswordController.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/core/Controller/AppPasswordController.php b/core/Controller/AppPasswordController.php index 90020330ea1..096261d2311 100644 --- a/core/Controller/AppPasswordController.php +++ b/core/Controller/AppPasswordController.php @@ -8,6 +8,7 @@ declare(strict_types=1); * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Daniel Kesselberg <mail@danielkesselberg.de> * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Kate Döen <kate.doeen@nextcloud.com> * * @license GNU AGPL version 3 or any later version * @@ -31,6 +32,7 @@ use OC\Authentication\Events\AppPasswordCreatedEvent; use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; +use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSForbiddenException; use OCP\Authentication\Exceptions\CredentialsUnavailableException; @@ -57,7 +59,12 @@ class AppPasswordController extends \OCP\AppFramework\OCSController { /** * @NoAdminRequired * - * @throws OCSForbiddenException + * Create app password + * + * @return DataResponse<Http::STATUS_OK, array{apppassword: string}, array{}> + * @throws OCSForbiddenException Creating app password is not allowed + * + * 200: App password returned */ public function getAppPassword(): DataResponse { // We do not allow the creation of new tokens if this is an app password @@ -102,6 +109,13 @@ class AppPasswordController extends \OCP\AppFramework\OCSController { /** * @NoAdminRequired + * + * Delete app password + * + * @return DataResponse<Http::STATUS_OK, array<empty>, array{}> + * @throws OCSForbiddenException Deleting app password is not allowed + * + * 200: App password deleted successfully */ public function deleteAppPassword(): DataResponse { if (!$this->session->exists('app_password')) { @@ -122,6 +136,13 @@ class AppPasswordController extends \OCP\AppFramework\OCSController { /** * @NoAdminRequired + * + * Rotate app password + * + * @return DataResponse<Http::STATUS_OK, array{apppassword: string}, array{}> + * @throws OCSForbiddenException Rotating app password is not allowed + * + * 200: App password returned */ public function rotateAppPassword(): DataResponse { if (!$this->session->exists('app_password')) { |