fix: 内置 dartssh2 2.11.0 补丁版(third_party 本地依赖),修复新版 Dart SDK 下 sftp_client 编译错误
This commit is contained in:
1 parent
6daa9dd361
commit
0a33fabec2
139 files changed
+16497
-1
No files matched your search
+42
@@ -0,0 +1,42 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dartssh2/dartssh2.dart';
|
||||
|
||||
/// A honeypot that accepts all passwords and public-keys
|
||||
Future<SSHClient> getHoneypotClient() async {
|
||||
return SSHClient(
|
||||
await SSHSocket.connect('test.rebex.net', 22),
|
||||
username: 'demo',
|
||||
onPasswordRequest: () => 'password',
|
||||
);
|
||||
}
|
||||
|
||||
/// A honeypot that denies all passwords and public-keys
|
||||
Future<SSHClient> getDenyingHoneypotClient() async {
|
||||
return SSHClient(
|
||||
await SSHSocket.connect('honeypot.terminal.studio', 2023),
|
||||
username: 'root',
|
||||
onPasswordRequest: () => 'random',
|
||||
);
|
||||
}
|
||||
|
||||
/// A test server provided by test.rebex.net.
|
||||
Future<SSHClient> getTestClient() async {
|
||||
return SSHClient(
|
||||
await SSHSocket.connect('test.rebex.net', 22),
|
||||
username: 'demo',
|
||||
onPasswordRequest: () => 'password',
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<SSHKeyPair>> getTestKeyPairs() async {
|
||||
final ed25519Private = fixture('ssh-ed25519/id_ed25519');
|
||||
return SSHKeyPair.fromPem(ed25519Private);
|
||||
}
|
||||
|
||||
/// Get the contents of a test fixture.
|
||||
///
|
||||
/// The path is relative to the test/fixtures directory.
|
||||
String fixture(String path) {
|
||||
return File('test/fixtures/$path').readAsStringSync();
|
||||
}
|
||||
Reference in new issue
Block a user