From d0b5ffe9676d4f4ad5583fd6fb6c44b81888e337 Mon Sep 17 00:00:00 2001 From: Virtually Nick Date: Fri, 1 Apr 2022 19:47:35 -0400 Subject: [PATCH] GUACAMOLE-1293: Change handshake instruction and client to username. --- .../protocol/ConfiguredGuacamoleSocket.java | 8 ++++---- .../protocol/GuacamoleClientInformation.java | 12 ++++++------ .../protocol/GuacamoleProtocolCapability.java | 8 ++++---- .../guacamole/tunnel/TunnelRequestService.java | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java b/guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java index ee1e26aef..4359138d2 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java @@ -297,10 +297,10 @@ public class ConfiguredGuacamoleSocket extends DelegatingGuacamoleSocket { } // Send client name, if supported and available - if (GuacamoleProtocolCapability.NAME_HANDSHAKE.isSupported(protocolVersion)) { - String name = info.getName(); - if (name != null) - writer.writeInstruction(new GuacamoleInstruction("name", name)); + if (GuacamoleProtocolCapability.USERNAME_HANDSHAKE.isSupported(protocolVersion)) { + String username = info.getUsername(); + if (username != null) + writer.writeInstruction(new GuacamoleInstruction("username", username)); } // Send args diff --git a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleClientInformation.java b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleClientInformation.java index b295db887..2404ca873 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleClientInformation.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleClientInformation.java @@ -62,7 +62,7 @@ public class GuacamoleClientInformation { /** * The name of the user reported by the client. */ - private String name; + private String username; /** * The timezone reported by the client. @@ -162,8 +162,8 @@ public class GuacamoleClientInformation { * @return * A string value of the human-readable name reported by the client. */ - public String getName() { - return name; + public String getUsername() { + return username; } /** @@ -181,11 +181,11 @@ public class GuacamoleClientInformation { /** * Set the human-readable name of the user associated with this client. * - * @param name + * @param username * The human-readable name of the user associated with this client. */ - public void setName(String name) { - this.name = name; + public void setUsername(String username) { + this.username = username; } /** diff --git a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolCapability.java b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolCapability.java index edfc26356..63e200117 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolCapability.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolCapability.java @@ -41,12 +41,12 @@ public enum GuacamoleProtocolCapability { MSG_INSTRUCTION(GuacamoleProtocolVersion.VERSION_1_5_0), /** - * Support for the "name" handshake instruction, allowing clients to send - * the name of the Guacamole user to be passed to guacd and associated with - * connections. Support for this insruction was introduced in + * Support for the "username" handshake instruction, allowing clients to + * send the name of the Guacamole user to be passed to guacd and associated + * with connections. Support for this instruction was introduced in * {@link GuacamoleProtocolVersion#VERSION_1_5_0}. */ - NAME_HANDSHAKE(GuacamoleProtocolVersion.VERSION_1_5_0), + USERNAME_HANDSHAKE(GuacamoleProtocolVersion.VERSION_1_5_0), /** * Negotiation of Guacamole protocol version between client and server diff --git a/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java b/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java index 7a31927d0..a6e192595 100644 --- a/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java +++ b/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java @@ -342,9 +342,9 @@ public class TunnelRequestService { UserContext userContext = session.getUserContext(authProviderIdentifier); // Attempt to get the username and set it for the tunnel client. - String name = authenticatedUser.getCredentials().getUsername(); - if (name != null) - info.setName(name); + String username = authenticatedUser.getCredentials().getUsername(); + if (username != null) + info.setUsername(username); try {