Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: propagate endpoint from mediation record #1922

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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