Skip to content

Commit 7b38aa1

Browse files
authored
Merge pull request #63377 from nextcloud/backport/63165/stable33
[stable33] fix(user_ldap): restore OCS API functionality for configID = ''
2 parents 6b646f1 + f78cdd1 commit 7b38aa1

3 files changed

Lines changed: 35 additions & 15 deletions

File tree

apps/user_ldap/lib/Controller/ConfigAPIController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function create() {
7272
* 200: Config deleted successfully
7373
*/
7474
#[AuthorizedAdminSetting(settings: Admin::class)]
75-
#[ApiRoute(verb: 'DELETE', url: '/api/v1/config/{configID}')]
75+
#[ApiRoute(verb: 'DELETE', url: '/api/v1/config/{configID}', requirements: ['configID' => '.*'], defaults: ['configID' => ''])]
7676
public function delete($configID) {
7777
try {
7878
$this->ensureConfigIDExists($configID);
@@ -102,7 +102,7 @@ public function delete($configID) {
102102
* 200: Config returned
103103
*/
104104
#[AuthorizedAdminSetting(settings: Admin::class)]
105-
#[ApiRoute(verb: 'PUT', url: '/api/v1/config/{configID}')]
105+
#[ApiRoute(verb: 'PUT', url: '/api/v1/config/{configID}', requirements: ['configID' => '.*'], defaults: ['configID' => ''])]
106106
public function modify($configID, $configData) {
107107
try {
108108
$this->ensureConfigIDExists($configID);
@@ -207,7 +207,7 @@ public function modify($configID, $configData) {
207207
* 200: Config returned
208208
*/
209209
#[AuthorizedAdminSetting(settings: Admin::class)]
210-
#[ApiRoute(verb: 'GET', url: '/api/v1/config/{configID}')]
210+
#[ApiRoute(verb: 'GET', url: '/api/v1/config/{configID}', requirements: ['configID' => '.*'], defaults: ['configID' => ''])]
211211
public function show($configID, $showPassword = false) {
212212
try {
213213
$this->ensureConfigIDExists($configID);
@@ -244,7 +244,7 @@ public function show($configID, $showPassword = false) {
244244
* 200: Test was run and results are returned
245245
*/
246246
#[AuthorizedAdminSetting(settings: Admin::class)]
247-
#[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/test')]
247+
#[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/test', requirements: ['configID' => '.*'], defaults: ['configID' => ''])]
248248
public function testConfiguration(string $configID) {
249249
try {
250250
$this->ensureConfigIDExists($configID);
@@ -312,7 +312,7 @@ public function testConfiguration(string $configID) {
312312
* 200: Config was copied, new configID was returned
313313
*/
314314
#[AuthorizedAdminSetting(settings: Admin::class)]
315-
#[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/copy')]
315+
#[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/copy', requirements: ['configID' => '.*'], defaults: ['configID' => ''])]
316316
public function copyConfiguration(string $configID) {
317317
try {
318318
$this->ensureConfigIDExists($configID);

apps/user_ldap/openapi.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@
196196
"description": "ID of the config",
197197
"required": true,
198198
"schema": {
199-
"type": "string"
199+
"type": "string",
200+
"pattern": "^.*$",
201+
"default": ""
200202
}
201203
},
202204
{
@@ -369,7 +371,9 @@
369371
"description": "ID of the config",
370372
"required": true,
371373
"schema": {
372-
"type": "string"
374+
"type": "string",
375+
"pattern": "^.*$",
376+
"default": ""
373377
}
374378
},
375379
{
@@ -553,7 +557,9 @@
553557
"description": "ID of the config",
554558
"required": true,
555559
"schema": {
556-
"type": "string"
560+
"type": "string",
561+
"pattern": "^.*$",
562+
"default": ""
557563
}
558564
},
559565
{
@@ -720,7 +726,9 @@
720726
"description": "ID of the LDAP config",
721727
"required": true,
722728
"schema": {
723-
"type": "string"
729+
"type": "string",
730+
"pattern": "^.*$",
731+
"default": ""
724732
}
725733
},
726734
{
@@ -887,7 +895,9 @@
887895
"description": "ID of the LDAP config",
888896
"required": true,
889897
"schema": {
890-
"type": "string"
898+
"type": "string",
899+
"pattern": "^.*$",
900+
"default": ""
891901
}
892902
},
893903
{

openapi.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36153,7 +36153,9 @@
3615336153
"description": "ID of the config",
3615436154
"required": true,
3615536155
"schema": {
36156-
"type": "string"
36156+
"type": "string",
36157+
"pattern": "^.*$",
36158+
"default": ""
3615736159
}
3615836160
},
3615936161
{
@@ -36326,7 +36328,9 @@
3632636328
"description": "ID of the config",
3632736329
"required": true,
3632836330
"schema": {
36329-
"type": "string"
36331+
"type": "string",
36332+
"pattern": "^.*$",
36333+
"default": ""
3633036334
}
3633136335
},
3633236336
{
@@ -36510,7 +36514,9 @@
3651036514
"description": "ID of the config",
3651136515
"required": true,
3651236516
"schema": {
36513-
"type": "string"
36517+
"type": "string",
36518+
"pattern": "^.*$",
36519+
"default": ""
3651436520
}
3651536521
},
3651636522
{
@@ -36677,7 +36683,9 @@
3667736683
"description": "ID of the LDAP config",
3667836684
"required": true,
3667936685
"schema": {
36680-
"type": "string"
36686+
"type": "string",
36687+
"pattern": "^.*$",
36688+
"default": ""
3668136689
}
3668236690
},
3668336691
{
@@ -36844,7 +36852,9 @@
3684436852
"description": "ID of the LDAP config",
3684536853
"required": true,
3684636854
"schema": {
36847-
"type": "string"
36855+
"type": "string",
36856+
"pattern": "^.*$",
36857+
"default": ""
3684836858
}
3684936859
},
3685036860
{

0 commit comments

Comments
 (0)