Skip to content

Commit a4df2f5

Browse files
Merge pull request #55775 from nextcloud/backport/55732/stable32
[stable32] fix(TextProcessingApiController): Set better attribute on routes
2 parents 34c1b35 + 785508f commit a4df2f5

File tree

4 files changed

+170
-8
lines changed

4 files changed

+170
-8
lines changed

core/Controller/TextProcessingApiController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function taskTypes(): DataResponse {
9797
* 400: Scheduling task is not possible
9898
* 412: Scheduling task is not possible
9999
*/
100-
#[PublicPage]
100+
#[NoAdminRequired]
101101
#[UserRateLimit(limit: 20, period: 120)]
102102
#[AnonRateLimit(limit: 5, period: 120)]
103103
#[ApiRoute(verb: 'POST', url: '/schedule', root: '/textprocessing')]
@@ -137,7 +137,7 @@ public function schedule(string $input, string $type, string $appId, string $ide
137137
* 200: Task returned
138138
* 404: Task not found
139139
*/
140-
#[PublicPage]
140+
#[NoAdminRequired]
141141
#[ApiRoute(verb: 'GET', url: '/task/{id}', root: '/textprocessing')]
142142
public function getTask(int $id): DataResponse {
143143
try {

core/openapi-full.json

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6446,7 +6446,6 @@
64466446
"text_processing_api"
64476447
],
64486448
"security": [
6449-
{},
64506449
{
64516450
"bearer_auth": []
64526451
},
@@ -6652,6 +6651,34 @@
66526651
}
66536652
}
66546653
}
6654+
},
6655+
"401": {
6656+
"description": "Current user is not logged in",
6657+
"content": {
6658+
"application/json": {
6659+
"schema": {
6660+
"type": "object",
6661+
"required": [
6662+
"ocs"
6663+
],
6664+
"properties": {
6665+
"ocs": {
6666+
"type": "object",
6667+
"required": [
6668+
"meta",
6669+
"data"
6670+
],
6671+
"properties": {
6672+
"meta": {
6673+
"$ref": "#/components/schemas/OCSMeta"
6674+
},
6675+
"data": {}
6676+
}
6677+
}
6678+
}
6679+
}
6680+
}
6681+
}
66556682
}
66566683
}
66576684
}
@@ -6664,7 +6691,6 @@
66646691
"text_processing_api"
66656692
],
66666693
"security": [
6667-
{},
66686694
{
66696695
"bearer_auth": []
66706696
},
@@ -6808,6 +6834,34 @@
68086834
}
68096835
}
68106836
}
6837+
},
6838+
"401": {
6839+
"description": "Current user is not logged in",
6840+
"content": {
6841+
"application/json": {
6842+
"schema": {
6843+
"type": "object",
6844+
"required": [
6845+
"ocs"
6846+
],
6847+
"properties": {
6848+
"ocs": {
6849+
"type": "object",
6850+
"required": [
6851+
"meta",
6852+
"data"
6853+
],
6854+
"properties": {
6855+
"meta": {
6856+
"$ref": "#/components/schemas/OCSMeta"
6857+
},
6858+
"data": {}
6859+
}
6860+
}
6861+
}
6862+
}
6863+
}
6864+
}
68116865
}
68126866
}
68136867
},

core/openapi.json

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6446,7 +6446,6 @@
64466446
"text_processing_api"
64476447
],
64486448
"security": [
6449-
{},
64506449
{
64516450
"bearer_auth": []
64526451
},
@@ -6652,6 +6651,34 @@
66526651
}
66536652
}
66546653
}
6654+
},
6655+
"401": {
6656+
"description": "Current user is not logged in",
6657+
"content": {
6658+
"application/json": {
6659+
"schema": {
6660+
"type": "object",
6661+
"required": [
6662+
"ocs"
6663+
],
6664+
"properties": {
6665+
"ocs": {
6666+
"type": "object",
6667+
"required": [
6668+
"meta",
6669+
"data"
6670+
],
6671+
"properties": {
6672+
"meta": {
6673+
"$ref": "#/components/schemas/OCSMeta"
6674+
},
6675+
"data": {}
6676+
}
6677+
}
6678+
}
6679+
}
6680+
}
6681+
}
66556682
}
66566683
}
66576684
}
@@ -6664,7 +6691,6 @@
66646691
"text_processing_api"
66656692
],
66666693
"security": [
6667-
{},
66686694
{
66696695
"bearer_auth": []
66706696
},
@@ -6808,6 +6834,34 @@
68086834
}
68096835
}
68106836
}
6837+
},
6838+
"401": {
6839+
"description": "Current user is not logged in",
6840+
"content": {
6841+
"application/json": {
6842+
"schema": {
6843+
"type": "object",
6844+
"required": [
6845+
"ocs"
6846+
],
6847+
"properties": {
6848+
"ocs": {
6849+
"type": "object",
6850+
"required": [
6851+
"meta",
6852+
"data"
6853+
],
6854+
"properties": {
6855+
"meta": {
6856+
"$ref": "#/components/schemas/OCSMeta"
6857+
},
6858+
"data": {}
6859+
}
6860+
}
6861+
}
6862+
}
6863+
}
6864+
}
68116865
}
68126866
}
68136867
},

openapi.json

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9955,7 +9955,6 @@
99559955
"core/text_processing_api"
99569956
],
99579957
"security": [
9958-
{},
99599958
{
99609959
"bearer_auth": []
99619960
},
@@ -10161,6 +10160,34 @@
1016110160
}
1016210161
}
1016310162
}
10163+
},
10164+
"401": {
10165+
"description": "Current user is not logged in",
10166+
"content": {
10167+
"application/json": {
10168+
"schema": {
10169+
"type": "object",
10170+
"required": [
10171+
"ocs"
10172+
],
10173+
"properties": {
10174+
"ocs": {
10175+
"type": "object",
10176+
"required": [
10177+
"meta",
10178+
"data"
10179+
],
10180+
"properties": {
10181+
"meta": {
10182+
"$ref": "#/components/schemas/OCSMeta"
10183+
},
10184+
"data": {}
10185+
}
10186+
}
10187+
}
10188+
}
10189+
}
10190+
}
1016410191
}
1016510192
}
1016610193
}
@@ -10173,7 +10200,6 @@
1017310200
"core/text_processing_api"
1017410201
],
1017510202
"security": [
10176-
{},
1017710203
{
1017810204
"bearer_auth": []
1017910205
},
@@ -10317,6 +10343,34 @@
1031710343
}
1031810344
}
1031910345
}
10346+
},
10347+
"401": {
10348+
"description": "Current user is not logged in",
10349+
"content": {
10350+
"application/json": {
10351+
"schema": {
10352+
"type": "object",
10353+
"required": [
10354+
"ocs"
10355+
],
10356+
"properties": {
10357+
"ocs": {
10358+
"type": "object",
10359+
"required": [
10360+
"meta",
10361+
"data"
10362+
],
10363+
"properties": {
10364+
"meta": {
10365+
"$ref": "#/components/schemas/OCSMeta"
10366+
},
10367+
"data": {}
10368+
}
10369+
}
10370+
}
10371+
}
10372+
}
10373+
}
1032010374
}
1032110375
}
1032210376
},

0 commit comments

Comments
 (0)