Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions core/Controller/TaskProcessingApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
use OC\Core\ResponseDefinitions;
use OC\Files\SimpleFS\SimpleFile;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\Attribute\ExAppRequired;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use OCP\AppFramework\Http\Attribute\PublicPage;
use OCP\AppFramework\Http\Attribute\UserRateLimit;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\StreamResponse;
Expand Down Expand Up @@ -67,7 +65,7 @@ public function __construct(
*
* 200: Task types returned
*/
#[PublicPage]
#[NoAdminRequired]
#[ApiRoute(verb: 'GET', url: '/tasktypes', root: '/taskprocessing')]
public function taskTypes(): DataResponse {
/** @var array<string, CoreTaskProcessingTaskType> $taskTypes */
Expand Down Expand Up @@ -157,9 +155,8 @@ public function taskTypes(): DataResponse {
* 412: Scheduling task is not possible
* 401: Cannot schedule task because it references files in its input that the user doesn't have access to
*/
#[PublicPage]
#[UserRateLimit(limit: 20, period: 120)]
#[AnonRateLimit(limit: 5, period: 120)]
#[NoAdminRequired]
#[ApiRoute(verb: 'POST', url: '/schedule', root: '/taskprocessing')]
public function schedule(
array $input, string $type, string $appId, string $customId = '',
Expand Down Expand Up @@ -200,7 +197,7 @@ public function schedule(
* 200: Task returned
* 404: Task not found
*/
#[PublicPage]
#[NoAdminRequired]
#[ApiRoute(verb: 'GET', url: '/task/{id}', root: '/taskprocessing')]
public function getTask(int $id): DataResponse {
try {
Expand Down
116 changes: 97 additions & 19 deletions core/openapi-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -4761,7 +4761,6 @@
"task_processing_api"
],
"security": [
{},
{
"bearer_auth": []
},
Expand Down Expand Up @@ -4822,6 +4821,34 @@
}
}
}
},
"401": {
"description": "Current user is not logged in",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
Expand All @@ -4834,7 +4861,6 @@
"task_processing_api"
],
"security": [
{},
{
"bearer_auth": []
},
Expand Down Expand Up @@ -5061,35 +5087,60 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"anyOf": [
{
"type": "object",
"required": [
"meta",
"data"
"ocs"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"ocs": {
"type": "object",
"required": [
"message"
"meta",
"data"
],
"properties": {
"message": {
"type": "string"
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
},
{
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
]
}
}
}
Expand All @@ -5106,7 +5157,6 @@
"task_processing_api"
],
"security": [
{},
{
"bearer_auth": []
},
Expand Down Expand Up @@ -5250,6 +5300,34 @@
}
}
}
},
"401": {
"description": "Current user is not logged in",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
},
Expand Down
116 changes: 97 additions & 19 deletions core/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4761,7 +4761,6 @@
"task_processing_api"
],
"security": [
{},
{
"bearer_auth": []
},
Expand Down Expand Up @@ -4822,6 +4821,34 @@
}
}
}
},
"401": {
"description": "Current user is not logged in",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
Expand All @@ -4834,7 +4861,6 @@
"task_processing_api"
],
"security": [
{},
{
"bearer_auth": []
},
Expand Down Expand Up @@ -5061,35 +5087,60 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"anyOf": [
{
"type": "object",
"required": [
"meta",
"data"
"ocs"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"ocs": {
"type": "object",
"required": [
"message"
"meta",
"data"
],
"properties": {
"message": {
"type": "string"
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
},
{
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
]
}
}
}
Expand All @@ -5106,7 +5157,6 @@
"task_processing_api"
],
"security": [
{},
{
"bearer_auth": []
},
Expand Down Expand Up @@ -5250,6 +5300,34 @@
}
}
}
},
"401": {
"description": "Current user is not logged in",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
},
Expand Down
Loading
Loading