mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-31 23:55:23 +00:00
fix: import sshpk as a default so the backend starts under ESM
This commit is contained in:
1 parent
fbf7598399
commit
ea678c5602
2 files changed
+5
-2
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
import { generateKeyPairSync } from "node:crypto";
|
import { generateKeyPairSync } from "node:crypto";
|
||||||
import ssh2 from "ssh2";
|
import ssh2 from "ssh2";
|
||||||
import { parsePrivateKey } from "sshpk";
|
import sshpk from "sshpk";
|
||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import { readFileSync } from "node:fs";
|
import { readFileSync } from "node:fs";
|
||||||
import {
|
import {
|
||||||
@@ -12,6 +12,8 @@ import {
|
|||||||
validateKeyPair,
|
validateKeyPair,
|
||||||
} from "../../utils/ssh-key-utils.js";
|
} from "../../utils/ssh-key-utils.js";
|
||||||
|
|
||||||
|
const { parsePrivateKey } = sshpk;
|
||||||
|
|
||||||
// A real OpenSSH ed25519 keypair generated solely for these tests. It grants no
|
// A real OpenSSH ed25519 keypair generated solely for these tests. It grants no
|
||||||
// access to anything and exists only so the ssh2 parsing path is exercised for
|
// access to anything and exists only so the ssh2 parsing path is exercised for
|
||||||
// real rather than only via the text-fallback heuristics.
|
// real rather than only via the text-fallback heuristics.
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { createPrivateKey } from "node:crypto";
|
import { createPrivateKey } from "node:crypto";
|
||||||
import { parsePrivateKey } from "sshpk";
|
import sshpk from "sshpk";
|
||||||
import { getErrorMessage } from "./error-message.js";
|
import { getErrorMessage } from "./error-message.js";
|
||||||
import ssh2Pkg from "ssh2";
|
import ssh2Pkg from "ssh2";
|
||||||
const ssh2Utils = ssh2Pkg.utils;
|
const ssh2Utils = ssh2Pkg.utils;
|
||||||
|
const { parsePrivateKey } = sshpk;
|
||||||
|
|
||||||
function detectKeyTypeFromContent(keyContent: string): string {
|
function detectKeyTypeFromContent(keyContent: string): string {
|
||||||
const content = keyContent.trim();
|
const content = keyContent.trim();
|
||||||
|
|||||||
Reference in new issue
Block a user