From 9e5f101371466830f5b3b07b6e6c593f6c2a06c8 Mon Sep 17 00:00:00 2001 From: Virtually Nick Date: Tue, 8 Nov 2022 09:25:21 -0500 Subject: [PATCH] GUACAMOLE-1293: Change "username" instruction to simply "name" for clarity on its purpose. --- .../src/main/webapp/modules/Client.js | 4 ++-- .../protocol/ConfiguredGuacamoleSocket.java | 8 ++++---- .../protocol/GuacamoleClientInformation.java | 12 ++++++------ .../protocol/GuacamoleProtocolCapability.java | 8 ++++---- .../guacamole/protocol/GuacamoleProtocolVersion.java | 4 ++-- .../guacamole/tunnel/TunnelRequestService.java | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Client.js b/guacamole-common-js/src/main/webapp/modules/Client.js index dd7ba2774..c4ed16278 100644 --- a/guacamole-common-js/src/main/webapp/modules/Client.js +++ b/guacamole-common-js/src/main/webapp/modules/Client.js @@ -1857,7 +1857,7 @@ Guacamole.Client.Message = { /** * A client message that indicates that a user has joined an existing * connection. This message expects a single additional argument - the - * username of the user who has joined the connection. + * name of the user who has joined the connection. * * @type {!number} */ @@ -1866,7 +1866,7 @@ Guacamole.Client.Message = { /** * A client message that indicates that a user has left an existing * connection. This message expects a single additional argument - the - * username of the user who has left the connection. + * name of the user who has left the connection. * * @type {!number} */ 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 4359138d2..ee1e26aef 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.USERNAME_HANDSHAKE.isSupported(protocolVersion)) { - String username = info.getUsername(); - if (username != null) - writer.writeInstruction(new GuacamoleInstruction("username", username)); + if (GuacamoleProtocolCapability.NAME_HANDSHAKE.isSupported(protocolVersion)) { + String name = info.getName(); + if (name != null) + writer.writeInstruction(new GuacamoleInstruction("name", name)); } // 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 2404ca873..b295db887 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 username; + private String name; /** * 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 getUsername() { - return username; + public String getName() { + return name; } /** @@ -181,11 +181,11 @@ public class GuacamoleClientInformation { /** * Set the human-readable name of the user associated with this client. * - * @param username + * @param name * The human-readable name of the user associated with this client. */ - public void setUsername(String username) { - this.username = username; + public void setName(String name) { + this.name = name; } /** 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 63e200117..4a5653bbd 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 "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 + * 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 instruction was introduced in * {@link GuacamoleProtocolVersion#VERSION_1_5_0}. */ - USERNAME_HANDSHAKE(GuacamoleProtocolVersion.VERSION_1_5_0), + NAME_HANDSHAKE(GuacamoleProtocolVersion.VERSION_1_5_0), /** * Negotiation of Guacamole protocol version between client and server diff --git a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolVersion.java b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolVersion.java index 3da4fac4b..a8e443102 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolVersion.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleProtocolVersion.java @@ -56,8 +56,8 @@ public class GuacamoleProtocolVersion { /** * Protocol version 1.5.0, which introduces the "msg" instruction, allowing * the server to send message notifications that will be displayed on the - * client. The version also adds support for the "username" handshake - * instruction, allowing guacd to store the username of the user who is + * client. The version also adds support for the "name" handshake + * instruction, allowing guacd to store the name of the user who is * accessing the connection. */ public static final GuacamoleProtocolVersion VERSION_1_5_0 = new GuacamoleProtocolVersion(1, 5, 0); 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 a6e192595..1dd567a72 100644 --- a/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java +++ b/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java @@ -341,10 +341,10 @@ public class TunnelRequestService { AuthenticatedUser authenticatedUser = session.getAuthenticatedUser(); UserContext userContext = session.getUserContext(authProviderIdentifier); - // Attempt to get the username and set it for the tunnel client. - String username = authenticatedUser.getCredentials().getUsername(); - if (username != null) - info.setUsername(username); + // Attempt to get the user's name and set it for the tunnel client. + String name = authenticatedUser.getIdentifier(); + if (name != null) + info.setName(name); try {