Skip to content

Commit 65b648b

Browse files
committed
Add sign response status and errors for receiver then use to control the main process
1 parent bf01903 commit 65b648b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

charon/pkgs/radas_signature_handler.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,23 @@ class RadasReceiver(MessagingHandler):
3333
This receiver will listen to UMB message queue to receive signing message for
3434
signing result.
3535
Attributes:
36-
sign_result_loc (str): Local save path (e.g. “/tmp/sign”) for oras pull result,
37-
this value transfers from the cmd flag, should register UmbListener when the client starts
36+
sign_result_loc (str):
37+
Local save path (e.g. “/tmp/sign”) for oras pull result, this value transfers
38+
from the cmd flag,should register UmbListener when the client starts
39+
request_id (str):
40+
Identifier of the request for the signing result
41+
sign_result_status (str):
42+
Result of the signing(success/failed)
43+
sign_result_errors (list):
44+
Any errors encountered if signing fails, this will be empty list if successful
3845
"""
3946

4047
def __init__(self, sign_result_loc: str, request_id: str) -> None:
4148
super().__init__()
4249
self.sign_result_loc = sign_result_loc
4350
self.request_id = request_id
51+
self.sign_result_status: Optional[str] = None
52+
self.sign_result_errors: List[str] = []
4453

4554
def on_start(self, event: Event) -> None:
4655
"""
@@ -95,6 +104,8 @@ def _process_message(self, msg: Any) -> None:
95104
logger.info(
96105
"Start to process the sign event message, request_id %s is matched", msg_request_id
97106
)
107+
self.sign_result_status = msg_dict.get("signing_status")
108+
self.sign_result_errors = msg_dict.get("errors", [])
98109
result_reference_url = msg_dict.get("result_reference")
99110
if not result_reference_url:
100111
logger.warning("Not found result_reference in message,ignore.")

0 commit comments

Comments
 (0)