mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1616: Store HISTORY_UUID in tokens for use by other extensions.
This commit is contained in:
@@ -20,11 +20,13 @@
|
||||
package org.apache.guacamole.auth.jdbc;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.auth.jdbc.connection.ConnectionRecordMapper;
|
||||
import org.apache.guacamole.auth.jdbc.connection.ConnectionRecordModel;
|
||||
import org.apache.guacamole.auth.jdbc.connection.ModeledConnectionRecord;
|
||||
import org.apache.guacamole.net.GuacamoleTunnel;
|
||||
import org.apache.guacamole.net.auth.Connection;
|
||||
import org.apache.guacamole.net.auth.DelegatingConnection;
|
||||
@@ -98,6 +100,11 @@ public class HistoryTrackingConnection extends DelegatingConnection {
|
||||
// Insert the connection history record to mark the start of this connection
|
||||
connectionRecordMapper.insert(connectionRecordModel);
|
||||
|
||||
// Include history record UUID as token
|
||||
ModeledConnectionRecord modeledRecord = new ModeledConnectionRecord(connectionRecordModel);
|
||||
Map<String, String> updatedTokens = new HashMap<>(tokens);
|
||||
updatedTokens.put("HISTORY_UUID", modeledRecord.getUUID().toString());
|
||||
|
||||
// Connect, and wrap the tunnel for return
|
||||
GuacamoleTunnel tunnel = super.connect(info, tokens);
|
||||
return new HistoryTrackingTunnel(
|
||||
|
Reference in New Issue
Block a user