mirror of
https://github.com/nextcloud/server.git
synced 2026-03-27 21:03:39 -04:00
Merge pull request #39284 from nextcloud/feature/openapi/settings
settings: Add OpenAPI spec
This commit is contained in:
commit
ed27f04307
10 changed files with 34 additions and 4 deletions
|
|
@ -6,6 +6,7 @@
|
|||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
* @author Lukas Reschke <lukas@statuscode.ch>
|
||||
* @author Robin Appelman <robin@icewind.nl>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
|
|
@ -27,6 +28,7 @@ namespace OCA\Settings\Controller;
|
|||
|
||||
use OC\AppFramework\Middleware\Security\Exceptions\NotAdminException;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\Group\ISubAdmin;
|
||||
use OCP\IGroupManager;
|
||||
|
|
@ -37,6 +39,7 @@ use OCP\IUserSession;
|
|||
use OCP\Settings\IManager as ISettingsManager;
|
||||
use OCP\Template;
|
||||
|
||||
#[IgnoreOpenAPI]
|
||||
class AdminSettingsController extends Controller {
|
||||
use CommonSettingsTrait;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
* @author Morris Jobke <hey@morrisjobke.de>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
|
|
@ -42,6 +43,7 @@ use OC_App;
|
|||
use OCP\App\IAppManager;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
|
||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
|
|
@ -53,6 +55,7 @@ use OCP\IURLGenerator;
|
|||
use OCP\L10N\IFactory;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
#[IgnoreOpenAPI]
|
||||
class AppSettingsController extends Controller {
|
||||
|
||||
/** @var \OCP\IL10N */
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
* @author Timo Förster <tfoerster@webfoersterei.de>
|
||||
* @author Valdnet <47037905+Valdnet@users.noreply.github.com>
|
||||
* @author MichaIng <micha@dietpi.com>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
|
|
@ -69,6 +70,7 @@ use OCA\Settings\SetupChecks\PhpOutputBuffering;
|
|||
use OCA\Settings\SetupChecks\SupportedDatabase;
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
|
||||
use OCP\AppFramework\Http\DataDisplayResponse;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\RedirectResponse;
|
||||
|
|
@ -89,6 +91,7 @@ use Psr\Log\LoggerInterface;
|
|||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
|
||||
#[IgnoreOpenAPI]
|
||||
class CheckSetupController extends Controller {
|
||||
/** @var IConfig */
|
||||
private $config;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
|
|
@ -30,6 +31,7 @@ declare(strict_types=1);
|
|||
namespace OCA\Settings\Controller;
|
||||
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
|
||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IGroupManager;
|
||||
|
|
@ -38,6 +40,7 @@ use OCP\INavigationManager;
|
|||
use OCP\IRequest;
|
||||
use OCP\IURLGenerator;
|
||||
|
||||
#[IgnoreOpenAPI]
|
||||
class HelpController extends Controller {
|
||||
|
||||
/** @var INavigationManager */
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
* @author Lukas Reschke <lukas@statuscode.ch>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
|
|
@ -28,6 +29,7 @@ namespace OCA\Settings\Controller;
|
|||
|
||||
use OC\Log;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\StreamResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
|
|
@ -46,15 +48,19 @@ class LogSettingsController extends Controller {
|
|||
*
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @return StreamResponse
|
||||
* @psalm-suppress MoreSpecificReturnType The value of Content-Disposition is not relevant
|
||||
* @psalm-suppress LessSpecificReturnStatement The value of Content-Disposition is not relevant
|
||||
* @return StreamResponse<Http::STATUS_OK, array{Content-Type: 'application/octet-stream', 'Content-Disposition': string}>
|
||||
*/
|
||||
public function download() {
|
||||
if (!$this->log instanceof Log) {
|
||||
throw new \UnexpectedValueException('Log file not available');
|
||||
}
|
||||
$resp = new StreamResponse($this->log->getLogPath());
|
||||
$resp->addHeader('Content-Type', 'application/octet-stream');
|
||||
$resp->addHeader('Content-Disposition', 'attachment; filename="nextcloud.log"');
|
||||
$resp->setHeaders([
|
||||
'Content-Type' => 'application/octet-stream',
|
||||
'Content-Disposition' => 'attachment; filename="nextcloud.log"',
|
||||
]);
|
||||
return $resp;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author Robin Appelman <robin@icewind.nl>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
|
|
@ -26,6 +27,7 @@
|
|||
namespace OCA\Settings\Controller;
|
||||
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\Group\ISubAdmin;
|
||||
use OCP\IGroupManager;
|
||||
|
|
@ -35,6 +37,7 @@ use OCP\IUserSession;
|
|||
use OCP\Settings\IManager as ISettingsManager;
|
||||
use OCP\Template;
|
||||
|
||||
#[IgnoreOpenAPI]
|
||||
class PersonalSettingsController extends Controller {
|
||||
use CommonSettingsTrait;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ declare(strict_types=1);
|
|||
* @copyright Copyright (c) 2020, Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @author Jan C. Borchardt <hey@jancborchardt.net>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
|
|
@ -26,8 +27,10 @@ declare(strict_types=1);
|
|||
namespace OCA\Settings\Controller;
|
||||
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
|
||||
use OCP\AppFramework\Http\DataDisplayResponse;
|
||||
|
||||
#[IgnoreOpenAPI]
|
||||
class ReasonsController extends Controller {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ declare(strict_types=1);
|
|||
* @author Morris Jobke <hey@morrisjobke.de>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Vincent Petry <vincent@nextcloud.com>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
|
|
@ -54,6 +55,7 @@ use OCP\Accounts\IAccountManager;
|
|||
use OCP\Accounts\PropertyDoesNotExistException;
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
|
|
@ -71,6 +73,7 @@ use OCP\L10N\IFactory;
|
|||
use OCP\Mail\IMailer;
|
||||
use function in_array;
|
||||
|
||||
#[IgnoreOpenAPI]
|
||||
class UsersController extends Controller {
|
||||
/** @var UserManager */
|
||||
private $userManager;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ declare(strict_types=1);
|
|||
*
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Kate Döen <kate.doeen@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
|
|
@ -30,6 +31,7 @@ use OC\Authentication\WebAuthn\Manager;
|
|||
use OCA\Settings\AppInfo\Application;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\ILogger;
|
||||
use OCP\IRequest;
|
||||
|
|
@ -37,6 +39,7 @@ use OCP\ISession;
|
|||
use OCP\IUserSession;
|
||||
use Webauthn\PublicKeyCredentialCreationOptions;
|
||||
|
||||
#[IgnoreOpenAPI]
|
||||
class WebAuthnController extends Controller {
|
||||
private const WEBAUTHN_REGISTRATION = 'webauthn_registration';
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
"scheme": "bearer"
|
||||
}
|
||||
},
|
||||
"schemas": []
|
||||
"schemas": {}
|
||||
},
|
||||
"paths": {
|
||||
"/index.php/settings/admin/log/download": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue