From 95bd6028b799320b677092897929486fce7918d6 Mon Sep 17 00:00:00 2001 From: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> Date: Tue, 11 Aug 2026 18:09:52 +0200 Subject: [PATCH 1/2] fix(user_ldap): restore OCS API functionality for configID = '' The default in the past for a config prefix was '', changed to a default of s01 some year back. A refactor of the routes led to dropping the possibility of passing an empty config ID, breaking the administration interface for all users affected. Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> --- apps/user_ldap/lib/Controller/ConfigAPIController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/user_ldap/lib/Controller/ConfigAPIController.php b/apps/user_ldap/lib/Controller/ConfigAPIController.php index 9ef20a0ffc94f..37679608b5cff 100644 --- a/apps/user_ldap/lib/Controller/ConfigAPIController.php +++ b/apps/user_ldap/lib/Controller/ConfigAPIController.php @@ -72,7 +72,7 @@ public function create() { * 200: Config deleted successfully */ #[AuthorizedAdminSetting(settings: Admin::class)] - #[ApiRoute(verb: 'DELETE', url: '/api/v1/config/{configID}')] + #[ApiRoute(verb: 'DELETE', url: '/api/v1/config/{configID}', requirements: ['configID' => '.*'], defaults: ['configID' => ''])] public function delete($configID) { try { $this->ensureConfigIDExists($configID); @@ -102,7 +102,7 @@ public function delete($configID) { * 200: Config returned */ #[AuthorizedAdminSetting(settings: Admin::class)] - #[ApiRoute(verb: 'PUT', url: '/api/v1/config/{configID}')] + #[ApiRoute(verb: 'PUT', url: '/api/v1/config/{configID}', requirements: ['configID' => '.*'], defaults: ['configID' => ''])] public function modify($configID, $configData) { try { $this->ensureConfigIDExists($configID); @@ -207,7 +207,7 @@ public function modify($configID, $configData) { * 200: Config returned */ #[AuthorizedAdminSetting(settings: Admin::class)] - #[ApiRoute(verb: 'GET', url: '/api/v1/config/{configID}')] + #[ApiRoute(verb: 'GET', url: '/api/v1/config/{configID}', requirements: ['configID' => '.*'], defaults: ['configID' => ''])] public function show($configID, $showPassword = false) { try { $this->ensureConfigIDExists($configID); @@ -244,7 +244,7 @@ public function show($configID, $showPassword = false) { * 200: Test was run and results are returned */ #[AuthorizedAdminSetting(settings: Admin::class)] - #[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/test')] + #[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/test', requirements: ['configID' => '.*'], defaults: ['configID' => ''])] public function testConfiguration(string $configID) { try { $this->ensureConfigIDExists($configID); @@ -312,7 +312,7 @@ public function testConfiguration(string $configID) { * 200: Config was copied, new configID was returned */ #[AuthorizedAdminSetting(settings: Admin::class)] - #[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/copy')] + #[ApiRoute(verb: 'POST', url: '/api/v1/config/{configID}/copy', requirements: ['configID' => '.*'], defaults: ['configID' => ''])] public function copyConfiguration(string $configID) { try { $this->ensureConfigIDExists($configID); From a39ce099c1e5c89c15ebb610effdbaca6daaffc7 Mon Sep 17 00:00:00 2001 From: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> Date: Thu, 13 Aug 2026 09:53:20 +0200 Subject: [PATCH 2/2] chore: update OpenAPI specs Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> --- apps/user_ldap/openapi.json | 20 +++++++++++++++----- openapi.json | 20 +++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/apps/user_ldap/openapi.json b/apps/user_ldap/openapi.json index 08e1f34dc0e9e..98afc0c3932f3 100644 --- a/apps/user_ldap/openapi.json +++ b/apps/user_ldap/openapi.json @@ -196,7 +196,9 @@ "description": "ID of the config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { @@ -369,7 +371,9 @@ "description": "ID of the config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { @@ -553,7 +557,9 @@ "description": "ID of the config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { @@ -720,7 +726,9 @@ "description": "ID of the LDAP config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { @@ -887,7 +895,9 @@ "description": "ID of the LDAP config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { diff --git a/openapi.json b/openapi.json index 0dfe7aa42f4fb..23f7a052b37bb 100644 --- a/openapi.json +++ b/openapi.json @@ -37862,7 +37862,9 @@ "description": "ID of the config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { @@ -38035,7 +38037,9 @@ "description": "ID of the config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { @@ -38219,7 +38223,9 @@ "description": "ID of the config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { @@ -38386,7 +38392,9 @@ "description": "ID of the LDAP config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, { @@ -38553,7 +38561,9 @@ "description": "ID of the LDAP config", "required": true, "schema": { - "type": "string" + "type": "string", + "pattern": "^.*$", + "default": "" } }, {