phirepass-channel 0.1.295 → 0.1.296

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "phirepass-channel",
3
3
  "type": "module",
4
- "version": "0.1.295",
4
+ "version": "0.1.296",
5
5
  "license": "SEE LICENSE IN ../LICENCE",
6
6
  "repository": {
7
7
  "type": "git",
@@ -18,13 +18,20 @@ export class Channel {
18
18
  on_connection_open(cb?: Function | null): void;
19
19
  on_protocol_message(cb?: Function | null): void;
20
20
  on_protocol_message_type(frame_type: string, cb?: Function | null): void;
21
- open_sftp_tunnel(node_id: string, service_id: string, username?: string | null, password?: string | null, msg_id?: number | null): void;
22
- open_ssh_tunnel(node_id: string, service_id: string, username?: string | null, password?: string | null, msg_id?: number | null): void;
23
21
  /**
24
- * VNC takes no credentials: the RFB password challenge is answered by the
25
- * browser's VNC client inside the tunnel itself.
22
+ * Requests an RDP tunnel. Credentials are validated by the agent but are
23
+ * not used to log in: CredSSP runs in the browser's own RDP client, inside
24
+ * the tunnel.
25
+ *
26
+ * Unlike the other protocols this does **not** yield a `TunnelOpened`.
27
+ * The answer is an `RDPAuthorized` frame carrying a `sid` and a single-use
28
+ * `ticket`; the RDP client then opens its own socket at
29
+ * `/api/web/rdp/{node_id}` and presents that ticket in its RDCleanPath
30
+ * request. No tunnel data for an RDP session ever crosses *this* channel.
26
31
  */
27
- open_vnc_tunnel(node_id: string, service_id: string, msg_id?: number | null): void;
32
+ open_rdp_tunnel(node_id: string, service_id: string, username?: string | null, password?: string | null, msg_id?: number | null): void;
33
+ open_sftp_tunnel(node_id: string, service_id: string, username?: string | null, password?: string | null, msg_id?: number | null): void;
34
+ open_ssh_tunnel(node_id: string, service_id: string, username?: string | null, password?: string | null, msg_id?: number | null): void;
28
35
  send_sftp_delete(node_id: string, sid: number, path: string, filename: string, msg_id?: number | null): void;
29
36
  /**
30
37
  * Send a pipelining ACK to the agent: acknowledges all chunks with index ≤ ack_up_to
@@ -39,12 +46,6 @@ export class Channel {
39
46
  send_sftp_upload_start(node_id: string, sid: number, filename: string, remote_path: string, total_chunks: number, total_size: bigint, msg_id?: number | null): void;
40
47
  send_ssh_terminal_resize(node_id: string, sid: number, cols: number, rows: number, px_width: number, px_height: number): void;
41
48
  send_ssh_tunnel_data(node_id: string, sid: number, data: string): void;
42
- /**
43
- * Takes bytes rather than a string (unlike [`Channel::send_ssh_tunnel_data`]):
44
- * RFB client messages are binary and would not survive a UTF-8 round trip.
45
- * `Vec<u8>` arrives from JS as a `Uint8Array` with no re-encoding.
46
- */
47
- send_vnc_tunnel_data(node_id: string, sid: number, data: Uint8Array): void;
48
49
  start_heartbeat(interval_as_millis: number): void;
49
50
  stop_heartbeat(): void;
50
51
  update_service(node_id: string, service_id: string, kind: string, name: string | null | undefined, host: string, port: number, username?: string | null, password?: string | null, visibility?: string | null, scheme?: string | null, msg_id?: number | null): void;
@@ -61,7 +62,7 @@ export enum ErrorType {
61
62
  export enum Protocol {
62
63
  SSH = 0,
63
64
  SFTP = 1,
64
- VNC = 2,
65
+ RDP = 2,
65
66
  }
66
67
 
67
68
  export function version(): string;
@@ -85,9 +86,9 @@ export interface InitOutput {
85
86
  readonly channel_on_connection_open: (a: number, b: number) => void;
86
87
  readonly channel_on_protocol_message: (a: number, b: number) => void;
87
88
  readonly channel_on_protocol_message_type: (a: number, b: number, c: number, d: number) => void;
89
+ readonly channel_open_rdp_tunnel: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
88
90
  readonly channel_open_sftp_tunnel: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
89
91
  readonly channel_open_ssh_tunnel: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
90
- readonly channel_open_vnc_tunnel: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
91
92
  readonly channel_send_sftp_delete: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
92
93
  readonly channel_send_sftp_download_ack: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
93
94
  readonly channel_send_sftp_download_chunk: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
@@ -97,7 +98,6 @@ export interface InitOutput {
97
98
  readonly channel_send_sftp_upload_start: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: bigint, k: number) => void;
98
99
  readonly channel_send_ssh_terminal_resize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
99
100
  readonly channel_send_ssh_tunnel_data: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
100
- readonly channel_send_vnc_tunnel_data: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
101
101
  readonly channel_start_heartbeat: (a: number, b: number) => void;
102
102
  readonly channel_stop_heartbeat: (a: number) => void;
103
103
  readonly channel_update_service: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number) => void;
@@ -143,13 +143,22 @@ export class Channel {
143
143
  wasm.channel_on_protocol_message_type(this.__wbg_ptr, ptr0, len0, isLikeNone(cb) ? 0 : addHeapObject(cb));
144
144
  }
145
145
  /**
146
+ * Requests an RDP tunnel. Credentials are validated by the agent but are
147
+ * not used to log in: CredSSP runs in the browser's own RDP client, inside
148
+ * the tunnel.
149
+ *
150
+ * Unlike the other protocols this does **not** yield a `TunnelOpened`.
151
+ * The answer is an `RDPAuthorized` frame carrying a `sid` and a single-use
152
+ * `ticket`; the RDP client then opens its own socket at
153
+ * `/api/web/rdp/{node_id}` and presents that ticket in its RDCleanPath
154
+ * request. No tunnel data for an RDP session ever crosses *this* channel.
146
155
  * @param {string} node_id
147
156
  * @param {string} service_id
148
157
  * @param {string | null} [username]
149
158
  * @param {string | null} [password]
150
159
  * @param {number | null} [msg_id]
151
160
  */
152
- open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
161
+ open_rdp_tunnel(node_id, service_id, username, password, msg_id) {
153
162
  const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
154
163
  const len0 = WASM_VECTOR_LEN;
155
164
  const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -158,7 +167,7 @@ export class Channel {
158
167
  var len2 = WASM_VECTOR_LEN;
159
168
  var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
160
169
  var len3 = WASM_VECTOR_LEN;
161
- 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);
170
+ 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);
162
171
  }
163
172
  /**
164
173
  * @param {string} node_id
@@ -167,7 +176,7 @@ export class Channel {
167
176
  * @param {string | null} [password]
168
177
  * @param {number | null} [msg_id]
169
178
  */
170
- open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
179
+ open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
171
180
  const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
172
181
  const len0 = WASM_VECTOR_LEN;
173
182
  const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -176,21 +185,25 @@ export class Channel {
176
185
  var len2 = WASM_VECTOR_LEN;
177
186
  var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
178
187
  var len3 = WASM_VECTOR_LEN;
179
- 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);
188
+ 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);
180
189
  }
