Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Add missing gateway tunnel response event authorisation

Rich Turner16d32d1f5627
diff --git a/manager/src/main/java/org/openremote/manager/gateway/GatewayConnector.java b/manager/src/main/java/org/openremote/manager/gateway/GatewayConnector.java
index 6230863e9..7fa9c292c 100644
--- a/manager/src/main/java/org/openremote/manager/gateway/GatewayConnector.java
+++ b/manager/src/main/java/org/openremote/manager/gateway/GatewayConnector.java
@@ -471,11 +471,17 @@ public class GatewayConnector {
/**
* Explicitly check event type and authorise accordingly don't blindly accept events from gateway
- * clients as they may be malicious
+ * clients as they may be malicious - every event type added to {@link #eventConsumerMap} should be handled
*/
protected SharedEvent authoriseGatewayEvent(SharedEvent event) {
// Gateway capabilities response events are always authorised
- if (event instanceof GatewayCapabilitiesResponseEvent capabilitiesResponseEvent) {
+ if (event instanceof GatewayCapabilitiesResponseEvent) {
+ return event;
+ }
+
+ // Gateway tunnel start/stop response events are always authorised
+ if (event instanceof GatewayTunnelStartResponseEvent
+ || event instanceof GatewayTunnelStopResponseEvent) {
return event;
}