Skip to content

Commit 7c734a1

Browse files
Merge pull request #54701 from nextcloud/backport/54690/stable30
[stable30] fix(TaskProcessingApiController): Don't allow anonymous access anymore
2 parents a99288a + 1f70dc3 commit 7c734a1

3 files changed

Lines changed: 3 additions & 12 deletions

File tree

core/Controller/TaskProcessingApiController.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
use OC\Core\ResponseDefinitions;
1414
use OC\Files\SimpleFS\SimpleFile;
1515
use OCP\AppFramework\Http;
16-
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
1716
use OCP\AppFramework\Http\Attribute\ApiRoute;
1817
use OCP\AppFramework\Http\Attribute\ExAppRequired;
1918
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
20-
use OCP\AppFramework\Http\Attribute\PublicPage;
2119
use OCP\AppFramework\Http\Attribute\UserRateLimit;
2220
use OCP\AppFramework\Http\DataDownloadResponse;
2321
use OCP\AppFramework\Http\DataResponse;
@@ -64,7 +62,7 @@ public function __construct(
6462
*
6563
* 200: Task types returned
6664
*/
67-
#[PublicPage]
65+
#[NoAdminRequired]
6866
#[ApiRoute(verb: 'GET', url: '/tasktypes', root: '/taskprocessing')]
6967
public function taskTypes(): DataResponse {
7068
$taskTypes = array_map(function (array $tt) {
@@ -115,9 +113,8 @@ public function taskTypes(): DataResponse {
115113
* 412: Scheduling task is not possible
116114
* 401: Cannot schedule task because it references files in its input that the user doesn't have access to
117115
*/
118-
#[PublicPage]
119116
#[UserRateLimit(limit: 20, period: 120)]
120-
#[AnonRateLimit(limit: 5, period: 120)]
117+
#[NoAdminRequired]
121118
#[ApiRoute(verb: 'POST', url: '/schedule', root: '/taskprocessing')]
122119
public function schedule(
123120
array $input, string $type, string $appId, string $customId = '',
@@ -158,7 +155,7 @@ public function schedule(
158155
* 200: Task returned
159156
* 404: Task not found
160157
*/
161-
#[PublicPage]
158+
#[NoAdminRequired]
162159
#[ApiRoute(verb: 'GET', url: '/task/{id}', root: '/taskprocessing')]
163160
public function getTask(int $id): DataResponse {
164161
try {

core/openapi-full.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3837,7 +3837,6 @@
38373837
"task_processing_api"
38383838
],
38393839
"security": [
3840-
{},
38413840
{
38423841
"bearer_auth": []
38433842
},
@@ -3910,7 +3909,6 @@
39103909
"task_processing_api"
39113910
],
39123911
"security": [
3913-
{},
39143912
{
39153913
"bearer_auth": []
39163914
},
@@ -4180,7 +4178,6 @@
41804178
"task_processing_api"
41814179
],
41824180
"security": [
4183-
{},
41844181
{
41854182
"bearer_auth": []
41864183
},

core/openapi.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3837,7 +3837,6 @@
38373837
"task_processing_api"
38383838
],
38393839
"security": [
3840-
{},
38413840
{
38423841
"bearer_auth": []
38433842
},
@@ -3910,7 +3909,6 @@
39103909
"task_processing_api"
39113910
],
39123911
"security": [
3913-
{},
39143912
{
39153913
"bearer_auth": []
39163914
},
@@ -4180,7 +4178,6 @@
41804178
"task_processing_api"
41814179
],
41824180
"security": [
4183-
{},
41844181
{
41854182
"bearer_auth": []
41864183
},

0 commit comments

Comments
 (0)