Skip to content

Commit 6a9b90f

Browse files
committed
settings: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
1 parent b446b19 commit 6a9b90f

10 files changed

+78
-1
lines changed

apps/settings/lib/Controller/AdminSettingsController.php

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
77
* @author Lukas Reschke <lukas@statuscode.ch>
88
* @author Robin Appelman <robin@icewind.nl>
9+
* @author Kate Döen <kate.doeen@nextcloud.com>
910
*
1011
* @license GNU AGPL version 3 or any later version
1112
*
@@ -61,6 +62,7 @@ public function __construct(
6162
* @NoCSRFRequired
6263
* @NoAdminRequired
6364
* @NoSubAdminRequired
65+
* @IgnoreAPI
6466
* We are checking the permissions in the getSettings method. If there is no allowed
6567
* settings for the given section. The user will be gretted by an error message.
6668
*/

apps/settings/lib/Controller/AppSettingsController.php

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* @author Morris Jobke <hey@morrisjobke.de>
1414
* @author Roeland Jago Douma <roeland@famdouma.nl>
1515
* @author Thomas Müller <thomas.mueller@tmit.eu>
16+
* @author Kate Döen <kate.doeen@nextcloud.com>
1617
*
1718
* @license AGPL-3.0
1819
*
@@ -125,6 +126,7 @@ public function __construct(string $appName,
125126

126127
/**
127128
* @NoCSRFRequired
129+
* @IgnoreAPI
128130
*
129131
* @return TemplateResponse
130132
*/

apps/settings/lib/Controller/CheckSetupController.php

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* @author Timo Förster <tfoerster@webfoersterei.de>
2727
* @author Valdnet <47037905+Valdnet@users.noreply.github.com>
2828
* @author MichaIng <micha@dietpi.com>
29+
* @author Kate Döen <kate.doeen@nextcloud.com>
2930
*
3031
* @license AGPL-3.0
3132
*
@@ -414,6 +415,7 @@ public function rescanFailedIntegrityCheck(): RedirectResponse {
414415
/**
415416
* @NoCSRFRequired
416417
* @AuthorizedAdminSetting(settings=OCA\Settings\Settings\Admin\Overview)
418+
* @IgnoreAPI
417419
*/
418420
public function getFailedIntegrityCheckFiles(): DataDisplayResponse {
419421
if (!$this->checker->isCodeCheckEnforced()) {

apps/settings/lib/Controller/HelpController.php

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* @author Joas Schilling <coding@schilljs.com>
1111
* @author Julius Härtl <jus@bitgrid.net>
1212
* @author Roeland Jago Douma <roeland@famdouma.nl>
13+
* @author Kate Döen <kate.doeen@nextcloud.com>
1314
*
1415
* @license GNU AGPL version 3 or any later version
1516
*
@@ -75,6 +76,7 @@ public function __construct(
7576
* @NoCSRFRequired
7677
* @NoAdminRequired
7778
* @NoSubAdminRequired
79+
* @IgnoreAPI
7880
*/
7981
public function help(string $mode = 'user'): TemplateResponse {
8082
$this->navigationManager->setActiveEntry('help');

apps/settings/lib/Controller/LogSettingsController.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @author Lukas Reschke <lukas@statuscode.ch>
99
* @author Roeland Jago Douma <roeland@famdouma.nl>
1010
* @author Thomas Müller <thomas.mueller@tmit.eu>
11+
* @author Kate Döen <kate.doeen@nextcloud.com>
1112
*
1213
* @license AGPL-3.0
1314
*
@@ -28,6 +29,7 @@
2829

2930
use OC\Log;
3031
use OCP\AppFramework\Controller;
32+
use OCP\AppFramework\Http;
3133
use OCP\AppFramework\Http\StreamResponse;
3234
use OCP\IRequest;
3335

@@ -46,7 +48,7 @@ public function __construct(string $appName, IRequest $request, Log $logger) {
4648
*
4749
* @NoCSRFRequired
4850
*
49-
* @return StreamResponse
51+
* @return StreamResponse<Http::STATUS_OK>
5052
*/
5153
public function download() {
5254
if (!$this->log instanceof Log) {

apps/settings/lib/Controller/PersonalSettingsController.php

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
77
* @author Joas Schilling <coding@schilljs.com>
88
* @author Robin Appelman <robin@icewind.nl>
9+
* @author Kate Döen <kate.doeen@nextcloud.com>
910
*
1011
* @license GNU AGPL version 3 or any later version
1112
*
@@ -59,6 +60,7 @@ public function __construct(
5960
* @NoCSRFRequired
6061
* @NoAdminRequired
6162
* @NoSubAdminRequired
63+
* @IgnoreAPI
6264
*/
6365
public function index(string $section): TemplateResponse {
6466
return $this->getIndexResponse('personal', $section);

apps/settings/lib/Controller/ReasonsController.php

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @copyright Copyright (c) 2020, Roeland Jago Douma <roeland@famdouma.nl>
77
*
88
* @author Jan C. Borchardt <hey@jancborchardt.net>
9+
* @author Kate Döen <kate.doeen@nextcloud.com>
910
*
1011
* @license GNU AGPL version 3 or any later version
1112
*
@@ -34,6 +35,7 @@ class ReasonsController extends Controller {
3435
* @NoCSRFRequired
3536
* @NoAdminRequired
3637
* @NoSubAdminRequired
38+
* @IgnoreAPI
3739
*/
3840
public function getPdf() {
3941
$data = file_get_contents(__DIR__ . '/../../data/Reasons to use Nextcloud.pdf');

apps/settings/lib/Controller/UsersController.php

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* @author Morris Jobke <hey@morrisjobke.de>
1717
* @author Roeland Jago Douma <roeland@famdouma.nl>
1818
* @author Vincent Petry <vincent@nextcloud.com>
19+
* @author Kate Döen <kate.doeen@nextcloud.com>
1920
*
2021
* @license AGPL-3.0
2122
*
@@ -145,6 +146,7 @@ public function __construct(
145146
/**
146147
* @NoCSRFRequired
147148
* @NoAdminRequired
149+
* @IgnoreAPI
148150
*
149151
* Display users list template
150152
*
@@ -157,6 +159,7 @@ public function usersListByGroup(): TemplateResponse {
157159
/**
158160
* @NoCSRFRequired
159161
* @NoAdminRequired
162+
* @IgnoreAPI
160163
*
161164
* Display users list template
162165
*

apps/settings/lib/Controller/WebAuthnController.php

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*
88
* @author Joas Schilling <coding@schilljs.com>
99
* @author Roeland Jago Douma <roeland@famdouma.nl>
10+
* @author Kate Döen <kate.doeen@nextcloud.com>
1011
*
1112
* @license GNU AGPL version 3 or any later version
1213
*
@@ -69,6 +70,7 @@ public function __construct(IRequest $request, ILogger $logger, Manager $webAuth
6970
* @PasswordConfirmationRequired
7071
* @UseSession
7172
* @NoCSRFRequired
73+
* @IgnoreAPI
7274
*/
7375
public function startRegistration(): JSONResponse {
7476
$this->logger->debug('Starting WebAuthn registration');

apps/settings/openapi.json

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"openapi": "3.0.3",
3+
"info": {
4+
"title": "settings",
5+
"description": "Nextcloud settings",
6+
"license": {
7+
"name": "agpl"
8+
},
9+
"version": "1.9.0"
10+
},
11+
"paths": {
12+
"/index.php/settings/admin/log/download": {
13+
"get": {
14+
"tags": [
15+
"log_settings"
16+
],
17+
"summary": "download logfile",
18+
"description": "This endpoint requires admin access",
19+
"operationId": "log_settings-download",
20+
"responses": {
21+
"200": {
22+
"description": "",
23+
"content": {
24+
"*/*": {
25+
"schema": {
26+
"type": "string",
27+
"format": "binary"
28+
}
29+
}
30+
}
31+
}
32+
},
33+
"security": [
34+
{
35+
"bearer_auth": []
36+
},
37+
{
38+
"basic_auth": []
39+
}
40+
]
41+
}
42+
}
43+
},
44+
"components": {
45+
"schemas": {},
46+
"securitySchemes": {
47+
"basic_auth": {
48+
"type": "http",
49+
"scheme": "basic"
50+
},
51+
"bearer_auth": {
52+
"type": "http",
53+
"scheme": "bearer"
54+
}
55+
}
56+
},
57+
"tags": []
58+
}

0 commit comments

Comments
 (0)