From 9bdc9e72b40e9645328d2e98bf4c0387e2e328a4 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 10 Nov 2024 21:22:47 +0100 Subject: [PATCH 1/2] [rest] Fix ThingActionsResource does not accept new Thing action UIDs due to wrong path RegEx Signed-off-by: Florian Hotze --- .../core/automation/rest/internal/ThingActionsResource.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java b/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java index 40c25278bc3..1e4085c68e9 100644 --- a/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java +++ b/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java @@ -217,7 +217,9 @@ public Response getActions(@PathParam("thingUID") @Parameter(description = "thin @POST @RolesAllowed({ Role.USER, Role.ADMIN }) - @Path("/{thingUID}/{actionUid: [a-zA-Z0-9]+\\.[a-zA-Z0-9]+}") + // accept actionUid in the form of "scope.actionTypeUid" or "scope.actionTypeUid#signatureHash" + // # is URL encoded as %23 + @Path("/{thingUID}/{actionUid: [a-zA-Z0-9]+\\.[a-zA-Z0-9]+(%23[a-zA-Z0-9]+)?}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(operationId = "executeThingAction", summary = "Executes a thing action.", responses = { From e9c370639305349709e5c9fe9ddde116163a13a0 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 10 Nov 2024 22:45:19 +0100 Subject: [PATCH 2/2] Address review Signed-off-by: Florian Hotze --- .../core/automation/rest/internal/ThingActionsResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java b/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java index 1e4085c68e9..c7c4b009acf 100644 --- a/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java +++ b/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java @@ -219,7 +219,7 @@ public Response getActions(@PathParam("thingUID") @Parameter(description = "thin @RolesAllowed({ Role.USER, Role.ADMIN }) // accept actionUid in the form of "scope.actionTypeUid" or "scope.actionTypeUid#signatureHash" // # is URL encoded as %23 - @Path("/{thingUID}/{actionUid: [a-zA-Z0-9]+\\.[a-zA-Z0-9]+(%23[a-zA-Z0-9]+)?}") + @Path("/{thingUID}/{actionUid: [a-zA-Z0-9]+\\.[a-zA-Z0-9]+(%23[A-Fa-f0-9]+)?}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(operationId = "executeThingAction", summary = "Executes a thing action.", responses = {