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

do not crash on connection request/response creation if no endpoints … #497

Merged
merged 2 commits into from
May 8, 2020
Merged
Show file tree
Hide file tree
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
10 changes: 8 additions & 2 deletions aries_cloudagent/protocols/connections/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ async def create_request(

# Create connection request message
if not my_endpoint:
my_endpoints = [self.context.settings.get("default_endpoint")]
my_endpoints = []
default_endpoint = self.context.settings.get("default_endpoint")
if default_endpoint:
my_endpoints.append(default_endpoint)
my_endpoints.extend(self.context.settings.get("additional_endpoints", []))
else:
my_endpoints = [my_endpoint]
Expand Down Expand Up @@ -478,7 +481,10 @@ async def create_response(

# Create connection response message
if not my_endpoint:
my_endpoints = [self.context.settings.get("default_endpoint")]
my_endpoints = []
default_endpoint = self.context.settings.get("default_endpoint")
if default_endpoint:
my_endpoints.append(default_endpoint)
my_endpoints.extend(self.context.settings.get("additional_endpoints", []))
did_doc = await self.create_did_document(
my_info, connection.inbound_connection_id, my_endpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def setUp(self):
{
"default_endpoint": "http://aries.ca/endpoint",
"default_label": "This guy",
"additional_endpoints": [],
"additional_endpoints": ["http://aries.ca/another-endpoint"],
"debug.auto_accept_invites": True,
"debug.auto_accept_requests": True,
}
Expand Down