We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d953456 commit 0502a7bCopy full SHA for 0502a7b
anms-core/anms/routes/ARIs/reports.py
@@ -22,6 +22,7 @@
22
# subcontract 1658085.
23
#
24
from typing import List
25
+import ast
26
27
from fastapi import APIRouter, Depends
28
from fastapi import status
@@ -113,7 +114,12 @@ async def report_ac(agent_id: int, nonce_cbor: str):
113
114
ari = None
115
dec = ace.ari_cbor.Decoder()
116
enc = ace.ari_text.Encoder()
- nonce_cbor = eval(nonce_cbor)
117
+ try:
118
+ nonce_cbor = ast.literal_eval(nonce_cbor)
119
+ except Exception as e:
120
+ logger.error(f"{e} while processing nonce")
121
+ return []
122
+
123
agent_id_str =""
124
agent_id_stmt = select(RegisteredAgent).where(RegisteredAgent.registered_agents_id == agent_id)
125
async with get_async_session() as session:
0 commit comments