-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[paramiko] Update to 5.0.0 #15907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[paramiko] Update to 5.0.0 #15907
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,30 @@ | ||
| from _typeshed import FileDescriptorOrPath, ReadableBuffer | ||
| from typing import IO | ||
| from typing import Any, Final, TypeAlias | ||
|
|
||
| from paramiko.message import Message | ||
| from paramiko.pkey import PKey | ||
| from paramiko.pkey import PKey, _HasReadlines | ||
|
|
||
| _VerifyKey: TypeAlias = Any # actually nacl.signing.VerifyKey | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pynacl looks to be fully typed and has a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just confirmed that |
||
|
|
||
| class Ed25519Key(PKey): | ||
| name: Final = "ssh-ed25519" | ||
|
|
||
| public_blob: None | ||
|
|
||
| def __init__( | ||
| self, | ||
| msg: Message | None = None, | ||
| data: ReadableBuffer | None = None, | ||
| filename: FileDescriptorOrPath | None = None, | ||
| password: str | None = None, | ||
| file_obj: IO[str] | None = None, | ||
| file_obj: _HasReadlines | None = None, | ||
| ) -> None: ... | ||
| def asbytes(self) -> bytes: ... | ||
| def __hash__(self) -> int: ... | ||
| def get_name(self) -> str: ... | ||
| def get_bits(self) -> int: ... | ||
| def can_sign(self) -> bool: ... | ||
| def can_verify(self) -> bool: ... | ||
| @property | ||
| def verifying_key(self) -> _VerifyKey | None: ... | ||
| def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ... | ||
| def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,28 @@ | ||
| from _hashlib import HASH | ||
| from _typeshed import ReadableBuffer | ||
| from collections.abc import Callable | ||
| from hashlib import _Hash | ||
| from typing import ClassVar, Final | ||
|
|
||
| from paramiko.kex_group1 import KexGroup1 as KexGroup1 | ||
| from paramiko.message import Message | ||
| from paramiko.transport import Transport | ||
|
|
||
| class KexGroup14(KexGroup1): | ||
| P: int | ||
| G: int | ||
| name: str | ||
| hash_algo: Callable[[ReadableBuffer], _Hash] | ||
| c_MSG_KEXDH_INIT: Final[bytes] | ||
| c_MSG_KEXDH_REPLY: Final[bytes] | ||
| b7fffffffffffffff: Final[bytes] | ||
| b0000000000000000: Final[bytes] | ||
|
|
||
| class KexGroup14SHA256(KexGroup14): | ||
| name: str | ||
| hash_algo: Callable[[ReadableBuffer], _Hash] | ||
| class KexGroup14SHA256: | ||
| P: ClassVar[int] | ||
| G: ClassVar[int] | ||
|
|
||
| name: ClassVar[str] | ||
| hash_algo: ClassVar[Callable[[ReadableBuffer], HASH]] | ||
|
|
||
| transport: Transport | ||
| x: int | ||
| e: int | ||
| f: int | ||
|
|
||
| def __init__(self, transport: Transport) -> None: ... | ||
| def start_kex(self) -> None: ... | ||
| def parse_next(self, ptype: int, m: Message) -> None: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,3 @@ | ||
| from _typeshed import ReadableBuffer | ||
| from collections.abc import Callable | ||
| from hashlib import _Hash | ||
| from paramiko.kex_group14 import KexGroup14SHA256 | ||
|
|
||
| from paramiko.kex_group1 import KexGroup1 as KexGroup1 | ||
|
|
||
| class KexGroup16SHA512(KexGroup1): | ||
| name: str | ||
| P: int | ||
| G: int | ||
| hash_algo: Callable[[ReadableBuffer], _Hash] | ||
| class KexGroup16SHA512(KexGroup14SHA256): ... |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while it's true that any iterable of strings will work at runtime, the docstrings say that a file-like object is expected, and
IO[str]does express that it should be an iterable of lines (rather than an iterable of words or characters).I know you're generally opposed to using
IO, though, and I share your philosophy there... not sure if there's a protocol that could also express "this needs to be an iterable of lines of source code" in the same way...Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well,
Iterable[str]is explicitly named for situations like this by the Python docs, but then that section was also written be me IIRC, so make of it what you will.That said, maybe for now we could add a type alias to
_typeshedand at some point this might become something more.