181
190
  /**
182
- * VNC takes no credentials: the RFB password challenge is answered by the
183
- * browser's VNC client inside the tunnel itself.
184
191
  * @param {string} node_id
185
192
  * @param {string} service_id
193
+ * @param {string | null} [username]
194
+ * @param {string | null} [password]
186
195
  * @param {number | null} [msg_id]
187
196
  */
188
- open_vnc_tunnel(node_id, service_id, msg_id) {
197
+ open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
189
198
  const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
190
199
  const len0 = WASM_VECTOR_LEN;
191
200
  const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
192
201
  const len1 = WASM_VECTOR_LEN;
193
- wasm.channel_open_vnc_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
202
+ var ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
203
+ var len2 = WASM_VECTOR_LEN;
204
+ var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
205
+ var len3 = WASM_VECTOR_LEN;
206
+ 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);
194
207
  }
195
208
  /**
196
209
  * @param {string} node_id
@@ -322,21 +335,6 @@ export class Channel {
322
335
  const len1 = WASM_VECTOR_LEN;
323
336
  wasm.channel_send_ssh_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
324
337
  }
325
- /**
326
- * Takes bytes rather than a string (unlike [`Channel::send_ssh_tunnel_data`]):
327
- * RFB client messages are binary and would not survive a UTF-8 round trip.
328
- * `Vec<u8>` arrives from JS as a `Uint8Array` with no re-encoding.
329
- * @param {string} node_id
330
- * @param {number} sid
331
- * @param {Uint8Array} data
332
- */
333
- send_vnc_tunnel_data(node_id, sid, data) {
334
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
335
- const len0 = WASM_VECTOR_LEN;
336
- const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
337
- const len1 = WASM_VECTOR_LEN;
338
- wasm.channel_send_vnc_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
339
- }
340
338
  /**
341
339
  * @param {number} interval_as_millis
342
340
  */
@@ -400,7 +398,7 @@ export const ErrorType = Object.freeze({
400
398
  export const Protocol = Object.freeze({
401
399
  SSH: 0, "0": "SSH",
402
400
  SFTP: 1, "1": "SFTP",
403
- VNC: 2, "2": "VNC",
401
+ RDP: 2, "2": "RDP",
404
402
  });
405
403
 
406
404
  /**
@@ -491,7 +489,7 @@ function __wbg_get_imports() {
491
489
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
492
490
  return addHeapObject(ret);
493
491
  }, arguments); },
494
- __wbg_info_126a81f879b26b73: function(arg0, arg1) {
492
+ __wbg_info_9b9ea1f18c57361f: function(arg0, arg1) {
495
493
  console.info(getStringFromWasm0(arg0, arg1));
496
494
  },
497
495
  __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
@@ -563,7 +561,7 @@ function __wbg_get_imports() {
563
561
  __wbg_set_onopen_4f65470ae522a61a: function(arg0, arg1) {
564
562
  getObject(arg0).onopen = getObject(arg1);
565
563
  },
566
- __wbg_warn_a34cc328d5dc529a: function(arg0, arg1) {
564
+ __wbg_warn_79b294b9866d9034: function(arg0, arg1) {
567
565
  console.warn(getStringFromWasm0(arg0, arg1));
568
566
  },
569
567
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
Binary file