fix: import sshpk as a default so the backend starts under ESM

This commit is contained in:
LukeGus committed 2026-10-07 19:16:15 -05:00
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 ssh2 from "ssh2";
import { parsePrivateKey } from "sshpk";
import sshpk from "sshpk";
import { describe, it, expect } from "vitest";
import { readFileSync } from "node:fs";
import {
@@ -12,6 +12,8 @@ import {
validateKeyPair,
} from "../../utils/ssh-key-utils.js";
const { parsePrivateKey } = sshpk;
// 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
// real rather than only via the text-fallback heuristics.
+2 -1
View File
@@ -1,8 +1,9 @@
import { createPrivateKey } from "node:crypto";
import { parsePrivateKey } from "sshpk";
import sshpk from "sshpk";
import { getErrorMessage } from "./error-message.js";
import ssh2Pkg from "ssh2";
const ssh2Utils = ssh2Pkg.utils;
const { parsePrivateKey } = sshpk;
function detectKeyTypeFromContent(keyContent: string): string {
const content = keyContent.trim();