fix(TextProcessingApiController): Set better attribute on routes

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2025-09-17 10:32:11 +02:00
parent 50b6c66af7
commit 234907fc0b
2 changed files with 2 additions and 6 deletions

View file

@ -29,7 +29,6 @@ namespace OC\Core\Controller;
use InvalidArgumentException;
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\PublicPage;
use OCP\AppFramework\Http\Attribute\UserRateLimit;
@ -110,9 +109,8 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
* 400: Scheduling task is not possible
* 412: Scheduling task is not possible
*/
#[PublicPage]
#[NoAdminRequired]
#[UserRateLimit(limit: 20, period: 120)]
#[AnonRateLimit(limit: 5, period: 120)]
public function schedule(string $input, string $type, string $appId, string $identifier = ''): DataResponse {
try {
$task = new Task($type, $input, $appId, $this->userId, $identifier);
@ -149,7 +147,7 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
* 200: Task returned
* 404: Task not found
*/
#[PublicPage]
#[NoAdminRequired]
public function getTask(int $id): DataResponse {
try {
$task = $this->textProcessingManager->getUserTask($id, $this->userId);

View file

@ -4766,7 +4766,6 @@
"text_processing_api"
],
"security": [
{},
{
"bearer_auth": []
},
@ -4986,7 +4985,6 @@
"text_processing_api"
],
"security": [
{},
{
"bearer_auth": []
},