From 1f26479048e84ad87b2dc2763adf3fa879e89565 Mon Sep 17 00:00:00 2001 From: Jason Sherman Date: Fri, 12 May 2023 11:11:09 -0700 Subject: [PATCH] Multi-tenant self-managed mediation verkey lookup Signed-off-by: Jason Sherman --- aries_cloudagent/multitenant/route_manager.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/aries_cloudagent/multitenant/route_manager.py b/aries_cloudagent/multitenant/route_manager.py index d430aa0c51..954b3c98f9 100644 --- a/aries_cloudagent/multitenant/route_manager.py +++ b/aries_cloudagent/multitenant/route_manager.py @@ -81,8 +81,17 @@ async def _route_for_key( keylist_updates = await mediation_mgr.remove_key( replace_key, keylist_updates ) - - responder = self.root_profile.inject(BaseResponder) + # in order to locate the correct verkey for message packing we need + # to use the correct profile. + # if we are using default/base mediation then we need + # the root_profile to create the responder. + # if sub-wallets are configuring their own mediation, then + # we need the sub-wallet (profile) to create the responder. + responder = ( + self.root_profile.inject(BaseResponder) + if base_mediation_record + else profile.inject(BaseResponder) + ) await responder.send( keylist_updates, connection_id=mediation_record.connection_id )