From 0ff25804ae34869a6ddfc889167b26687005419d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=B4=D0=B0?= <93333363+Soda-Na@users.noreply.github.com> Date: Sat, 4 Jan 2025 11:36:45 +0300 Subject: [PATCH 1/2] Fix link formatting for pydantic in migration docs (#1624) --- docs/locale/uk_UA/LC_MESSAGES/migration_2_to_3.po | 4 ++-- docs/migration_2_to_3.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/locale/uk_UA/LC_MESSAGES/migration_2_to_3.po b/docs/locale/uk_UA/LC_MESSAGES/migration_2_to_3.po index 2ffb754f..c797ffac 100644 --- a/docs/locale/uk_UA/LC_MESSAGES/migration_2_to_3.po +++ b/docs/locale/uk_UA/LC_MESSAGES/migration_2_to_3.po @@ -230,11 +230,11 @@ msgstr "" #: ../../migration_2_to_3.rst:71 msgid "" "All API methods are now classes with validation, implemented via " -"`pydantic `. These API calls are also " +"`pydantic `_. These API calls are also " "available as methods in the Bot class." msgstr "" "Всі методи API тепер є класами з валідацією, реалізованими через " -"`pydantic `. Ці виклики API також доступні як" +"`pydantic `_. Ці виклики API також доступні як" " методи в класі Bot." #: ../../migration_2_to_3.rst:74 diff --git a/docs/migration_2_to_3.rst b/docs/migration_2_to_3.rst index 0ac24c99..1a4fc84a 100644 --- a/docs/migration_2_to_3.rst +++ b/docs/migration_2_to_3.rst @@ -83,7 +83,7 @@ Bot API ======= - All API methods are now classes with validation, implemented via - `pydantic `. + `pydantic `_. These API calls are also available as methods in the Bot class. - More pre-defined Enums have been added and moved to the `aiogram.enums` sub-package. For example, the chat type enum is now :class:`aiogram.enums.ChatType` instead of :class:`aiogram.types.chat.ChatType`. From 470226ed7c927a8951e20b7c1189d0bb7552c689 Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Sun, 17 Aug 2025 19:31:11 +0300 Subject: [PATCH 2/2] Reformat code --- aiogram/utils/web_app_signature.py | 4 ++-- tests/test_utils/test_web_app_signature.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aiogram/utils/web_app_signature.py b/aiogram/utils/web_app_signature.py index 623cc802..038026c3 100644 --- a/aiogram/utils/web_app_signature.py +++ b/aiogram/utils/web_app_signature.py @@ -2,10 +2,10 @@ import base64 from operator import itemgetter from urllib.parse import parse_qsl -from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey from cryptography.exceptions import InvalidSignature +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey -from .web_app import parse_webapp_init_data, WebAppInitData +from .web_app import WebAppInitData, parse_webapp_init_data PRODUCTION_PUBLIC_KEY = bytes.fromhex( "e7bf03a2fa4602af4580703d88dda5bb59f32ed8b02a56c187fe7d34caed242d" diff --git a/tests/test_utils/test_web_app_signature.py b/tests/test_utils/test_web_app_signature.py index e8fbba71..247fc32e 100644 --- a/tests/test_utils/test_web_app_signature.py +++ b/tests/test_utils/test_web_app_signature.py @@ -60,4 +60,4 @@ class TestWebAppSignature: 42, "auth_date=1650385342&user=%7B%22id%22%3A42%2C%22first_name%22%3A%22Test%22%7D&query_id=test&hash=123&signature=JQ0JR2tjC65yq_jNZV0wuJVX6J-SWPMV0mprUXG34g-NvxL4RcF1Rz5n4VVo00VRghEUBf5t___uoeb1-j1U_w", PUBLIC_KEY, - ) \ No newline at end of file + )