Skip to content

Commit eb5e24d

Browse files
Merge pull request #63378 from nextcloud/backport/63165/stable34
[stable34] fix(user_ldap): restore OCS API functionality for configID = ''
2 parents 9e1f1b7 + a39ce09 commit eb5e24d

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
@@ -37862,7 +37862,9 @@
3786237862
"description": "ID of the config",
3786337863
"required": true,
3786437864
"schema": {
37865-
"type": "string"
37865+
"type": "string",
37866+
"pattern": "^.*$",
37867+
"default": ""
3786637868
}
3786737869
},
3786837870
{
@@ -38035,7 +38037,9 @@
3803538037
"description": "ID of the config",
3803638038
"required": true,
3803738039
"schema": {
38038-
"type": "string"
38040+
"type": "string",
38041+
"pattern": "^.*$",
38042+
"default": ""
3803938043
}
3804038044
},
3804138045
{
@@ -38219,7 +38223,9 @@
3821938223
"description": "ID of the config",
3822038224
"required": true,
3822138225
"schema": {
38222-
"type": "string"
38226+
"type": "string",
38227+
"pattern": "^.*$",
38228+
"default": ""
3822338229
}
3822438230
},
3822538231
{
@@ -38386,7 +38392,9 @@
3838638392
"description": "ID of the LDAP config",
3838738393
"required": true,
3838838394
"schema": {
38389-
"type": "string"
38395+
"type": "string",
38396+
"pattern": "^.*$",
38397+
"default": ""
3839038398
}
3839138399
},
3839238400
{
@@ -38553,7 +38561,9 @@
3855338561
"description": "ID of the LDAP config",
3855438562
"required": true,
3855538563
"schema": {
38556-
"type": "string"
38564+
"type": "string",
38565+
"pattern": "^.*$",
38566+
"default": ""
3855738567
}
3855838568
},
3855938569
{

0 commit comments

Comments
 (0)