Skip to content

Commit

Permalink
feat: Add first pass of DIDComm V2 response
Browse files Browse the repository at this point in the history
Signed-off-by: Colton Wolkins (Indicio work address) <colton@indicio.tech>
  • Loading branch information
TheTechmage committed May 14, 2024
1 parent 00a1f52 commit 1c34582
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
24 changes: 23 additions & 1 deletion aries_cloudagent/core/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,29 @@ async def handle_v2_message(

# send a DCV2 Problem Report here for testing, and to punt procotol handling down
# the road a bit
logging.getLogger(__name__).debug("HIT V2 DISPATCHER HANDLER")
logging.getLogger(__name__).debug("HIT V2 DISPATCHER HANDLER S-00001")
context = RequestContext(profile)
#context.message = message
context.message_receipt = inbound_message.receipt
responder = DispatcherResponder(
context,
inbound_message,
send_outbound,
reply_session_id=inbound_message.session_id,
reply_to_verkey=inbound_message.receipt.sender_verkey,
)

context.injector.bind_instance(BaseResponder, responder)
#responder.connection_id = connection and connection.connection_id
error_result = ProblemReport(
description={
"en": str("No Handlers Found -- Colton"),
"code": "message-parse-failure",
}
)
logging.getLogger(__name__).debug("CONSTRUCTED V2 DISPATCHER RESPONSE")
await responder.send_reply(error_result)
logging.getLogger(__name__).debug("LEFT V2 DISPATCHER HANDLER")

async def handle_v1_message(
self,
Expand Down
3 changes: 3 additions & 0 deletions aries_cloudagent/transport/pack_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ async def parse_message(

receipt.parent_thread_id = message_dict.get("pthid")

# handle transport decorator
receipt.direct_response_mode = message_dict.get("return_route")

LOGGER.debug("Expanded message: %s", message_dict)

return message_dict, receipt

0 comments on commit 1c34582

Please sign in to comment.