Skip to content

Commit

Permalink
Merge pull request #1922 from cjhowland/fix/mediated-agent-endpoint
Browse files Browse the repository at this point in the history
fix: propagate endpoint from mediation record
  • Loading branch information
swcurran authored Sep 6, 2022
2 parents 64b4be3 + 58e9f51 commit ea58a82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aries_cloudagent/wallet/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,10 @@ async def wallet_set_public_did(request: web.BaseRequest):
profile=profile, mediation_id=mediation_id, or_default=True
)
routing_keys = None
mediator_endpoint = None
if mediation_record:
routing_keys = mediation_record.routing_keys
mediator_endpoint = mediation_record.endpoint

try:
info, attrib_def = await promote_wallet_public_did(
Expand All @@ -470,6 +472,7 @@ async def wallet_set_public_did(request: web.BaseRequest):
write_ledger=write_ledger,
connection_id=connection_id,
routing_keys=routing_keys,
mediator_endpoint=mediator_endpoint,
)
except LookupError as err:
raise web.HTTPNotFound(reason=str(err)) from err
Expand Down Expand Up @@ -517,6 +520,7 @@ async def promote_wallet_public_did(
write_ledger: bool = False,
connection_id: str = None,
routing_keys: List[str] = None,
mediator_endpoint: str = None,
) -> DIDInfo:
"""Promote supplied DID to the wallet public DID."""
info: DIDInfo = None
Expand Down Expand Up @@ -584,7 +588,7 @@ async def promote_wallet_public_did(
if not endpoint:
async with session_fn() as session:
wallet = session.inject_or(BaseWallet)
endpoint = context.settings.get("default_endpoint")
endpoint = mediator_endpoint or context.settings.get("default_endpoint")
attrib_def = await wallet.set_did_endpoint(
info.did,
endpoint,
Expand Down

0 comments on commit ea58a82

Please sign in to comment.