From 58b8ef4ce498472980daec4958709b96b4dd2872 Mon Sep 17 00:00:00 2001 From: marinelay Date: Sun, 14 Apr 2024 03:27:29 +0900 Subject: [PATCH] Fix Annotation of `EncryptedCredentials.decrypted_secret` (#4199) Co-authored-by: marinelay --- AUTHORS.rst | 1 + telegram/_passport/credentials.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index e01a2a13e..fe69dba62 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -123,6 +123,7 @@ The following wonderful people contributed directly or indirectly to this projec - `Vorobjev Simon `_ - `Wagner Macedo `_ - `wjt `_ +- `Wonseok Oh `_ - `Yaw Danso `_ - `Yao Kuan `_ - `zeroone2numeral2 `_ diff --git a/telegram/_passport/credentials.py b/telegram/_passport/credentials.py index bc48077b5..525dd473e 100644 --- a/telegram/_passport/credentials.py +++ b/telegram/_passport/credentials.py @@ -153,15 +153,15 @@ class EncryptedCredentials(TelegramObject): self._id_attrs = (self.data, self.hash, self.secret) - self._decrypted_secret: Optional[str] = None + self._decrypted_secret: Optional[bytes] = None self._decrypted_data: Optional[Credentials] = None self._freeze() @property - def decrypted_secret(self) -> str: + def decrypted_secret(self) -> bytes: """ - :obj:`str`: Lazily decrypt and return secret. + :obj:`bytes`: Lazily decrypt and return secret. Raises: telegram.error.PassportDecryptionError: Decryption failed. Usually due to bad