Skip to content

Commit dc29793

Browse files
Merge pull request #55771 from nextcloud/backport/55732/stable28
[stable28] fix(TextProcessingApiController): Set better attribute on routes
2 parents 6686ed2 + 234907f commit dc29793

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

core/Controller/TextProcessingApiController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
use InvalidArgumentException;
3030
use OCA\Core\ResponseDefinitions;
3131
use OCP\AppFramework\Http;
32-
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
3332
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
3433
use OCP\AppFramework\Http\Attribute\PublicPage;
3534
use OCP\AppFramework\Http\Attribute\UserRateLimit;
@@ -110,9 +109,8 @@ public function taskTypes(): DataResponse {
110109
* 400: Scheduling task is not possible
111110
* 412: Scheduling task is not possible
112111
*/
113-
#[PublicPage]
112+
#[NoAdminRequired]
114113
#[UserRateLimit(limit: 20, period: 120)]
115-
#[AnonRateLimit(limit: 5, period: 120)]
116114
public function schedule(string $input, string $type, string $appId, string $identifier = ''): DataResponse {
117115
try {
118116
$task = new Task($type, $input, $appId, $this->userId, $identifier);
@@ -149,7 +147,7 @@ public function schedule(string $input, string $type, string $appId, string $ide
149147
* 200: Task returned
150148
* 404: Task not found
151149
*/
152-
#[PublicPage]
150+
#[NoAdminRequired]
153151
public function getTask(int $id): DataResponse {
154152
try {
155153
$task = $this->textProcessingManager->getUserTask($id, $this->userId);

core/openapi.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4766,7 +4766,6 @@
47664766
"text_processing_api"
47674767
],
47684768
"security": [
4769-
{},
47704769
{
47714770
"bearer_auth": []
47724771
},
@@ -4986,7 +4985,6 @@
49864985
"text_processing_api"
49874986
],
49884987
"security": [
4989-
{},
49904988
{
49914989
"bearer_auth": []
49924990
},

0 commit comments

Comments
 (0)