Skip to content

Commit f8d264a

Browse files
Merge branch 'main' into main
2 parents a048089 + 1921e41 commit f8d264a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

charon/pkgs/radas_signature_handler.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import asyncio
2121
import sys
2222
import uuid
23-
from typing import List, Any, Tuple, Callable, Dict
23+
from typing import List, Any, Tuple, Callable, Dict, Optional
2424
from charon.config import get_config, RadasConfig
2525
from charon.pkgs.oras_client import OrasClient
2626
from proton import SSLDomain, Message, Event
@@ -35,15 +35,24 @@ class RadasReceiver(MessagingHandler):
3535
This receiver will listen to UMB message queue to receive signing message for
3636
signing result.
3737
Attributes:
38-
sign_result_loc (str): Local save path (e.g. “/tmp/sign”) for oras pull result,
39-
this value transfers from the cmd flag, should register UmbListener when the client starts
38+
sign_result_loc (str):
39+
Local save path (e.g. “/tmp/sign”) for oras pull result, this value transfers
40+
from the cmd flag,should register UmbListener when the client starts
41+
request_id (str):
42+
Identifier of the request for the signing result
43+
sign_result_status (str):
44+
Result of the signing(success/failed)
45+
sign_result_errors (list):
46+
Any errors encountered if signing fails, this will be empty list if successful
4047
"""
4148

4249
def __init__(self, sign_result_loc: str, request_id: str) -> None:
4350
super().__init__()
4451
self.sign_result_loc = sign_result_loc
4552
self.request_id = request_id
4653
self.conn = None
54+
self.sign_result_status: Optional[str] = None
55+
self.sign_result_errors: List[str] = []
4756

4857
def on_start(self, event: Event) -> None:
4958
"""
@@ -113,6 +122,8 @@ def _process_message(self, msg: Any) -> None:
113122
logger.info(
114123
"Start to process the sign event message, request_id %s is matched", msg_request_id
115124
)
125+
self.sign_result_status = msg_dict.get("signing_status")
126+
self.sign_result_errors = msg_dict.get("errors", [])
116127
result_reference_url = msg_dict.get("result_reference")
117128
if not result_reference_url:
118129
logger.warning("Not found result_reference in message,ignore.")

0 commit comments

Comments
 (0)