-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathsession.pyi
More file actions
106 lines (93 loc) · 4.56 KB
/
session.pyi
File metadata and controls
106 lines (93 loc) · 4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This file is part of ssh2-python.
# Copyright (C) 2017-2025 Panos Kittenis
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, version 2.1.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
from typing import AnyStr, BinaryIO, Final, List, Tuple
from .agent import Agent
from .channel import Channel
from .fileinfo import FileInfo
from .sftp import SFTP
from .knownhost import KnownHost
from .publickey import PublicKeySystem
from .listener import Listener
LIBSSH2_SESSION_BLOCK_INBOUND: int
LIBSSH2_SESSION_BLOCK_OUTBOUND: int
LIBSSH2_HOSTKEY_HASH_MD5: int
LIBSSH2_HOSTKEY_HASH_SHA1: int
LIBSSH2_HOSTKEY_HASH_SHA256: int
LIBSSH2_HOSTKEY_TYPE_ECDSA_256: int
LIBSSH2_HOSTKEY_TYPE_ECDSA_384: int
LIBSSH2_HOSTKEY_TYPE_ECDSA_521: int
LIBSSH2_HOSTKEY_TYPE_ED25519: int
LIBSSH2_HOSTKEY_TYPE_UNKNOWN: int
LIBSSH2_HOSTKEY_TYPE_RSA: int
LIBSSH2_HOSTKEY_TYPE_DSS: int
class MethodType:
value: int
LIBSSH2_METHOD_KEX: MethodType
LIBSSH2_METHOD_HOSTKEY: MethodType
LIBSSH2_METHOD_CRYPT_CS: MethodType
LIBSSH2_METHOD_CRYPT_SC: MethodType
LIBSSH2_METHOD_MAC_CS: MethodType
LIBSSH2_METHOD_MAC_SC: MethodType
LIBSSH2_METHOD_COMP_CS: MethodType
LIBSSH2_METHOD_COMP_SC: MethodType
LIBSSH2_METHOD_LANG_CS: MethodType
LIBSSH2_METHOD_LANG_SC: MethodType
class Session:
def disconnect(self) -> int: ...
def handshake(self, sock: BinaryIO) -> int: ...
def startup(self, sock): ...
def set_blocking(self, blocking: bool) -> None: ...
def get_blocking(self) -> bool: ...
def set_timeout(self, timeout: int) -> None: ...
def get_timeout(self) -> int: ...
def userauth_authenticated(self) -> bool: ...
def userauth_list(self, username: AnyStr) -> List[str]: ...
def userauth_publickey_fromfile(self, username: AnyStr, privatekey: AnyStr,
passphrase: str=u'', publickey: AnyStr | None=None) -> int: ...
def userauth_publickey(self, username: AnyStr, pubkeydata: bytes) -> int: ...
def userauth_hostbased_fromfile(self, username: AnyStr, privatekey: AnyStr, hostname: AnyStr,
publickey: AnyStr | None=None, passphrase: str=u'') -> int: ...
def userauth_publickey_frommemory(self, username: AnyStr, privatekeyfiledata: bytes, passphrase: str=u'',
publickeyfiledata: bytes | None = None) -> int: ...
def userauth_password(self, username: AnyStr, password: AnyStr) -> int: ...
def userauth_keyboardinteractive(self, username: AnyStr, password: AnyStr) -> int: ...
def agent_init(self) -> Agent: ...
def agent_auth(self, username: AnyStr) -> None: ...
def open_session(self) -> Channel | None: ...
def direct_tcpip_ex(self, host: AnyStr, port: int, shost: AnyStr, sport: int) -> Channel | None: ...
def direct_tcpip(self, host: AnyStr, port: int) -> Channel | None: ...
def block_directions(self) -> int: ...
def forward_listen(self, port: int) -> "Listener" | None: ...
def forward_listen_ex(self, queue_maxsize: int, host: AnyStr | None=None,
port: int = 0) -> Tuple[Listener, int] | None: ...
def sftp_init(self) -> SFTP: ...
def last_error(self, msg_size: int = 1024): ...
def last_errno(self): ...
def set_last_error(self, errcode: int, errmsg: AnyStr) -> int: ...
def scp_recv(self, path): ...
def scp_recv2(self, path) -> Tuple[Channel, FileInfo] | None: ...
def scp_send(self, path, mode: int, size: int): ...
def scp_send64(self, path: AnyStr, mode: int, size: int, mtime: int, atime: int) -> Channel: ...
def publickey_init(self) -> PublicKeySystem: ...
def hostkey_hash(self, hash_type: int) -> bytes: ...
def hostkey(self) -> Tuple[bytes, int]: ...
def knownhost_init(self) -> KnownHost: ...
def keepalive_config(self, want_reply: bool, interval: int) -> None: ...
def keepalive_send(self) -> int: ...
def supported_algs(self, method_type: MethodType) -> List[str]: ...
def methods(self, method_type: MethodType) -> str: ...
def method_pref(self, method_type: MethodType, prefs) -> int: ...
sock: Final[BinaryIO] = ...