diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/activeconnection/TrackedActiveConnection.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/activeconnection/TrackedActiveConnection.java index 6c2e4d5a8..29243f4d1 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/activeconnection/TrackedActiveConnection.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/activeconnection/TrackedActiveConnection.java @@ -50,6 +50,12 @@ public class TrackedActiveConnection extends RestrictedObject implements ActiveC */ private String identifier; + /** + * The actual connection record from which this ActiveConnection derives its + * data. + */ + private ActiveConnectionRecord connectionRecord; + /** * The connection being actively used or shared. */ @@ -75,13 +81,6 @@ public class TrackedActiveConnection extends RestrictedObject implements ActiveC */ private String username; - /** - * The connection ID of the connection as determined by guacd, not to be - * confused with the connection identifier determined by the database. This - * is the ID that must be supplied to guacd if joining this connection. - */ - private String connectionID; - /** * The underlying GuacamoleTunnel. */ @@ -111,10 +110,10 @@ public class TrackedActiveConnection extends RestrictedObject implements ActiveC boolean includeSensitiveInformation) { super.init(currentUser); + this.connectionRecord = activeConnectionRecord; // Copy all non-sensitive data from given record this.connection = activeConnectionRecord.getConnection(); - this.connectionID = activeConnectionRecord.getConnectionID(); this.sharingProfileIdentifier = activeConnectionRecord.getSharingProfileIdentifier(); this.identifier = activeConnectionRecord.getUUID().toString(); this.startDate = activeConnectionRecord.getStartDate(); @@ -150,19 +149,6 @@ public class TrackedActiveConnection extends RestrictedObject implements ActiveC return connection; } - /** - * Returns the connection ID of the in-progress connection as determined by - * guacd, not to be confused with the connection identifier determined by - * the database. This is the ID that must be supplied to guacd if joining - * this connection. - * - * @return - * The ID of the in-progress connection, as determined by guacd. - */ - public String getConnectionID() { - return connectionID; - } - @Override public String getConnectionIdentifier() { return connection.getIdentifier(); @@ -189,7 +175,7 @@ public class TrackedActiveConnection extends RestrictedObject implements ActiveC public UserCredentials getSharingCredentials(String identifier) throws GuacamoleException { return sharingService.generateTemporaryCredentials(getCurrentUser(), - this, identifier); + connectionRecord, identifier); } @Override diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/ConnectionSharingService.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/ConnectionSharingService.java index e05417a18..68dadb753 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/ConnectionSharingService.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/ConnectionSharingService.java @@ -25,9 +25,9 @@ import javax.servlet.http.HttpServletRequest; import org.apache.guacamole.auth.jdbc.user.AuthenticatedUser; import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.GuacamoleSecurityException; -import org.apache.guacamole.auth.jdbc.activeconnection.TrackedActiveConnection; import org.apache.guacamole.auth.jdbc.sharingprofile.ModeledSharingProfile; import org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileService; +import org.apache.guacamole.auth.jdbc.tunnel.ActiveConnectionRecord; import org.apache.guacamole.form.Field; import org.apache.guacamole.net.auth.AuthenticationProvider; import org.apache.guacamole.net.auth.Credentials; @@ -98,7 +98,7 @@ public class ConnectionSharingService { * If permission to share the given connection is denied. */ public UserCredentials generateTemporaryCredentials(AuthenticatedUser user, - TrackedActiveConnection activeConnection, + ActiveConnectionRecord activeConnection, String sharingProfileIdentifier) throws GuacamoleException { // Pull sharing profile (verifying access) diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/SharedConnectionDefinition.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/SharedConnectionDefinition.java index 7e7566bee..e971bffde 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/SharedConnectionDefinition.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/SharedConnectionDefinition.java @@ -19,8 +19,8 @@ package org.apache.guacamole.auth.jdbc.sharing; -import org.apache.guacamole.auth.jdbc.activeconnection.TrackedActiveConnection; import org.apache.guacamole.auth.jdbc.sharingprofile.ModeledSharingProfile; +import org.apache.guacamole.auth.jdbc.tunnel.ActiveConnectionRecord; /** * Defines the semantics/restrictions of a shared connection by associating an @@ -35,7 +35,7 @@ public class SharedConnectionDefinition { /** * The active connection being shared. */ - private final TrackedActiveConnection activeConnection; + private final ActiveConnectionRecord activeConnection; /** * The sharing profile which dictates the level of access provided to a user @@ -63,7 +63,7 @@ public class SharedConnectionDefinition { * @param shareKey * The unique key with which a user may access the shared connection. */ - public SharedConnectionDefinition(TrackedActiveConnection activeConnection, + public SharedConnectionDefinition(ActiveConnectionRecord activeConnection, ModeledSharingProfile sharingProfile, String shareKey) { this.activeConnection = activeConnection; this.sharingProfile = sharingProfile; @@ -71,13 +71,13 @@ public class SharedConnectionDefinition { } /** - * Returns the TrackedActiveConnection of the actual in-progress connection + * Returns the ActiveConnectionRecord of the actual in-progress connection * being shared. * * @return - * The TrackedActiveConnection being shared. + * The ActiveConnectionRecord being shared. */ - public TrackedActiveConnection getActiveConnection() { + public ActiveConnectionRecord getActiveConnection() { return activeConnection; } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/ActiveConnectionRecord.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/ActiveConnectionRecord.java index 16da6899b..2a3ea4f5b 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/ActiveConnectionRecord.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/ActiveConnectionRecord.java @@ -21,7 +21,6 @@ package org.apache.guacamole.auth.jdbc.tunnel; import java.util.Date; import java.util.UUID; -import org.apache.guacamole.auth.jdbc.activeconnection.TrackedActiveConnection; import org.apache.guacamole.auth.jdbc.connection.ModeledConnection; import org.apache.guacamole.auth.jdbc.connectiongroup.ModeledConnectionGroup; import org.apache.guacamole.auth.jdbc.sharingprofile.ModeledSharingProfile; @@ -184,7 +183,7 @@ public class ActiveConnectionRecord implements ConnectionRecord { * shared connection, this value may NOT be null. */ public ActiveConnectionRecord(RemoteAuthenticatedUser user, - TrackedActiveConnection activeConnection, + ActiveConnectionRecord activeConnection, ModeledSharingProfile sharingProfile) { this(user, null, activeConnection.getConnection(), sharingProfile); this.connectionID = activeConnection.getConnectionID();