From aa58604c7a94afab0c99a4c97fae9969b90ddfab Mon Sep 17 00:00:00 2001 From: Rafal Witczak Date: Thu, 15 Nov 2018 11:14:43 +0100 Subject: [PATCH] Fix privateKey/publicKey casing in ssh2-streams --- types/ssh2-streams/index.d.ts | 4 ++-- types/ssh2-streams/ssh2-streams-tests.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/ssh2-streams/index.d.ts b/types/ssh2-streams/index.d.ts index a7ff80243b..a780273591 100644 --- a/types/ssh2-streams/index.d.ts +++ b/types/ssh2-streams/index.d.ts @@ -659,8 +659,8 @@ export interface HostKeys { } export interface HostKey { - privatekey: ParsedKey; - publickey: ParsedKey; + privateKey: ParsedKey; + publicKey: ParsedKey; } /** diff --git a/types/ssh2-streams/ssh2-streams-tests.ts b/types/ssh2-streams/ssh2-streams-tests.ts index 7f140b4bbd..9ae121a454 100644 --- a/types/ssh2-streams/ssh2-streams-tests.ts +++ b/types/ssh2-streams/ssh2-streams-tests.ts @@ -2,16 +2,17 @@ import * as stream from "stream"; import * as ssh2 from "ssh2-streams"; declare const SERVER_KEY: string; -declare const HOST_KEYS: { 'ssh-rsa': ssh2.HostKey }; +declare const HOST_KEY: { publicKey: ssh2.ParsedKey; privateKey: ssh2.ParsedKey }; declare const clientBufStream: stream.Transform & { buffer: string; }; declare const serverBufStream: stream.Transform & { buffer: string; }; declare const parsedKey: ssh2.ParsedKey; declare const prompts: ssh2.Prompt[]; declare const buffer: Buffer; +const hostKeys = { 'ssh-rsa': HOST_KEY }; const algos = ['ssh-dss', 'ssh-rsa', 'ecdsa-sha2-nistp521']; const client = new ssh2.SSH2Stream({ algorithms: { serverHostKey: algos } }); -const server = new ssh2.SSH2Stream({ server: true, hostKeys: HOST_KEYS }); +const server = new ssh2.SSH2Stream({ server: true, hostKeys: hostKeys }); client .pipe(server)