diff options
author | jld3103 <jld3103yt@gmail.com> | 2023-03-15 17:29:32 +0100 |
---|---|---|
committer | jld3103 <jld3103yt@gmail.com> | 2023-07-13 07:24:15 +0200 |
commit | 1be836273ddba6e0ddb3509a1d898535df9fd169 (patch) | |
tree | 5aa57fed3c2173484ffcd082f61aaef5015fc3f3 /core/Controller/AppPasswordController.php | |
parent | 706c141fffce928d344fe2f039da549fad065393 (diff) | |
download | nextcloud-server-1be836273ddba6e0ddb3509a1d898535df9fd169.tar.gz nextcloud-server-1be836273ddba6e0ddb3509a1d898535df9fd169.zip |
core: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
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')) { |