phirepass-widgets 0.0.79 → 0.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/phirepass-rdp.cjs.entry.js +308 -0
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +17 -17
- package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-widgets.cjs.js +1 -1
- package/dist/cjs/{protocol-DC4eLkqJ.js → protocol-DfRfif9I.js} +25 -26
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/common/protocol.js +1 -0
- package/dist/collection/components/{phirepass-vnc/phirepass-vnc.css → phirepass-rdp/phirepass-rdp.css} +9 -2
- package/dist/collection/components/{phirepass-vnc/phirepass-vnc.js → phirepass-rdp/phirepass-rdp.js} +198 -90
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +16 -16
- package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +1 -1
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/components/p-y9WE2vrP.js +1 -0
- package/dist/components/{phirepass-vnc.d.ts → phirepass-rdp.d.ts} +4 -4
- package/dist/components/phirepass-rdp.js +1 -0
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/phirepass-rdp.entry.js +306 -0
- package/dist/esm/phirepass-sftp-client.entry.js +17 -17
- package/dist/esm/phirepass-terminal.entry.js +2 -2
- package/dist/esm/phirepass-widgets.js +1 -1
- package/dist/esm/{protocol-BR2c80mW.js → protocol-y9WE2vrP.js} +24 -25
- package/dist/phirepass-widgets/p-3cc5c346.entry.js +1 -0
- package/dist/phirepass-widgets/{p-339cd54e.entry.js → p-53672ba5.entry.js} +1 -1
- package/dist/phirepass-widgets/{p-14c7611f.entry.js → p-a9c02bf1.entry.js} +2 -2
- package/dist/phirepass-widgets/p-y9WE2vrP.js +1 -0
- package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/common/protocol.d.ts +17 -1
- package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +90 -0
- package/dist/types/components.d.ts +136 -90
- package/package.json +4 -3
- package/dist/cjs/phirepass-vnc.cjs.entry.js +0 -336
- package/dist/collection/common/channel-socket.js +0 -89
- package/dist/components/p-BR2c80mW.js +0 -1
- package/dist/components/phirepass-vnc.js +0 -1
- package/dist/esm/phirepass-vnc.entry.js +0 -334
- package/dist/phirepass-widgets/p-19e2a30c.entry.js +0 -1
- package/dist/phirepass-widgets/p-BR2c80mW.js +0 -1
- package/dist/types/common/channel-socket.d.ts +0 -47
- package/dist/types/common/novnc.d.ts +0 -53
- package/dist/types/components/phirepass-vnc/phirepass-vnc.d.ts +0 -52
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]
|
|
9
|
+
return index.bootstrapLazy([["phirepass-rdp.cjs",[[513,"phirepass-rdp",{"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"username":[1],"password":[1],"destination":[1],"scale":[1],"serverId":[1,"server-id"],"credentialsPrompt":[32],"statusMessage":[32]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D-l8xaCI.js');
|
|
4
|
+
var protocol = require('./protocol-DfRfif9I.js');
|
|
5
|
+
|
|
6
|
+
const phirepassRdpCss = () => `:host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021}.screen{width:100%;height:100%}.screen iron-remote-desktop{display:block;width:100%;height:100%}.screen canvas{max-width:100%;display:block}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}`;
|
|
7
|
+
|
|
8
|
+
const PhirepassRdp = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
this.connectionStateChanged = index.createEvent(this, "connectionStateChanged");
|
|
12
|
+
}
|
|
13
|
+
channel;
|
|
14
|
+
containerEl;
|
|
15
|
+
ironEl;
|
|
16
|
+
userInteraction;
|
|
17
|
+
domReady = false;
|
|
18
|
+
runtimeReady = false;
|
|
19
|
+
connected = false;
|
|
20
|
+
session_id;
|
|
21
|
+
/** Credentials in force for this session, from props or from the prompt. */
|
|
22
|
+
credentials;
|
|
23
|
+
credentialsPrompt = false;
|
|
24
|
+
statusMessage;
|
|
25
|
+
usernameBuffer = '';
|
|
26
|
+
passwordBuffer = '';
|
|
27
|
+
get el() { return index.getElement(this); }
|
|
28
|
+
serverHost = "phirepass.com";
|
|
29
|
+
serverPort = 443;
|
|
30
|
+
allowInsecure = false;
|
|
31
|
+
heartbeatInterval = 30_000;
|
|
32
|
+
nodeId;
|
|
33
|
+
serviceId;
|
|
34
|
+
token;
|
|
35
|
+
/**
|
|
36
|
+
* Credentials for the remote host. When either is missing the widget
|
|
37
|
+
* prompts for both.
|
|
38
|
+
*
|
|
39
|
+
* They serve two purposes at once: the agent checks them before it
|
|
40
|
+
* authorises the tunnel, and the browser uses them for CredSSP. The agent
|
|
41
|
+
* never logs in with them — it discards them once the tunnel is authorised.
|
|
42
|
+
*/
|
|
43
|
+
username;
|
|
44
|
+
password;
|
|
45
|
+
/**
|
|
46
|
+
* What to name the host in the CredSSP service principal (`TERMSRV/...`).
|
|
47
|
+
*
|
|
48
|
+
* The agent dials whatever the node's service settings say, so this is
|
|
49
|
+
* never used for routing. It matters only because some hosts check the SPN,
|
|
50
|
+
* and the browser has no other way to learn the host's real address.
|
|
51
|
+
*/
|
|
52
|
+
destination;
|
|
53
|
+
/** `fit` scales the desktop to the widget, `real` keeps 1:1 pixels. */
|
|
54
|
+
scale = 'fit';
|
|
55
|
+
onNodeIdChange(newValue, _oldValue) {
|
|
56
|
+
this.reset_session_state();
|
|
57
|
+
if (this.channel && this.channel.is_connected()) {
|
|
58
|
+
this.close_comms();
|
|
59
|
+
}
|
|
60
|
+
if (newValue) {
|
|
61
|
+
this.open_comms();
|
|
62
|
+
this.channel.connect();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
serverId;
|
|
66
|
+
onServerIdChange(_newValue, _oldValue) {
|
|
67
|
+
this.onNodeIdChange(this.nodeId, this.nodeId);
|
|
68
|
+
}
|
|
69
|
+
connectionStateChanged;
|
|
70
|
+
create_web_socket_endpoint() {
|
|
71
|
+
const protocol = this.allowInsecure ? 'ws' : 'wss';
|
|
72
|
+
if (!this.allowInsecure && this.serverPort === 443) {
|
|
73
|
+
return `${protocol}://${this.serverHost}`;
|
|
74
|
+
}
|
|
75
|
+
if (this.allowInsecure && this.serverPort === 80) {
|
|
76
|
+
return `${protocol}://${this.serverHost}`;
|
|
77
|
+
}
|
|
78
|
+
return `${protocol}://${this.serverHost}:${this.serverPort}`;
|
|
79
|
+
}
|
|
80
|
+
async connectedCallback() {
|
|
81
|
+
await protocol.__wbg_init();
|
|
82
|
+
this.open_comms();
|
|
83
|
+
this.runtimeReady = true;
|
|
84
|
+
if (!this.nodeId) {
|
|
85
|
+
console.warn('Prop node_id is not set. Cannot connect to RDP.');
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
this.try_connect();
|
|
89
|
+
}
|
|
90
|
+
componentDidLoad() {
|
|
91
|
+
this.domReady = true;
|
|
92
|
+
this.try_connect();
|
|
93
|
+
}
|
|
94
|
+
async disconnectedCallback() {
|
|
95
|
+
this.connected = false;
|
|
96
|
+
this.domReady = false;
|
|
97
|
+
this.runtimeReady = false;
|
|
98
|
+
this.close_comms();
|
|
99
|
+
}
|
|
100
|
+
try_connect() {
|
|
101
|
+
if (this.connected || !this.domReady || !this.runtimeReady) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (!this.containerEl || !this.channel) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.connect();
|
|
108
|
+
}
|
|
109
|
+
connect() {
|
|
110
|
+
this.connected = true;
|
|
111
|
+
this.channel.connect();
|
|
112
|
+
}
|
|
113
|
+
open_comms() {
|
|
114
|
+
if (this.serverId) {
|
|
115
|
+
this.channel = new protocol.Channel(`${this.create_web_socket_endpoint()}/api/web/ws`, this.nodeId, this.serverId);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
this.channel = new protocol.Channel(`${this.create_web_socket_endpoint()}/api/web/ws`, this.nodeId);
|
|
119
|
+
}
|
|
120
|
+
this.channel.on_connection_open(() => {
|
|
121
|
+
this.connectionStateChanged.emit([protocol.ConnectionState.Connected]);
|
|
122
|
+
this.channel.authenticate(this.token, this.nodeId);
|
|
123
|
+
});
|
|
124
|
+
this.channel.on_connection_close(() => {
|
|
125
|
+
this.connectionStateChanged.emit([protocol.ConnectionState.Disconnected]);
|
|
126
|
+
this.teardown_client();
|
|
127
|
+
});
|
|
128
|
+
this.channel.on_connection_error((err) => {
|
|
129
|
+
this.connectionStateChanged.emit([protocol.ConnectionState.Error, err]);
|
|
130
|
+
});
|
|
131
|
+
this.channel.on_connection_message((_raw_) => {
|
|
132
|
+
// raw frames are handled by on_protocol_message below
|
|
133
|
+
});
|
|
134
|
+
this.channel.on_protocol_message((msg) => {
|
|
135
|
+
const { web } = msg.data;
|
|
136
|
+
switch (web.type) {
|
|
137
|
+
case protocol.ProtocolMessageType.Error:
|
|
138
|
+
this.handle_error(web);
|
|
139
|
+
break;
|
|
140
|
+
case protocol.ProtocolMessageType.AuthSuccess:
|
|
141
|
+
this.handle_auth_success(web);
|
|
142
|
+
break;
|
|
143
|
+
case protocol.ProtocolMessageType.RDPAuthorized:
|
|
144
|
+
this.handle_rdp_authorized(web);
|
|
145
|
+
break;
|
|
146
|
+
case protocol.ProtocolMessageType.TunnelClosed:
|
|
147
|
+
this.handle_tunnel_closed(web);
|
|
148
|
+
break;
|
|
149
|
+
default:
|
|
150
|
+
console.warn('Unknown protocol message type:', web);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
close_comms() {
|
|
155
|
+
this.teardown_client();
|
|
156
|
+
if (this.channel) {
|
|
157
|
+
this.channel.stop_heartbeat();
|
|
158
|
+
this.channel.disconnect();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
reset_session_state() {
|
|
162
|
+
this.session_id = undefined;
|
|
163
|
+
this.credentials = undefined;
|
|
164
|
+
this.credentialsPrompt = false;
|
|
165
|
+
this.usernameBuffer = '';
|
|
166
|
+
this.passwordBuffer = '';
|
|
167
|
+
this.statusMessage = undefined;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The channel stays open for the whole session even though no RDP byte ever
|
|
171
|
+
* travels over it: it is what keeps the tunnel registered server-side, and
|
|
172
|
+
* it is where `TunnelClosed` and `Error` arrive.
|
|
173
|
+
*/
|
|
174
|
+
handle_auth_success(_auth_) {
|
|
175
|
+
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
176
|
+
if (this.username && this.password) {
|
|
177
|
+
this.credentials = { username: this.username, password: this.password };
|
|
178
|
+
this.request_tunnel();
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
this.credentialsPrompt = true;
|
|
182
|
+
}
|
|
183
|
+
request_tunnel() {
|
|
184
|
+
if (!this.credentials) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
this.statusMessage = undefined;
|
|
188
|
+
this.channel.open_rdp_tunnel(this.nodeId, this.serviceId, this.credentials.username, this.credentials.password);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The tunnel is authorised but nothing has been dialled yet: the agent only
|
|
192
|
+
* reserves `sid`. Handing the ticket to the RDP client is what triggers the
|
|
193
|
+
* TCP + x224 + TLS hop, and the ticket expires 60s from now.
|
|
194
|
+
*/
|
|
195
|
+
async handle_rdp_authorized(web) {
|
|
196
|
+
this.session_id = web.sid;
|
|
197
|
+
this.statusMessage = 'Connecting…';
|
|
198
|
+
// Loaded on demand: the RDP client carries a multi-megabyte wasm
|
|
199
|
+
// payload that consumers embedding only the terminal or the SFTP client
|
|
200
|
+
// should never download.
|
|
201
|
+
const [backend] = await Promise.all([
|
|
202
|
+
import('@devolutions/iron-remote-desktop-rdp'),
|
|
203
|
+
// Registers the `iron-remote-desktop` element as a side effect.
|
|
204
|
+
import('@devolutions/iron-remote-desktop'),
|
|
205
|
+
]);
|
|
206
|
+
// The element may have gone away while the modules were loading.
|
|
207
|
+
if (!this.containerEl || this.session_id !== web.sid) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
await backend.init('info');
|
|
211
|
+
if (!this.containerEl || this.session_id !== web.sid) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
// Built imperatively rather than in `render()` so `module` is set
|
|
215
|
+
// before the element upgrades — it reads its backend on connect.
|
|
216
|
+
const element = document.createElement('iron-remote-desktop');
|
|
217
|
+
element.module = backend.Backend;
|
|
218
|
+
element.scale = this.scale;
|
|
219
|
+
element.flexcenter = true;
|
|
220
|
+
element.verbose = false;
|
|
221
|
+
element.addEventListener('ready', (event) => {
|
|
222
|
+
const detail = event.detail;
|
|
223
|
+
void this.start_session(detail.irgUserInteraction, web.ticket, backend.enableCredssp(true));
|
|
224
|
+
});
|
|
225
|
+
this.ironEl = element;
|
|
226
|
+
this.containerEl.appendChild(element);
|
|
227
|
+
}
|
|
228
|
+
async start_session(userInteraction, ticket, credssp) {
|
|
229
|
+
this.userInteraction = userInteraction;
|
|
230
|
+
const config = userInteraction
|
|
231
|
+
.configBuilder()
|
|
232
|
+
.withUsername(this.credentials?.username ?? '')
|
|
233
|
+
.withPassword(this.credentials?.password ?? '')
|
|
234
|
+
.withDestination(this.destination ?? this.nodeId)
|
|
235
|
+
.withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`)
|
|
236
|
+
.withAuthToken(ticket)
|
|
237
|
+
.withExtension(credssp)
|
|
238
|
+
.build();
|
|
239
|
+
try {
|
|
240
|
+
const session = await userInteraction.connect(config);
|
|
241
|
+
userInteraction.setVisibility(true);
|
|
242
|
+
this.statusMessage = undefined;
|
|
243
|
+
const termination = await session.run();
|
|
244
|
+
this.statusMessage = termination.reason();
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
const message = this.describe_error(err);
|
|
248
|
+
this.statusMessage = message;
|
|
249
|
+
this.connectionStateChanged.emit([protocol.ConnectionState.Error, err]);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/** IronRDP rejects with its own error shape rather than an `Error`. */
|
|
253
|
+
describe_error(err) {
|
|
254
|
+
const iron = err;
|
|
255
|
+
if (iron && typeof iron.backtrace === 'function') {
|
|
256
|
+
return iron.backtrace();
|
|
257
|
+
}
|
|
258
|
+
return err instanceof Error ? err.message : 'Connection failed.';
|
|
259
|
+
}
|
|
260
|
+
handle_tunnel_closed(_web_) {
|
|
261
|
+
this.session_id = undefined;
|
|
262
|
+
this.statusMessage = this.statusMessage ?? 'Connection closed.';
|
|
263
|
+
this.teardown_client();
|
|
264
|
+
this.close_comms();
|
|
265
|
+
}
|
|
266
|
+
handle_error(error) {
|
|
267
|
+
this.statusMessage = error.message;
|
|
268
|
+
this.connectionStateChanged.emit([protocol.ConnectionState.Error, error]);
|
|
269
|
+
}
|
|
270
|
+
teardown_client() {
|
|
271
|
+
if (this.userInteraction) {
|
|
272
|
+
try {
|
|
273
|
+
this.userInteraction.shutdown();
|
|
274
|
+
}
|
|
275
|
+
catch (err) {
|
|
276
|
+
console.warn('Failed to shut the RDP session down cleanly:', err);
|
|
277
|
+
}
|
|
278
|
+
this.userInteraction = undefined;
|
|
279
|
+
}
|
|
280
|
+
this.ironEl?.remove();
|
|
281
|
+
this.ironEl = undefined;
|
|
282
|
+
this.credentialsPrompt = false;
|
|
283
|
+
this.usernameBuffer = '';
|
|
284
|
+
this.passwordBuffer = '';
|
|
285
|
+
}
|
|
286
|
+
submit_credentials(event) {
|
|
287
|
+
event.preventDefault();
|
|
288
|
+
this.credentialsPrompt = false;
|
|
289
|
+
this.credentials = { username: this.usernameBuffer, password: this.passwordBuffer };
|
|
290
|
+
this.usernameBuffer = '';
|
|
291
|
+
this.passwordBuffer = '';
|
|
292
|
+
this.request_tunnel();
|
|
293
|
+
}
|
|
294
|
+
render() {
|
|
295
|
+
return (index.h(index.Host, { key: '97b198af30e4e4b7ae8cbd0d497dc4f4812615f8' }, index.h("div", { key: 'f7d01492909a0f3cb6c639345eb70a8e1fbf1b90', class: "screen", ref: (el) => (this.containerEl = el) }), this.credentialsPrompt && (index.h("form", { key: '1dcfeaa956999dc882943e0d0b49ead8d12840bc', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, index.h("label", { key: 'a62e96bfb6b947167f731020c7ab00a1d9a82652', htmlFor: "rdp-username" }, "Windows username"), index.h("input", { key: '3135d24b62b2b612a11d3cbfd2c19f3cf381e74b', id: "rdp-username", type: "text", autocomplete: "username", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), index.h("label", { key: 'd8b901e0fe81de30e6426f80179d5e8da542effc', htmlFor: "rdp-password" }, "Password"), index.h("input", { key: '0bfad07c7f5355a8693856b1e6b51df59944a339', id: "rdp-password", type: "password", autocomplete: "current-password", onInput: (event) => (this.passwordBuffer = event.target.value) }), index.h("button", { key: 'e1cbab525870c34fe85299a8ce883d7069cb4bb8', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (index.h("div", { key: '4144cff9e5d6fb637655203bf67a13adaa7feede', class: "status" }, this.statusMessage))));
|
|
296
|
+
}
|
|
297
|
+
static get watchers() { return {
|
|
298
|
+
"nodeId": [{
|
|
299
|
+
"onNodeIdChange": 0
|
|
300
|
+
}],
|
|
301
|
+
"serverId": [{
|
|
302
|
+
"onServerIdChange": 0
|
|
303
|
+
}]
|
|
304
|
+
}; }
|
|
305
|
+
};
|
|
306
|
+
PhirepassRdp.style = phirepassRdpCss();
|
|
307
|
+
|
|
308
|
+
exports.phirepass_rdp = PhirepassRdp;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-D-l8xaCI.js');
|
|
4
|
-
var protocol = require('./protocol-
|
|
4
|
+
var protocol = require('./protocol-DfRfif9I.js');
|
|
5
5
|
|
|
6
6
|
const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
7
7
|
|
|
@@ -926,18 +926,18 @@ const PhirepassSftpClient = class {
|
|
|
926
926
|
return `${typeChar}${chars.join('')}`;
|
|
927
927
|
}
|
|
928
928
|
render() {
|
|
929
|
-
return (index.h(index.Host, { key: '
|
|
929
|
+
return (index.h(index.Host, { key: '682152b79b8d22bd7c81299225fb9d1bb0da72db', class: {
|
|
930
930
|
'default': !this.max,
|
|
931
931
|
'max': this.max,
|
|
932
|
-
} }, index.h("section", { key: '
|
|
933
|
-
index.h("header", { key: '
|
|
932
|
+
} }, index.h("section", { key: '5be263e7b380fc61ab70856c6650b5dfb0901795', class: "listing" }, !this.hideHeader &&
|
|
933
|
+
index.h("header", { key: 'fee0627ccb716ef560e8723496087e1b565f759f' }, index.h("section", { key: 'b112ebbe9ff73bc80ce84bb47e50769ae45a4ce2', class: "title" }, index.h("img", { key: '3a0ec7d30cf4cab69ec5f2e236b8e162ea4c2ce5', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), index.h("div", { key: '433b5063ca30b4cc04544ff6ef29d94e9dc0a703', class: "text" }, index.h("div", { key: 'dd354e0b38c4e3d8cc5f9588bbeb2cbb32d476fc', class: "name" }, this.name), index.h("div", { key: '523829c5a164d755211bc35caf8fdeb44ca8a15e', class: "description" }, this.description))), index.h("section", { key: '9dd9e2c1f7e43c72d284a67332320f736a81a809', class: "actions" }, index.h("div", { key: '40a2744abdfadf699cd631684e083ec0dc829a7d', class: "action", onClick: () => this.toggle_max() }, index.h("img", { key: '3ad551f84dbf56da3d47bd0045748a94c285bc72', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), index.h("main", { key: '770b9372cdb761efb233f73d70afb83f5d5d2c01' }, this.show_navigation && index.h("nav", { key: 'b9c318e991b2523497e1c6e1cc55d540215fa848', class: "navigation" }, index.h("div", { key: '9f9e8e06ba65e47979980fc52cdcc73ae494df24', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index$1, breadcrumbs) => (index.h("span", { key: index$1, class: "breadcrumb-container" }, index.h("span", { key: index$1, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index$1 < breadcrumbs.length - 1 && index.h("img", { class: "arrow", src: phirepassSftpClientChevronSvg }))))), index.h("section", { key: '21eda2e694e98f40b40e0421c333e8fa582731ff', class: "actions", "aria-label": "SFTP actions" }, index.h("button", { key: 'e74fdf11191b0d80ba286c4d6a7f613bd7c9d5bb', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, index.h("img", { key: '2785ac1d0ae7c33123fb924ad030efc4d5e03da0', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), index.h("button", { key: '08b3880df69db41a7bad0278971308e5bbdb5813', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, index.h("img", { key: '2b00f26ae3b5fc3a923b337a7f2a0a6e641874fa', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), index.h("button", { key: '4b05f7d304f5a89642dccfa499ab1421890d67c8', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, index.h("img", { key: 'a95624e723f28b04ab277b82650a2334bd2aa679', src: phirepassSftpClientUploadSvg, alt: "Upload" })), index.h("button", { key: '3277414b28f178d1ba3d6f147ed79bc951a5df29', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), index.h("input", { key: '5c248ba2c5c001aa2e0196f41f278f70412b5c1b', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && index.h("div", { key: 'afff360eecca86b4c66a799e8938108a310ccbab', class: "content" }, index.h("table", { key: '31e9223fab1a5d6a3f797b44efbd6f735551757a' }, index.h("thead", { key: '16662bfc34dc06207c7d131f067ac257c27c4ed0' }, index.h("tr", { key: '8a6d2344ae8c71c6ef99fd7c19acf508d1b887d2' }, index.h("th", { key: 'f7f8759feb03389fe61b1d63394c8557c3d0b209' }, "Name"), index.h("th", { key: '1342f11d5132c84447f32099661d08723eb62ef7' }, "Size"), index.h("th", { key: '7e041ba0b6515d8c734ebddd418f17173f9361f1' }, "Permissions"), index.h("th", { key: '05921d3c7bf7e4dd320d1116f451730346a0a148' }, "Owner"), index.h("th", { key: '0e7b65094f59b7219f2ef4e9ac1ba87969c6078e' }, "Modified"), index.h("th", { key: '261be85a5ccbce865b09d0cf8276df408af49e14', class: "action-col", "aria-label": "Actions" }))), index.h("tbody", { key: '04043d8e6d3151d5d1dcf72b67208967dfcd9dfd' }, this.listing.map((item, index$1) => (index.h("tr", { key: index$1, class: {
|
|
934
934
|
'selected': this.is_selected(item),
|
|
935
935
|
}, onClick: () => this.list_directory(item) }, index.h("td", null, item.kind === 'Folder' ? index.h("img", { class: "kind", src: phirepassSftpClientFolderSvg, alt: "Folder" }) : index.h("img", { class: "kind", src: phirepassSftpClientFileSvg, alt: "File" }), index.h("span", { class: `name ${item.kind.toLowerCase()}` }, item.name)), index.h("td", null, this.format_size(item.attributes.size)), index.h("td", null, this.format_permissions(item.attributes.permissions, item.kind)), index.h("td", null, item.attributes.user ?? '-'), index.h("td", null, new Date(item.attributes.modified * 1000).toLocaleString()), index.h("td", { class: "action-col" }, item.kind === 'File' &&
|
|
936
|
-
index.h("div", { class: "file-actions" }, index.h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), index.h("polyline", { points: "7 10 12 15 17 10" }), index.h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), index.h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("polyline", { points: "3 6 5 6 21 6" }), index.h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), index.h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), index.h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), index.h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && index.h("div", { key: '
|
|
937
|
-
index.h("section", { key: '
|
|
936
|
+
index.h("div", { class: "file-actions" }, index.h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), index.h("polyline", { points: "7 10 12 15 17 10" }), index.h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), index.h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("polyline", { points: "3 6 5 6 21 6" }), index.h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), index.h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), index.h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), index.h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && index.h("div", { key: 'a69008f418c1d9afa2e980ada402a80382ea7fec', class: "loader" }, "Loading..."), this.show_error && index.h("div", { key: '29875e65941130d5fe0f842ebec0685f69769ecf', class: "error" }, this.error_message)), index.h("footer", { key: '6dc5eff60f9b6acedff8996aa688b450dcaa2eeb' }, index.h("section", { key: 'cf1dadc5e03c3480b5c3d7c7fe0547ec087d1ce9', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
|
|
937
|
+
index.h("section", { key: '0d8b86d8b48fee55504f65f3938fa81b59f8b18f', class: {
|
|
938
938
|
'creds': true,
|
|
939
939
|
'blurred': this.show_login_screen,
|
|
940
|
-
} }, index.h("form", { key: '
|
|
940
|
+
} }, index.h("form", { key: 'a5e8c4a877b696edad3b4808c2d325c78d1ff169', class: "auth", onSubmit: (event) => {
|
|
941
941
|
const formData = new FormData(event.target);
|
|
942
942
|
let username = undefined;
|
|
943
943
|
if (this.show_login_screen_username) {
|
|
@@ -954,28 +954,28 @@ const PhirepassSftpClient = class {
|
|
|
954
954
|
this.show_loader = true;
|
|
955
955
|
event.stopPropagation();
|
|
956
956
|
event.preventDefault();
|
|
957
|
-
} }, index.h("div", { key: '
|
|
958
|
-
index.h("div", { key: '
|
|
959
|
-
index.h("div", { key: '
|
|
960
|
-
index.h("section", { key: '
|
|
957
|
+
} }, index.h("div", { key: '1d2790cefa333a230e01b564673d8d1ce76942ca', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
958
|
+
index.h("div", { key: 'a2a43e259b11a526cf288dd2ae49c532440d33b4' }, index.h("label", { key: '95165a92cb5246188fedce9ba20b0f670bd877e5', htmlFor: "username" }, "Username"), index.h("input", { key: 'ccf925451b36456f24cdbc13fac1b8575a23a804', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
959
|
+
index.h("div", { key: '2a3c49b4f0b2a34b6585ef1cf9a4baa52ef7970c' }, index.h("label", { key: '4c581797a2d16396a1cf1ab2c65cb5a23572f876', htmlFor: "password" }, "Password"), index.h("input", { key: '757fa564b1097339c84259e1615f03e0511990a5', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), index.h("div", { key: '219ed5d8d9c13ec4c0e47218170528e8ae0e9b81' }, index.h("button", { key: 'ea52ade9fef73f167246c437f37e5ee44d8aa881', type: "submit" }, "Connect")))), this.show_upload_modal &&
|
|
960
|
+
index.h("section", { key: '91be9acc6c829b65a2cb602884a98add1847b915', class: {
|
|
961
961
|
'upload-modal': true,
|
|
962
962
|
'visible': this.show_upload_modal,
|
|
963
|
-
} }, index.h("div", { key: '
|
|
963
|
+
} }, index.h("div", { key: '526462f6a166512cbcaeca9acdf02c7352abf720', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, index.h("div", { key: '1093b566e4103d84c0537ad0a4eee820dff77d5e', class: "title" }, "Uploading File"), index.h("div", { key: '1f2c1fcaa97653693162073267db16363f578a5e', class: "file-name", title: this.upload_file_name }, this.upload_file_name), index.h("div", { key: 'c1ee1c778fda4336c462adce90bf194a021af91f', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, index.h("div", { key: 'ab1a29dc9134eb917e34df41b38e0b936cd7a1dd', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), index.h("div", { key: 'a84c897deec8cf324c3a29667989b8aaa3540266', class: "progress-meta" }, index.h("div", { key: '66447fa44ae2cb5995b3fc08c1411aaffd65102a', class: "progress-speed" }, this.upload_speed), index.h("div", { key: '66d5b6b40e67af836ff61955d46c63033a663305', class: "progress-value" }, this.format_percent(this.upload_progress))), index.h("button", { key: '1ea99f4cbd0ab4a9972180029865fc99975511fd', type: "button", class: {
|
|
964
964
|
'cancel': true,
|
|
965
965
|
'finished': this.upload_finished,
|
|
966
966
|
}, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
|
|
967
|
-
index.h("section", { key: '
|
|
967
|
+
index.h("section", { key: '0da9656501ff93d682a48a8ae58a72555aa6b713', class: {
|
|
968
968
|
'download-modal': true,
|
|
969
969
|
'visible': this.show_download_modal,
|
|
970
|
-
} }, index.h("div", { key: '
|
|
970
|
+
} }, index.h("div", { key: '17d3737bd24412e7bd6d35bfb97f53bb5849bb53', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, index.h("div", { key: '991c82ce3f4fb403f0f308a66a93763df7c840d4', class: "title" }, "Downloading File"), index.h("div", { key: '0988219f6118e701570a4829e15f1547dd5df3fd', class: "file-name", title: this.download_file_name }, this.download_file_name), index.h("div", { key: 'afb70a6f0b2215975e21db7258aec3b7cabbbbde', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, index.h("div", { key: '4223ef43e1b92db4d9b0af4583f545239f8161ca', class: "progress-fill", style: { width: `${this.download_progress}%` } })), index.h("div", { key: 'e2fbb4ffe05614e3876e4d5ea7d93f677356f43f', class: "progress-meta" }, index.h("div", { key: 'b20cdf67680d6ecc7590455700506160e0c85cb9', class: "progress-speed" }, this.download_speed), index.h("div", { key: '7d174465abaf4f384cba6bfa3a5c10adbcc917b7', class: "progress-value" }, this.format_percent(this.download_progress))), index.h("button", { key: 'ce0c262e02e9295223308c962e923acff8027561', type: "button", class: {
|
|
971
971
|
'cancel': true,
|
|
972
972
|
'finished': this.download_finished,
|
|
973
973
|
}, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
|
|
974
|
-
index.h("section", { key: '
|
|
974
|
+
index.h("section", { key: '7adae3f5add735aad8ca7e53e4e4c423ad651b93', class: {
|
|
975
975
|
'delete-modal': true,
|
|
976
976
|
'visible': this.show_delete_modal,
|
|
977
|
-
} }, index.h("div", { key: '
|
|
978
|
-
index.h("div", { key: '
|
|
977
|
+
} }, index.h("div", { key: '3c7bad705431130db785a5ea0589b046ee031a70', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, index.h("div", { key: '0f1136b5fd29bb9708bbaed48d0ac1e5d19ee942', class: "title" }, "Delete File"), index.h("div", { key: 'f32cea38c0fdcbba6753598c2bca19fc1907b44b', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), index.h("div", { key: '2c11182160f49406cdf8573d107e5e9cd7690e4c', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
|
|
978
|
+
index.h("div", { key: 'bb3e1fbafffce7ea4a1c1e43b32219973b220848', class: "delete-loader", "aria-hidden": "true" }, index.h("span", { key: '3521881d7325c02ca6624d1f09bc5e4ab05ecdbd', class: "spinner" })), index.h("div", { key: 'da492d943dbc6a88f58652c1590eb4095cecc833', class: "modal-actions" }, index.h("button", { key: '136255109de5cd76b8d3067605f1b2214122272d', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), index.h("button", { key: '750c19696695c581b08b466f19c07947b637b8bf', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
|
|
979
979
|
}
|
|
980
980
|
static get watchers() { return {
|
|
981
981
|
"nodeId": [{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-D-l8xaCI.js');
|
|
4
|
-
var protocol = require('./protocol-
|
|
4
|
+
var protocol = require('./protocol-DfRfif9I.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
@@ -695,7 +695,7 @@ const PhirepassTerminal = class {
|
|
|
695
695
|
this.usernameBuffer = "";
|
|
696
696
|
}
|
|
697
697
|
render() {
|
|
698
|
-
return (index.h(index.Host, { key: '
|
|
698
|
+
return (index.h(index.Host, { key: '502a46c25541e7b9eea5b716f3806f6045b19049' }, index.h("div", { key: 'fae18cfb592bcc346e9203f2491fc661bd7bff5a', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
699
699
|
}
|
|
700
700
|
static get watchers() { return {
|
|
701
701
|
"nodeId": [{
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]
|
|
22
|
+
return index.bootstrapLazy([["phirepass-rdp.cjs",[[513,"phirepass-rdp",{"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"username":[1],"password":[1],"destination":[1],"scale":[1],"serverId":[1,"server-id"],"credentialsPrompt":[32],"statusMessage":[32]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -146,13 +146,22 @@ class Channel {
|
|
|
146
146
|
wasm.channel_on_protocol_message_type(this.__wbg_ptr, ptr0, len0, isLikeNone(cb) ? 0 : addHeapObject(cb));
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
+
* Requests an RDP tunnel. Credentials are validated by the agent but are
|
|
150
|
+
* not used to log in: CredSSP runs in the browser's own RDP client, inside
|
|
151
|
+
* the tunnel.
|
|
152
|
+
*
|
|
153
|
+
* Unlike the other protocols this does **not** yield a `TunnelOpened`.
|
|
154
|
+
* The answer is an `RDPAuthorized` frame carrying a `sid` and a single-use
|
|
155
|
+
* `ticket`; the RDP client then opens its own socket at
|
|
156
|
+
* `/api/web/rdp/{node_id}` and presents that ticket in its RDCleanPath
|
|
157
|
+
* request. No tunnel data for an RDP session ever crosses *this* channel.
|
|
149
158
|
* @param {string} node_id
|
|
150
159
|
* @param {string} service_id
|
|
151
160
|
* @param {string | null} [username]
|
|
152
161
|
* @param {string | null} [password]
|
|
153
162
|
* @param {number | null} [msg_id]
|
|
154
163
|
*/
|
|
155
|
-
|
|
164
|
+
open_rdp_tunnel(node_id, service_id, username, password, msg_id) {
|
|
156
165
|
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
157
166
|
const len0 = WASM_VECTOR_LEN;
|
|
158
167
|
const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -161,7 +170,7 @@ class Channel {
|
|
|
161
170
|
var len2 = WASM_VECTOR_LEN;
|
|
162
171
|
var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
163
172
|
var len3 = WASM_VECTOR_LEN;
|
|
164
|
-
wasm.
|
|
173
|
+
wasm.channel_open_rdp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
165
174
|
}
|
|
166
175
|
/**
|
|
167
176
|
* @param {string} node_id
|
|
@@ -170,7 +179,7 @@ class Channel {
|
|
|
170
179
|
* @param {string | null} [password]
|
|
171
180
|
* @param {number | null} [msg_id]
|
|
172
181
|
*/
|
|
173
|
-
|
|
182
|
+
open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
|
|
174
183
|
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
175
184
|
const len0 = WASM_VECTOR_LEN;
|
|
176
185
|
const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -179,21 +188,25 @@ class Channel {
|
|
|
179
188
|
var len2 = WASM_VECTOR_LEN;
|
|
180
189
|
var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
181
190
|
var len3 = WASM_VECTOR_LEN;
|
|
182
|
-
wasm.
|
|
191
|
+
wasm.channel_open_sftp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
183
192
|
}
|
|
184
193
|
/**
|
|
185
|
-
* VNC takes no credentials: the RFB password challenge is answered by the
|
|
186
|
-
* browser's VNC client inside the tunnel itself.
|
|
187
194
|
* @param {string} node_id
|
|
188
195
|
* @param {string} service_id
|
|
196
|
+
* @param {string | null} [username]
|
|
197
|
+
* @param {string | null} [password]
|
|
189
198
|
* @param {number | null} [msg_id]
|
|
190
199
|
*/
|
|
191
|
-
|
|
200
|
+
open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
|
|
192
201
|
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
193
202
|
const len0 = WASM_VECTOR_LEN;
|
|
194
203
|
const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
195
204
|
const len1 = WASM_VECTOR_LEN;
|
|
196
|
-
|
|
205
|
+
var ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
206
|
+
var len2 = WASM_VECTOR_LEN;
|
|
207
|
+
var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
208
|
+
var len3 = WASM_VECTOR_LEN;
|
|
209
|
+
wasm.channel_open_ssh_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
197
210
|
}
|
|
198
211
|
/**
|
|
199
212
|
* @param {string} node_id
|
|
@@ -325,21 +338,6 @@ class Channel {
|
|
|
325
338
|
const len1 = WASM_VECTOR_LEN;
|
|
326
339
|
wasm.channel_send_ssh_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
|
|
327
340
|
}
|
|
328
|
-
/**
|
|
329
|
-
* Takes bytes rather than a string (unlike [`Channel::send_ssh_tunnel_data`]):
|
|
330
|
-
* RFB client messages are binary and would not survive a UTF-8 round trip.
|
|
331
|
-
* `Vec<u8>` arrives from JS as a `Uint8Array` with no re-encoding.
|
|
332
|
-
* @param {string} node_id
|
|
333
|
-
* @param {number} sid
|
|
334
|
-
* @param {Uint8Array} data
|
|
335
|
-
*/
|
|
336
|
-
send_vnc_tunnel_data(node_id, sid, data) {
|
|
337
|
-
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
338
|
-
const len0 = WASM_VECTOR_LEN;
|
|
339
|
-
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
340
|
-
const len1 = WASM_VECTOR_LEN;
|
|
341
|
-
wasm.channel_send_vnc_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
|
|
342
|
-
}
|
|
343
341
|
/**
|
|
344
342
|
* @param {number} interval_as_millis
|
|
345
343
|
*/
|
|
@@ -465,7 +463,7 @@ function __wbg_get_imports() {
|
|
|
465
463
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
466
464
|
return addHeapObject(ret);
|
|
467
465
|
}, arguments); },
|
|
468
|
-
|
|
466
|
+
__wbg_info_9b9ea1f18c57361f: function(arg0, arg1) {
|
|
469
467
|
console.info(getStringFromWasm0(arg0, arg1));
|
|
470
468
|
},
|
|
471
469
|
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
@@ -537,7 +535,7 @@ function __wbg_get_imports() {
|
|
|
537
535
|
__wbg_set_onopen_4f65470ae522a61a: function(arg0, arg1) {
|
|
538
536
|
getObject(arg0).onopen = getObject(arg1);
|
|
539
537
|
},
|
|
540
|
-
|
|
538
|
+
__wbg_warn_79b294b9866d9034: function(arg0, arg1) {
|
|
541
539
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
542
540
|
},
|
|
543
541
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
@@ -907,7 +905,7 @@ async function __wbg_init(module_or_path) {
|
|
|
907
905
|
}
|
|
908
906
|
|
|
909
907
|
if (module_or_path === undefined) {
|
|
910
|
-
module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-
|
|
908
|
+
module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-DfRfif9I.js', document.baseURI).href)));
|
|
911
909
|
}
|
|
912
910
|
const imports = __wbg_get_imports();
|
|
913
911
|
|
|
@@ -927,6 +925,7 @@ exports.ProtocolMessageType = void 0;
|
|
|
927
925
|
ProtocolMessageType["TunnelOpened"] = "TunnelOpened";
|
|
928
926
|
ProtocolMessageType["TunnelClosed"] = "TunnelClosed";
|
|
929
927
|
ProtocolMessageType["TunnelData"] = "TunnelData";
|
|
928
|
+
ProtocolMessageType["RDPAuthorized"] = "RDPAuthorized";
|
|
930
929
|
ProtocolMessageType["SFTPListItems"] = "SFTPListItems";
|
|
931
930
|
ProtocolMessageType["SFTPDownloadStartResponse"] = "SFTPDownloadStartResponse";
|
|
932
931
|
ProtocolMessageType["SFTPDownloadChunk"] = "SFTPDownloadChunk";
|