|
|
@ -148,16 +148,25 @@ class RDPFileClientProtocolURLMixin:
|
|
|
|
if connect_method_dict is None:
|
|
|
|
if connect_method_dict is None:
|
|
|
|
raise ValueError('Connect method not support: {}'.format(connect_method_name))
|
|
|
|
raise ValueError('Connect method not support: {}'.format(connect_method_name))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
endpoint = self.get_smart_endpoint(
|
|
|
|
|
|
|
|
protocol=connect_method_dict['endpoint_protocol'],
|
|
|
|
|
|
|
|
asset=token.asset
|
|
|
|
|
|
|
|
)
|
|
|
|
data = {
|
|
|
|
data = {
|
|
|
|
'id': str(token.id),
|
|
|
|
'id': str(token.id),
|
|
|
|
'value': token.value,
|
|
|
|
'name': f'{endpoint.host}-{str(token.id)[:18]}',
|
|
|
|
'protocol': token.protocol,
|
|
|
|
'protocol': token.protocol,
|
|
|
|
|
|
|
|
'host': endpoint.host,
|
|
|
|
|
|
|
|
'port': endpoint.get_port(token.asset, token.protocol),
|
|
|
|
|
|
|
|
'username': f'JMS-{str(token.id)}',
|
|
|
|
|
|
|
|
'value': token.value,
|
|
|
|
'command': '',
|
|
|
|
'command': '',
|
|
|
|
'file': {}
|
|
|
|
'file': {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if connect_method_name == NativeClient.mstsc or connect_method_dict['type'] == 'applet':
|
|
|
|
if connect_method_name == NativeClient.mstsc or connect_method_dict['type'] == 'applet':
|
|
|
|
filename, content = self.get_rdp_file_info(token)
|
|
|
|
filename, content = self.get_rdp_file_info(token)
|
|
|
|
|
|
|
|
filename = urllib.parse.unquote(filename)
|
|
|
|
data.update({
|
|
|
|
data.update({
|
|
|
|
'protocol': 'rdp',
|
|
|
|
'protocol': 'rdp',
|
|
|
|
'file': {
|
|
|
|
'file': {
|
|
|
@ -166,10 +175,6 @@ class RDPFileClientProtocolURLMixin:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
endpoint = self.get_smart_endpoint(
|
|
|
|
|
|
|
|
protocol=connect_method_dict['endpoint_protocol'],
|
|
|
|
|
|
|
|
asset=token.asset
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
cmd = NativeClient.get_launch_command(connect_method_name, token, endpoint)
|
|
|
|
cmd = NativeClient.get_launch_command(connect_method_name, token, endpoint)
|
|
|
|
data.update({'command': cmd})
|
|
|
|
data.update({'command': cmd})
|
|
|
|
return data
|
|
|
|
return data
|
|
|
|