File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import base64
22
3- from typing import Any
3+ from typing import TYPE_CHECKING , Any
4+
5+
6+ if TYPE_CHECKING :
7+ from cryptography .fernet import Fernet
48
5- from cryptography .fernet import (
6- Fernet ,
7- )
89from google .protobuf .json_format import MessageToDict , ParseDict
910
1011from a2a .compat .v0_3 import types as types_v03
@@ -1415,7 +1416,7 @@ def core_to_compat_push_notification_config_model(
14151416 task_id : str ,
14161417 config : pb2_v10 .TaskPushNotificationConfig ,
14171418 owner : str ,
1418- fernet : Fernet | None = None ,
1419+ fernet : ' Fernet | None' = None ,
14191420) -> PushNotificationConfigModel :
14201421 """Converts a 1.0 core TaskPushNotificationConfig to a PushNotificationConfigModel using v0.3 JSON structure."""
14211422 compat_config = to_compat_push_notification_config (config )
Original file line number Diff line number Diff line change 33import pytest
44
55from google .protobuf .json_format import ParseDict
6+ import json
67
78from a2a .compat .v0_3 import types as types_v03
89from a2a .compat .v0_3 .conversions import (
@@ -2001,7 +2002,6 @@ def test_push_notification_config_persistence_conversion_with_encryption():
20012002
20022003 # Decrypt and verify
20032004 decrypted_data = fernet .decrypt (model .config_data )
2004- import json
20052005
20062006 data = json .loads (decrypted_data .decode ('utf-8' ))
20072007 assert data ['url' ] == 'https://example.com/push'
You can’t perform that action at this time.
0 commit comments